From 3a132b3942dc37f7353f8f12168d407ac72cf91f Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 19 Jan 2004 23:17:00 +0000 Subject: [PATCH] misc fixes to get rrdtool working without included libraries. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@232 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/MakeMakefile | 33 +++++---- program/Makefile.am | 2 +- program/NEWS | 4 ++ program/README | 38 +++++++--- program/bindings/Makefile.am | 2 +- program/bindings/perl-shared/Makefile.PL | 2 +- program/bindings/perl-shared/RRDs.xs | 2 +- program/bindings/tcl/Makefile.am | 2 +- program/configure.ac | 90 ++++++++++++------------ program/doc/rrdcgi.pod | 2 +- program/libraries/Makefile.am | 2 +- 11 files changed, 104 insertions(+), 75 deletions(-) diff --git a/program/MakeMakefile b/program/MakeMakefile index 28c62ed9..59d098f1 100755 --- a/program/MakeMakefile +++ b/program/MakeMakefile @@ -14,19 +14,19 @@ PERL } -if vcheck 1.4.2 "libtool --version" +if vcheck 1.5 "libtool --version" then - echo "get a copy of GNU libtool >= 1.4.2" + echo "get a copy of GNU libtool >= 1.5" exit 1 fi -if vcheck 1.7 "automake-1.7 --version" +if vcheck 1.7.9 "automake --version" then - echo "get a copy of GNU automake >= 1.7" + echo "get a copy of GNU automake >= 1.7.9" exit 1 fi -if vcheck 2.54 "autoconf --version" +if vcheck 2.58 "autoconf --version" then echo "get a copy of GNU autoconf >= 2.54" exit 1 @@ -36,22 +36,25 @@ set -x find . -name Makefile | xargs rm -f find . -name "*.la" | xargs rm -f find . -name Makefile.in | xargs rm -f +find . -name .libs | xargs rm -r +find . -name .debs | xargs rm -r - -# wget ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.2.tar.gz +rm -rf config +mkdir config +# wget ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.tar.gz libtoolize --copy --force -cp ltmain.sh config +#cp ltmain.sh config -# wget ftp://sources.redhat.com/pub/automake/automake-1.5.tar.gz +# wget ftp://sources.redhat.com/pub/automake/automake-1.7.9.tar.gz # 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 -autoheader --warnings=all -automake-1.7 --foreign --add-missing --force-missing --copy - -# wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.52.tar.gz -autoconf +aclocal -I /usr/pack/libtool-1.5-to/share/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 +autoheader --warnings=all --force diff --git a/program/Makefile.am b/program/Makefile.am index ea6447aa..8951c777 100644 --- a/program/Makefile.am +++ b/program/Makefile.am @@ -2,7 +2,7 @@ RSYNC = rsync --rsh=ssh # build the following subdirectories -SUBDIRS = libraries src bindings doc examples +SUBDIRS = src bindings doc examples # the following files are not mentioned in any other Makefile EXTRA_DIST = COPYRIGHT CHANGES NT-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \ diff --git a/program/NEWS b/program/NEWS index b8347f28..43222db5 100644 --- a/program/NEWS +++ b/program/NEWS @@ -5,6 +5,10 @@ RRDTOOL NEWS In this file I am noting the Major changes to rrdtool for details check the cvs ChangeLog +2004/01/20 Tobi Oetiker + Ripped out all foreign libraries and adapted + Configure and Makefiles and accordingly. + 2002/03/26 Peter Speck Contribution of an svg output routine for the new gfx graphing part diff --git a/program/README b/program/README index dba9e271..47f727f4 100644 --- a/program/README +++ b/program/README @@ -14,8 +14,33 @@ values collected over a definable time period. To compile: ----------- - sh configure + you need the following libraries installed on your system. + + cgilib-0.5.tar.gz + freetype-2.1.5.tar.gz + libart_lgpl-2.3.16.tar.gz + libpng-1.2.5.tar.gz + zlib-1.2.1.tar.gz + + you can either get these libraries directly from their original sites + or you can get copies from + + http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs + + if the libraries are not installed in standard places you may need + to set CPPFLAGS and LDFLAGS accordingly. This will be improved in further + editions of this developers series. Here is an example call. + + env CPPFLAGS="-I/scratch/oetiker/cgilib-0.5 \ + -I/scratch/oetiker/lib/include/libart-2.0 \ + -I/scratch/oetiker/lib/include \ + -I/scratch/oetiker/lib/include/freetype2" \ + LDFLAGS="-L/scratch/oetiker/lib/lib -R/scratch/oetiker/lib/lib \ + -L/scratch/oetiker/cgilib-0.5" \ + ./configure --prefix=/scratch/oetiker/lib + make <------ GNU make + make install <------ GNU make This will configure, compile and install RRDtool in @@ -24,11 +49,6 @@ place, use sh configure --prefix=/some/other/RRDtool-dir -If you prefer to live with shared libraries, make sure you add the ---enable-shared option to your configure call. - - sh configure --enable-shared - The configure script will try to find your perl installation (5.004 preferred). If it does not find it, you can still build RRDtool but no perl modules will be generated. @@ -40,8 +60,8 @@ directory, you can also use make site-perl-install -will install the perl modules whereever you keep your local perl modules. -Doing this reliefs you from using 'use lib' in your scripts. +this will install the perl modules whereever you keep your local perl +modules. Doing this reliefs you from using 'use lib' in your scripts. Configure will also look for an TCL installation on your system. If it finds one it will build a TCL interface for rrdtool. If you keep tcl in a non @@ -113,7 +133,7 @@ Use GNU diff --unified --recursive olddir newdir to build your patches. The latest Version: ------------------- -Is available from http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/ +Is available from http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ Tobias Oetiker diff --git a/program/bindings/Makefile.am b/program/bindings/Makefile.am index facb9158..d2eaad34 100644 --- a/program/bindings/Makefile.am +++ b/program/bindings/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = tcl # the following files are not mentioned in any other Makefile -EXTRA_DIST = $(shell for A in $(srcdir)/perl-*; do cat $$A/MANIFEST | sed -e s,^,$$A/, ; done) +EXTRA_DIST = $(shell for A in perl-*; do cat $$A/MANIFEST | sed -e s,^,$$A/, ; done) # lets schedule the perl stuff for installation # the special call to install-sh is because the -d switch is not portable diff --git a/program/bindings/perl-shared/Makefile.PL b/program/bindings/perl-shared/Makefile.PL index 76a81541..2b59fdb0 100644 --- a/program/bindings/perl-shared/Makefile.PL +++ b/program/bindings/perl-shared/Makefile.PL @@ -4,7 +4,7 @@ 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_private" ; +my $librrd = "-L../../src/.libs/ -lrrd" ; WriteMakefile( 'NAME' => 'RRDs', diff --git a/program/bindings/perl-shared/RRDs.xs b/program/bindings/perl-shared/RRDs.xs index da77457f..bf108e37 100644 --- a/program/bindings/perl-shared/RRDs.xs +++ b/program/bindings/perl-shared/RRDs.xs @@ -277,7 +277,7 @@ rrd_times(start, end) char *start char *end PREINIT: - struct time_value start_tv, end_tv; + struct rrd_time_value start_tv, end_tv; char *parsetime_error = NULL; time_t start_tmp, end_tmp; PPCODE: diff --git a/program/bindings/tcl/Makefile.am b/program/bindings/tcl/Makefile.am index ca726b7a..7fd70129 100644 --- a/program/bindings/tcl/Makefile.am +++ b/program/bindings/tcl/Makefile.am @@ -14,7 +14,7 @@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ GD_LIB_DIR = $(top_srcdir)/@GD_LIB_DIR@ SRC_DIR = $(top_srcdir)/src -INCLUDES = -I$(TCL_PREFIX)/include -I$(SRC_DIR) -I$(GD_LIB_DIR) +AM_CPPFLAGS = -I$(TCL_PREFIX)/include -I$(SRC_DIR) -I$(GD_LIB_DIR) LIBDIRS = -L$(libdir) -L$(SRC_DIR) -L../src/.libs LIB_RUNTIME_DIR = $(libdir) diff --git a/program/configure.ac b/program/configure.ac index bbed6da3..a7ff7148 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -10,7 +10,7 @@ AC_INIT(src/rrd_tool.c) AC_CONFIG_AUX_DIR(config) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(rrdtool, 1.1.0) -AM_CONFIG_HEADER(config/config.h) +AM_CONFIG_HEADER(config.h) dnl all our local stuff like install scripts and include files dnl is in there @@ -136,26 +136,55 @@ char *strchr (), *strrchr (); ]) -dnl Define library subdirectory names here. -CGI_LIB_DIR=cgilib-0.4 -FREETYPE_LIB_DIR=freetype-2.0.5 -ART_LIB_DIR=libart_lgpl-2.3.7 -PNG_LIB_DIR=libpng-1.2.0 -ZLIB_LIB_DIR=zlib-1.1.4 + +dnl Check for the compiler and static/shared library creation. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_LIBTOOL + +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_DIRENT +AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h time.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_HEADER_TIME +AC_STRUCT_TM dnl substitute them in all the files listed in AC_OUTPUT -AC_SUBST(CGI_LIB_DIR) -AC_SUBST(ART_LIB_DIR) -AC_SUBST(PNG_LIB_DIR) -AC_SUBST(FREETYPE_LIB_DIR) -AC_SUBST(ZLIB_LIB_DIR) AC_SUBST(PERLFLAGS) -INCLUDED_LIB(cgi,cgiInit) -INCLUDED_LIB(art_lgpl,art_vpath_add_point) -INCLUDED_LIB(png,png_access_version_number) -INCLUDED_LIB(freetype,FT_Init_FreeType) -INCLUDED_LIB(z,zlibVersion) +dnl Checks for libraries. +AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos)) + +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_MSG_ERROR([ +############################################################################ +I could not find a working copy of $4. Check config.log for hints on why +this is the case. Maybe you need to set LDFLAGS appropriately so that the +linker can find lib$1. If you have not installed $4, you can get it +either from its original home on + + $6 + +Or you can find an archive copy on + + http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs + +The last tested version of $4 is $5. +############################################################################ +])] ) +] +) + +EX_CHECK_ALL(cgi, cgiInit, cgi.h, cgilib, 0.5, http://www.infodrom.org/projects/cgilib) +EX_CHECK_ALL(art_lgpl_2, art_vpath_add_point, libart_lgpl/libart.h, libart_lgpl, 2.3.16, ftp://ftp.gnome.org/pub/GNOME/sources/libart_lgpl/2.3/) +EX_CHECK_ALL(z, zlibVersion, zlib.h, zlib, 1.2.1, http://www.gzip.org/zlib/) +EX_CHECK_ALL(png, png_access_version_number, png.h, libpng, 1.2.5, http://prdownloads.sourceforge.net/libpng/) +EX_CHECK_ALL(freetype, FT_Init_FreeType, ft2build.h, freetype, 2.1.5, http://prdownloads.sourceforge.net/freetype/) dnl Check for Perl. AC_PATH_PROG(PERL, perl, no) @@ -219,27 +248,7 @@ AC_SUBST(TCL_SHLIB_SUFFIX) AC_SUBST(TCL_PACKAGE_PATH) AC_SUBST(TCL_LD_SEARCH_FLAGS) -dnl Check for the compiler and static/shared library creation. -AC_PROG_CC -AC_PROG_CPP - -dnl don't build a shared library ... -dnl this can be changed when running configure -AC_DISABLE_SHARED -AC_PROG_LIBTOOL - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_DIRENT -AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h time.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h float.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_HEADER_TIME -AC_STRUCT_TM -dnl Checks for libraries. -AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos)) dnl Check for nroff AC_PATH_PROGS(NROFF, gnroff nroff) @@ -444,13 +453,6 @@ AC_CONFIG_FILES([examples/shared-demo.pl \ examples/cgi-demo.cgi \ examples/Makefile \ doc/Makefile \ - libraries/Makefile \ - libraries/cgilib-0.4/Makefile \ - libraries/libart_lgpl-2.3.7/Makefile \ - libraries/libpng-1.2.0/Makefile \ - libraries/zlib-1.1.4/Makefile \ - libraries/freetype-2.0.5/Makefile \ - libraries/afm/Makefile \ src/Makefile \ bindings/Makefile \ bindings/tcl/Makefile \ diff --git a/program/doc/rrdcgi.pod b/program/doc/rrdcgi.pod index 30c6692c..9089c52f 100644 --- a/program/doc/rrdcgi.pod +++ b/program/doc/rrdcgi.pod @@ -111,7 +111,7 @@ folks to figure out than "-2weeks". =item RRD::GRAPH I This tag creates the RRD graph defined in its argument and then gets -replaced by an appropriate EIMGE tag referring to the graph. +replaced by an appropriate EIMG tag referring to the graph. The B<--lazy> option in RRD graph can be used to make sure that graphs are only regenerated when they are out of date. The arguments to the B tag work as described in the B manual page. diff --git a/program/libraries/Makefile.am b/program/libraries/Makefile.am index 8b1b16d4..3d30d55a 100644 --- a/program/libraries/Makefile.am +++ b/program/libraries/Makefile.am @@ -13,7 +13,7 @@ endif if !USE_INSTALLED_libpng BUILD_LIBPNG=$(LIBPNG) endif -if !USE_INSTALLED_libart_lgpl +if !USE_INSTALLED_libart_lgpl_2 BUILD_LIBART=$(LIBART) endif if !USE_INSTALLED_libfreetype -- 2.30.2