From: oetiker Date: Sun, 14 Mar 2004 20:58:32 +0000 (+0000) Subject: make MakeMaker work on debian and fix some leftovers from the library rip-out transition X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=24b863ca84b20f71527acf9c43fce68de252e28b;p=rrdtool-all.git make MakeMaker work on debian and fix some leftovers from the library rip-out transition -- Tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@239 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/MakeMakefile b/program/MakeMakefile index 59d098f1..6e2250a6 100755 --- a/program/MakeMakefile +++ b/program/MakeMakefile @@ -20,10 +20,34 @@ then exit 1 fi -if vcheck 1.7.9 "automake --version" +#if vcheck 1.8.2 "automake --version" +#then +# if vcheck 1.8.2 "automake-1.8 --version" +# then +# echo "get a copy of GNU automake >= 1.8.2" +# exit 1 +# else +# automake=automake-1.8 +# aclocal="aclocal-1.8 --acdir=/usr/share/aclocal-1.8 -I /usr/share/aclocal/" +# fi +#else +# automake="automake" +# aclocal="aclocal -I /usr/pack/libtool-1.5-to/share/aclocal" +#fi + +if vcheck 1.7.9 "automake --version" then - echo "get a copy of GNU automake >= 1.7.9" - exit 1 + if vcheck 1.7.9 "automake-1.7 --version" + then + echo "get a copy of GNU automake >= 1.79" + exit 1 + else + automake=automake-1.7 + aclocal="aclocal-1.7 --acdir=/usr/share/aclocal-1.7 -I /usr/share/aclocal/" + fi +else + automake="automake" + aclocal="aclocal -I /usr/pack/libtool-1.5-to/share/aclocal" fi if vcheck 2.58 "autoconf --version" @@ -40,8 +64,6 @@ find . -name .libs | xargs rm -r find . -name .debs | xargs rm -r -rm -rf config -mkdir config # wget ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.tar.gz libtoolize --copy --force #cp ltmain.sh config @@ -50,8 +72,8 @@ libtoolize --copy --force # If autoconf generates undefined MACRO errors, it may be unable # to find libtool.m4. Add the -I flag to aclocal to specify the # directory location of this file. -aclocal -I /usr/pack/libtool-1.5-to/share/aclocal -automake --foreign --add-missing --force-missing --copy --warnings=all +$aclocal +$automake --foreign --add-missing --force-missing --copy --warnings=all # wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.58.tar.gz autoconf --warnings=all --force rm config.h.in diff --git a/program/acinclude.m4 b/program/acinclude.m4 index 08785921..6c50060a 100644 --- a/program/acinclude.m4 +++ b/program/acinclude.m4 @@ -3,7 +3,7 @@ # --------------------------------------------- # Contributed by Mat Zimmermann # -AC_DEFUN(INCLUDED_LIB, +AC_DEFUN([INCLUDED_LIB], [ use_installed_lib$1= AC_ARG_WITH([lib$1], diff --git a/program/bindings/Makefile.am b/program/bindings/Makefile.am index d2eaad34..d723caf3 100644 --- a/program/bindings/Makefile.am +++ b/program/bindings/Makefile.am @@ -23,7 +23,7 @@ perl-piped/Makefile: perl-piped/Makefile.PL cd perl-piped && $(PERL) Makefile.PL $(PERL_MAKE_OPTIONS) perl_shared: perl-shared/Makefile - cd perl-shared && $(MAKE) + cd perl-shared && $(MAKE) RPATH=$(prefix)/lib perl-shared/Makefile: perl-shared/Makefile.PL cd perl-shared && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) diff --git a/program/bindings/perl-shared/Makefile.PL b/program/bindings/perl-shared/Makefile.PL index 2b59fdb0..598fc99f 100644 --- a/program/bindings/perl-shared/Makefile.PL +++ b/program/bindings/perl-shared/Makefile.PL @@ -4,7 +4,8 @@ use Config; # the contents of the Makefile that is written. # Specify the location of the archive containing PIC compiled object files. -my $librrd = "-L../../src/.libs/ -lrrd" ; +my $R = $^O eq 'Linux' ? "-Wl,--rpath -Wl," : "-R" ; +my $librrd = "-L../../src/.libs/ $R\$(RPATH) -lrrd"; WriteMakefile( 'NAME' => 'RRDs', @@ -13,7 +14,7 @@ WriteMakefile( 'INC' => '-I../../src -I../../libraries/gd1.3', # where to look for the necessary libraries # Perl will figure out which one is valid - 'depend' => {'RRDs.c' => "../../src/.libs/librrd_private.a"}, + 'depend' => {'RRDs.c' => "../../src/.libs/librrd.a"}, 'dynamic_lib' => {'OTHERLDFLAGS' => "$librrd -lm"}, 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' } ); diff --git a/program/bindings/perl-shared/RRDs.pm b/program/bindings/perl-shared/RRDs.pm index 6ee4b3d3..fbb885ad 100644 --- a/program/bindings/perl-shared/RRDs.pm +++ b/program/bindings/perl-shared/RRDs.pm @@ -51,10 +51,9 @@ Note that is also valid. - The RRDs::times function takes two parameters: a "start" and "end" time. -These should be specified in the U format -used by rrdtool. See the U documentation for a detailed +These should be specified in the B format +used by rrdtool. See the B documentation for a detailed explanation on how to specify time. =head2 Error Handling diff --git a/program/bindings/perl-shared/t/base.t b/program/bindings/perl-shared/t/base.t index 8154a11a..7b6c016a 100755 --- a/program/bindings/perl-shared/t/base.t +++ b/program/bindings/perl-shared/t/base.t @@ -85,7 +85,7 @@ my $counter = 1e7; for (my $t=$START+1; $t<$START+$STEP*$RUNS; $t+=$STEP+int((rand()-0.5)*7)){ - $counter += 2500*sin($t/2000)*$STEP; + $counter += int(2500*sin($t/2000)*$STEP); my $data = (1000+500*sin($t/1000)).":". (1000+900*sin($t/2330)).":". (2000*cos($t/1550)).":". @@ -161,7 +161,11 @@ foreach my $line (@$array){ print "".localtime($start)," "; $start += $step; foreach my $val (@$line) { - printf "%12.1f", $val; + if (not defined $val){ + printf "%12s", "UNKNOWN"; + } else { + printf "%12.1f", $val; + } } print "\n"; } diff --git a/program/configure.ac b/program/configure.ac index a7ff7148..254ad3d1 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -6,11 +6,11 @@ dnl dnl dnl tell automake the this script is for rrdtool -AC_INIT(src/rrd_tool.c) -AC_CONFIG_AUX_DIR(config) -AC_CANONICAL_TARGET([]) -AM_INIT_AUTOMAKE(rrdtool, 1.1.0) +AC_INIT([rrdtool],[1.1.0]) +AM_INIT_AUTOMAKE +AC_CANONICAL_TARGET AM_CONFIG_HEADER(config.h) +# AC_CONFIG_AUX_DIR(config) dnl all our local stuff like install scripts and include files dnl is in there @@ -25,7 +25,7 @@ dnl where we install our stuff ... AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.1.0 ) dnl Minimum Autoconf version required. -AC_PREREQ(2.52) +AC_PREREQ(2.58) dnl At the TOP of the HEADER @@ -158,9 +158,12 @@ AC_SUBST(PERLFLAGS) dnl Checks for libraries. AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos)) -AC_DEFUN(EX_CHECK_ALL, +AC_DEFUN([EX_CHECK_ALL], [ AC_CHECK_LIB($1,$2, - [ AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}"],AC_MSG_ERROR([Adjust CPPFLAGS so that the $4 header $3 gets found])) ], + [ AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}"],[ + [ $echo "#include <$3>" | $CC -E - > /dev/null ] + AC_MSG_ERROR([Adjust CPPFLAGS so that the $4 header $3 AND its dependencies gets found]) + ] ) ], [ AC_MSG_ERROR([ ############################################################################ I could not find a working copy of $4. Check config.log for hints on why @@ -259,9 +262,7 @@ if test "x$GCC" = "xyes"; then oCFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -W" AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt, - [AC_TRY_COMPILE( , return 0 , - rd_cv_gcc_opt=yes, - rd_cv_gcc_opt=no ) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0 ]])],[rd_cv_gcc_opt=yes],[rd_cv_gcc_opt=no ]) ] ) if test $rd_cv_gcc_opt = no; then @@ -293,32 +294,28 @@ AC_CHECK_FUNCS(tzset opendir readdir chdir chroot getuid setlocale strerror stre dnl HP-UX 11.00 does not have finite but does have isfinite as a macro AC_CHECK_FUNCS(fpclassify, , [AC_MSG_CHECKING(for fpclassify with ) - AC_TRY_LINK([#include ], [float f = 0.0; fpclassify(f)], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FPCLASSIFY), AC_MSG_RESULT(no))]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[float f = 0.0; fpclassify(f)]])],[AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FPCLASSIFY)],[AC_MSG_RESULT(no)])]) AC_CHECK_FUNCS(finite, , [AC_CHECK_FUNCS(isfinite, , [AC_MSG_CHECKING(for isfinite with ) - AC_TRY_LINK([#include ], [float f = 0.0; isfinite(f)], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ISFINITE), AC_MSG_RESULT(no))])]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[float f = 0.0; isfinite(f)]])],[AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISFINITE)],[AC_MSG_RESULT(no)])])]) AC_CHECK_FUNCS(isinf, , [AC_MSG_CHECKING(for isinf with ) - AC_TRY_LINK([#include ], [float f = 0.0; isinf(f)], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no))]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[float f = 0.0; isinf(f)]])],[AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISINF)],[AC_MSG_RESULT(no)])]) dnl what does realloc do if it gets called with a NULL pointer AC_CACHE_CHECK([if realloc can deal with NULL], rd_cv_null_realloc, -[AC_TRY_RUN([#include +[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int main(void){ char *x = NULL; x = realloc (x,10); if (x==NULL) return 1; return 0; - }], - [rd_cv_null_realloc=yes],[rd_cv_null_realloc=nope],:)]) + }]])],[rd_cv_null_realloc=yes],[rd_cv_null_realloc=nope],[:])]) if test x"$rd_cv_null_realloc" = xnope; then AC_DEFINE(NO_NULL_REALLOC) @@ -330,10 +327,10 @@ dnl FUNCTION-BODY, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) AC_C_BIGENDIAN -AC_DEFUN(AC_IEEE, +AC_DEFUN([AC_IEEE], AC_MSG_CHECKING([if IEEE math works $1]) AC_CACHE_VAL([rd_cv_ieee_$2], -[AC_TRY_RUN([$3 +[AC_RUN_IFELSE([AC_LANG_SOURCE([[$3 #if HAVE_MATH_H # include @@ -397,11 +394,7 @@ int main(void){ if (! inf > 0) {printf ("not inf > 0 ... "); return 1;} if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;} return 0; - }], - -rd_cv_ieee_$2=yes, -rd_cv_ieee_$2=no, -:)]) + }]])],[rd_cv_ieee_$2=yes],[rd_cv_ieee_$2=no],[:])]) dnl these we run regardles is cached or not if test x${rd_cv_ieee_$2} = "xyes"; then AC_MSG_RESULT(yes) diff --git a/program/doc/Makefile.am b/program/doc/Makefile.am index 261e8c77..3fc96a41 100644 --- a/program/doc/Makefile.am +++ b/program/doc/Makefile.am @@ -35,7 +35,7 @@ ihtml_DATA = $(HTML) imandir = $(prefix)/man/man1 iman_DATA = $(MAN) -all-local: link txt man html +all-local: link txt man html-local .src.pod: perl -n -e 'if (/^=include\s+(\S+)/){open F,"$$1.inc" || die $$?;print ; close F} else {print}' $< > $@ @@ -65,9 +65,9 @@ link: RRDp.pm RRDs.pm index.html man: $(MAN) -html: $(HTML) +html-local: $(HTML) txt: $(TXT) -pdf: $(PDF) +pdf-local: $(PDF)