From b8d066349943f58450bd6b6cb018e4bd16811377 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 28 Jun 2005 21:03:20 +0000 Subject: [PATCH] * the makefiles should not depend on gnumake features * make the perl module compilation environement configurable -- Stan Sinyagin ssinyagin on yahoo.com git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@649 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/bindings/Makefile.am | 12 +++++- program/bindings/python/Makefile.am | 3 -- program/bindings/tcl/Makefile.am | 8 ---- program/configure.ac | 57 ++++++++++++++++++++++------- program/doc/Makefile.am | 6 +-- program/examples/Makefile.am | 3 +- 6 files changed, 57 insertions(+), 32 deletions(-) diff --git a/program/bindings/Makefile.am b/program/bindings/Makefile.am index e939dc76..d68bb4b1 100644 --- a/program/bindings/Makefile.am +++ b/program/bindings/Makefile.am @@ -1,4 +1,14 @@ -SUBDIRS = tcl python + +if BUILD_TCL +SUB_tcl = tcl +endif + +if BUILD_PYTHON +SUB_python = python +endif + +SUBDIRS = $(SUB_tcl) $(SUB_python) + # the following files are not mentioned in any other Makefile EXTRA_DIST = perl-piped/MANIFEST perl-piped/README perl-piped/Makefile.PL perl-piped/RRDp.pm perl-piped/t/base.t \ perl-shared/ntmake.pl perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm perl-shared/RRDs.xs perl-shared/t/base.t diff --git a/program/bindings/python/Makefile.am b/program/bindings/python/Makefile.am index 6510f1e5..f89e92c2 100644 --- a/program/bindings/python/Makefile.am +++ b/program/bindings/python/Makefile.am @@ -2,8 +2,6 @@ AM_CPPFLAGS = @CFLAGS@ -I$(top_srcdir)/src @PYTHON_INCLUDES@ #pythondir = $(pyexecdir)/python@PYTHON_VERSION@/site-packages -if BUILD_PYTHON - python_PROGRAMS = rrdtoolmodule.so rrdtoolmodule_so_LDFLAGS = -module -shared @@ -15,4 +13,3 @@ noinst_HEADERS = rrd_extra.h clean: rm -rf build -endif diff --git a/program/bindings/tcl/Makefile.am b/program/bindings/tcl/Makefile.am index e31daa85..9931975f 100644 --- a/program/bindings/tcl/Makefile.am +++ b/program/bindings/tcl/Makefile.am @@ -21,8 +21,6 @@ LIB_RUNTIME_DIR = $(libdir) pkglibdir = @TCL_PACKAGE_DIR@ -if BUILD_TCL - # Automake doen't like `tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)' as # library name. So we build and install this library `by hand'. # @@ -52,9 +50,3 @@ install-exec-local: $(TCL_RRD_LIB) @$(NORMAL_INSTALL) $(INSTALL_PROGRAM) $(TCL_RRD_LIB) $(DESTDIR)$(libdir)/$(TCL_RRD_LIB) -endif - -diff: - cd .. ; diff -c -u -r -N --exclude Makefile --exclude html --exclude doc --exclude Makefile.in --exclude Makefile.old --exclude perl --exclude aclocal.m4 --exclude configure rrdtool-1.0.13 rrdtool-1.0.13-ibr > rrdtool-1.0.13-ibr.patch - - diff --git a/program/configure.ac b/program/configure.ac index 2647dce3..03c920f7 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -325,6 +325,11 @@ AC_ARG_ENABLE(perl,[ --disable-perl do not build the perl modules], [],[enable_perl=yes]) +AC_ARG_VAR(PERLCC, [[] C compiler for Perl modules]) +AC_ARG_VAR(PERLCCFLAGS, [[] CC flags for Perl modules]) +AC_ARG_VAR(PERLLD, [[same as PERLCC] Linker for Perl modules]) +AC_ARG_VAR(PERLLDFLAGS, [[] LD flags for Perl modules]) + if test "x$PERL" = "xno" -o x$enable_perl = xno; then COMP_PERL= else @@ -332,21 +337,24 @@ else AC_MSG_CHECKING(for the perl version you are running) PERL_VERSION=`$PERL -MConfig -e 'print $Config{version}'` AC_MSG_RESULT($PERL_VERSION) - AC_MSG_CHECKING(for the C compiler perl wants to use to build its modules) - perlcc=`$PERL -MConfig -e 'print $Config{cc}'` - AC_MSG_RESULT($perlcc) - if test ! -x "$perlcc"; then - AC_PATH_PROG(PERLCC, "${perlcc}", no) - if test "$PERLCC" = "no"; then - AC_MSG_WARN([ -I would not find the Compiler ($perlcc) that was originally used to compile your -perl binary. You should either make sure that this compiler is available on your -system, or use a different perl setup that was compiled with $CC. - -I will disable the compilation of the RRDs perl module. + if test -z "$PERLCC"; then + AC_MSG_CHECKING(for the C compiler perl wants to use to build its modules) + perlcc=`$PERL -MConfig -e 'print $Config{cc}'` + AC_MSG_RESULT($perlcc) + if test ! -x "$perlcc"; then + AC_PATH_PROG(PERL_CC, "${perlcc}", no) + if test "$PERL_CC" = "no"; then + AC_MSG_WARN([ +I would not find the Compiler ($perlcc) that was originally used to compile +your perl binary. You should either make sure that this compiler is +available on your system, pick an other compiler and set PERLCC +appropriately, or use a different perl setup that was compiled locally. + +I will disable the compilation of the RRDs perl module for now. ]) - COMP_PERL="perl_piped" - fi + COMP_PERL="perl_piped" + fi + fi fi fi AC_MSG_CHECKING(Perl Modules to build) @@ -368,6 +376,23 @@ AC_ARG_ENABLE(perl-site-install, your perl setup thinks it is best.], [PERL_MAKE_OPTIONS=],[]) +if test ! -z "$PERLCC"; then + PERL_MAKE_OPTIONS="$PERL_MAKE_OPTIONS CC=$PERLCC" + + if test ! -z "$PERLCCFLAGS"; then + PERL_MAKE_OPTIONS="$PERL_MAKE_OPTIONS CCFLAGS=$PERLCCFLAGS" + fi + + if test -z "$PERLLD"; then + PERLLD=$PERLCC + fi + PERL_MAKE_OPTIONS="$PERL_MAKE_OPTIONS LD=$PERLLD" + + if test ! -z "$PERLLDFLAGS"; then + PERL_MAKE_OPTIONS="$PERL_MAKE_OPTIONS LDFLAGS=$PERLLDFLAGS" + fi +fi + AC_ARG_WITH(perl-options, [ --with-perl-options=[OPTIONS] options to pass on command-line when generating Makefile from Makefile.PL. If you set this @@ -434,6 +459,10 @@ dnl Check for nroff AC_PATH_PROGS(NROFF, gnroff nroff) AC_PATH_PROGS(TROFF, groff troff) +AC_ARG_VAR(RRDDOCDIR, [[DATADIR/doc/PACKAGE-VERSION] Documentation directory]) +if test -z "$RRDDOCDIR"; then + RRDDOCDIR='${datadir}/doc/${PACKAGE}-${VERSION}'; fi + dnl Does the compiler like -Wall and -pedantic? if test "$GCC" = "yes"; then oCFLAGS=$CFLAGS diff --git a/program/doc/Makefile.am b/program/doc/Makefile.am index c176fad7..83b3753b 100644 --- a/program/doc/Makefile.am +++ b/program/doc/Makefile.am @@ -26,11 +26,9 @@ PDF = $(MAN:.1=.pdf) # what should go into the distribution EXTRA_DIST= $(POD) $(HTML) $(MAN) $(TXT) rrdtool-dump.dtd rrdtool-xport.dtd -# some install rules if the install pat -DOCPREFIX:=$(shell echo "@prefix@" | grep rrd >/dev/null || echo "rrdtool-@VERSION@/") -idocdir = $(prefix)/share/doc/$(DOCPREFIX)txt +idocdir = $(RRDDOCDIR)/txt idoc_DATA = $(POD) $(TXT) -ihtmldir = $(prefix)/share/doc/$(DOCPREFIX)html +ihtmldir = $(RRDDOCDIR)/html ihtml_DATA = $(HTML) imandir = $(mandir)/man1 iman_DATA = $(MAN) diff --git a/program/examples/Makefile.am b/program/examples/Makefile.am index b10cc2c3..747ce3d2 100644 --- a/program/examples/Makefile.am +++ b/program/examples/Makefile.am @@ -7,8 +7,7 @@ EXTRA_DIST = cgi-demo.cgi.in piped-demo.pl.in shared-demo.pl.in \ stripes.pl.in bigtops.pl.in minmax.pl.in 4charts.pl.in -EXPREFIX:=$(shell echo "@prefix@" | grep rrd >/dev/null || echo "rrdtool-@VERSION@/") -examplesdir = $(prefix)/$(EXPREFIX)examples +examplesdir = $(pkgdatadir)/examples examples_SCRIPTS = cgi-demo.cgi piped-demo.pl shared-demo.pl \ stripes.pl bigtops.pl minmax.pl 4charts.pl -- 2.30.2