From 377af7db1b7a7eef72d891328bb36a209ed23790 Mon Sep 17 00:00:00 2001 From: oetiker Date: Wed, 27 May 2009 13:39:44 +0000 Subject: [PATCH] the get ready for 1.4rc patch * updated to automake 1.11 with silet build, with this warnings stand out much better in the build process. use make V=1 to see all as before * switched from intltoolize to autopoint for gettext support * moved m4 bits into their own subdirectory --tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1819 a5681a0c-68f1-0310-ab6d-d61299d08faa --- MakeMakefile | 55 ++++++++----------------------------- Makefile.am | 10 ++----- autogen.sh | 4 +++ bindings/Makefile.am | 8 +++--- configure.ac | 61 ++++++++++------------------------------- doc/Makefile.am | 14 +++++----- acinclude.m4 => m4/acinclude.m4 | 0 po/ChangeLog | 13 ++++++++- po/Makevars | 41 +++++++++++++++++++++++++++ src/Makefile.am | 2 +- src/rrd_i18n.h | 18 ++++++------ 11 files changed, 105 insertions(+), 121 deletions(-) create mode 100755 autogen.sh rename acinclude.m4 => m4/acinclude.m4 (100%) create mode 100644 po/Makevars diff --git a/MakeMakefile b/MakeMakefile index 2765238..bfcfddf 100755 --- a/MakeMakefile +++ b/MakeMakefile @@ -3,8 +3,8 @@ # Run this script after the first cvs checkout to build # makefiles and friends -#PATH="/usr/sepp/bin:$PATH" -#export PATH +PATH="/usr/pack/automake-1.11-to/amd64-linux-ubuntu8.04/bin:$PATH" +export PATH vcheck (){ perl <= $AUTOMAKE_VER" ERROR=1 else - automake=automake-1.9 - aclocal="aclocal-1.9" - for d in /usr/pack/automake-1.9.5-to/share/aclocal-1.9 /usr/share/aclocal-1.9 /usr/share/aclocal /usr/pack/rrdtool-1.3svn-to/share/aclocal /usr/pack/intltool-0.37.0-to/share/aclocal ; do - [ -d $d ] && aclocal="$aclocal -I $d" - done + AUTOMAKE="automake-1.11" + ACLOCAL="aclocal-1.11" + export AUTOMAKE ACLOCAL fi -else - automake="automake" - aclocal="aclocal" -# aclocal="aclocal -I /usr/pack/libtool-1.5.14-to/share/aclocal" fi + if vcheck $AUTOCONF_VER "autoconf --version" then echo "get a copy of GNU autoconf >= $autoconf_ver" ERROR=1 fi -if vcheck $INTLTOOL_VER "intltoolize --version" -then - echo "get a copy of GNU intltoolize >= $INTLTOOL_VER" - ERROR=1 -fi - if [ $ERROR -ne 0 ] then exit 1 fi -# remove the bits we are going to recreate - -echo Removing old Makefiles -touch Makefile -find . -name "Makefile" -or -name "Makefile.in" -print0 | xargs -0 rm -echo Cleaning out other leftovers -for x in configure install-sh intltool-merge.in rrd_config.h.in \ - missing intltool-update po/Makefile.in.in config.sub \ - intltool-extract intltool-extract.in config.guess \ - depcomp intltool-update.in autom4te.cache \ - intltool-merge compile; do - [ ! -L $x -a -d $x ] && rm -r "$x" - [ ! -L $x -a -f $x ] && rm "$x" -done -set -x -intltoolize --automake -c -f -$aclocal -libtoolize --copy --force -autoheader --force -$aclocal -$automake --foreign --add-missing --force-missing --copy -autoconf --force +./autogen.sh # vim: set syntax=sh : diff --git a/Makefile.am b/Makefile.am index 78903cb..c1a12cf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,17 +2,11 @@ RSYNC = rsync --rsh=ssh # build the following subdirectories -if BUILD_LIBINTL -PO=po -else -PO= -endif -SUBDIRS = $(PO) src examples doc bindings +SUBDIRS = po src examples doc bindings intl # the following files are not mentioned in any other Makefile EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \ - intltool-extract.in intltool-merge.in intltool-update.in \ rrdtool.spec favicon.ico win32/Makefile win32/config.h \ win32/rrd.dsp win32/rrd.sln win32/rrd.vcproj \ win32/rrd_config.h.msvc win32/rrdlib.vcproj win32/rrdtool.dsp \ @@ -27,7 +21,7 @@ CLEANFILES = config.cache AUTOMAKE_OPTIONS= foreign # where we keep local rules for automake - +ACLOCAL_AMFLAGS=-I m4 ACLOCAL_M4= $(top_srcdir)/aclocal.m4 #AUTOHEADER = @AUTOHEADER@ --localdir=$(top_srcdir)/config #AUTOCONF = @AUTOCONF@ --localdir=$(top_srcdir)/config diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..5963868 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh +PATH="/usr/pack/automake-1.11-to/amd64-linux-ubuntu8.04/bin:$PATH" +export PATH +autoreconf --force --install --verbose -I config -I m4 diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 4b5d6d4..70beba1 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -20,10 +20,10 @@ EXTRA_DIST = perl-piped/MANIFEST perl-piped/README perl-piped/Makefile.PL perl-p all-local: @COMP_PERL@ @COMP_RUBY@ @COMP_PYTHON@ install-data-local: - test -f perl-piped/Makefile && cd perl-piped && $(MAKE) install || true - test -f perl-shared/Makefile && cd perl-shared && $(MAKE) install || true - test -f ruby/Makefile && cd ruby && $(MAKE) EPREFIX=$(DESTDIR)$(exec_prefix) $(RUBY_MAKE_OPTIONS) install || true - test -d python/build && cd python && env BUILDLIBDIR=../../src/.libs $(PYTHON) setup.py install --skip-build --prefix=$(DESTDIR)$(prefix) --exec-prefix=$(DESTDIR)$(exec_prefix) || true + $(AM_V_GEN)test -f perl-piped/Makefile && cd perl-piped && $(MAKE) install || true + $(AM_V_GEN)test -f perl-shared/Makefile && cd perl-shared && $(MAKE) install || true + $(AM_V_GEN)test -f ruby/Makefile && cd ruby && $(MAKE) EPREFIX=$(DESTDIR)$(exec_prefix) $(RUBY_MAKE_OPTIONS) install || true + $(AM_V_GEN)test -d python/build && cd python && env BUILDLIBDIR=../../src/.libs $(PYTHON) setup.py install --skip-build --prefix=$(DESTDIR)$(prefix) --exec-prefix=$(DESTDIR)$(exec_prefix) || true # rules for building the ruby module # RUBYARCHDIR= is to work around in a makefile quirk not sure diff --git a/configure.ac b/configure.ac index 8647eb0..7d3dde7 100644 --- a/configure.ac +++ b/configure.ac @@ -9,14 +9,14 @@ dnl tell automake the this script is for rrdtool dnl the official version number is dnl a.b.c -AC_INIT([rrdtool],[1.3.2]) +AC_INIT([rrdtool],[1.3.999]) dnl for testing a numberical version number comes handy dnl the released version are dnl a.bccc dnl the devel versions will be something like dnl a.b999yymmddhh -NUMVERS=1.3002 +NUMVERS=1.3999 AC_SUBST(NUMVERS) dnl for the linker to understand which versions the library are compatible with @@ -27,14 +27,16 @@ dnl - if any functionality was removed do c++,r=0,a=0. dnl dnl see http://sourceware.org/autobook/autobook/autobook_91.html dnl -LIBVERS=4:1:0 +LIBVERS=5:0:1 AC_SUBST(LIBVERS) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE +AC_USE_SYSTEM_EXTENSIONS +AM_INIT_AUTOMAKE([silent-rules]) AM_MAINTAINER_MODE - +AM_SILENT_RULES([yes]) AC_CONFIG_HEADERS([rrd_config.h]) +AC_CONFIG_MACRO_DIR([m4]) dnl all our local stuff like install scripts and include files dnl is in there @@ -139,7 +141,7 @@ dnl Try to detect/use GNU features CFLAGS="$CFLAGS -D_GNU_SOURCE" dnl check for -Werror separatly -dnl (quite a few autotool checks don't work with -Werror; also, the +dnl (quite a few autotool checks do not work with -Werror; also, the dnl check for -Werror fails after checking and adding the other flags) AC_CACHE_CHECK([if gcc likes the -Werror flag], rd_cv_gcc_flag__Werror, [AC_COMPILE_IFELSE( @@ -262,44 +264,8 @@ AC_CHECK_FUNCS(posix_fadvise) CONFIGURE_PART(Libintl Processing) -dnl gettext -GETTEXT_PACKAGE=rrdtool -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package]) - -AM_GLIB_GNU_GETTEXT() - -AC_ARG_ENABLE(libintl,AS_HELP_STRING([--disable-libintl],[i18n support (libintl)]), -[],[enable_libintl=yes]) - -if test x$enable_libintl = xyes; then - IT_PROG_INTLTOOL([0.35.0],[no-xml]) -fi - -if test x$enable_libintl = xyes -a x$MSGFMT = xno; then - AC_MSG_WARN(I could not find msgfmt. Diabeling libintl build.) - enable_libintl=no -fi - -if test x$enable_libintl = xyes; then - AC_CHECK_HEADERS(libintl.h,[],[AC_MSG_RESULT(disabeling libintl build); enable_libintl=no]) -fi - -if test x$enable_libintl = xyes ; then - dnl it seems bsd synstems need to link against libintl - dnl when compiling rrdupdate. lets check - AC_CHECK_LIB(intl, libintl_gettext,[LIB_LIBINTL="-lintl"]) -fi - -dnl use for linking rrdupdate -AC_SUBST(LIB_LIBINTL) - -dnl do not touch the po stuff if we are not going to build intl -AM_CONDITIONAL(BUILD_LIBINTL,[test x$enable_libintl = xyes]) - -if test x$enable_libintl = xyes; then - AC_DEFINE([BUILD_LIBINTL], [], [Use this in code sections to mark them for libintl build]) -fi +AM_GNU_GETTEXT_VERSION([0.17]) +AM_GNU_GETTEXT() CONFIGURE_PART(IEEE Math Checks) @@ -585,7 +551,7 @@ AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built}) # Options to pass when configuring perl module langpref=$prefix -test "$langpref" = "$(DESTDIR)NONE" && langpref='$(DESTDIR)'$ac_default_prefix +test "$langpref" = '$(DESTDIR)NONE' && langpref='$(DESTDIR)'$ac_default_prefix test "$langpref" = "NONE" && langpref=$ac_default_prefix PERL_MAKE_OPTIONS="PREFIX=$langpref LIB=$langpref/lib/perl/$PERL_VERSION" @@ -892,7 +858,8 @@ AC_CONFIG_FILES([examples/perftest.pl]) AC_CONFIG_FILES([examples/Makefile]) AC_CONFIG_FILES([examples/rrdcached/Makefile]) AC_CONFIG_FILES([doc/Makefile]) -AC_CONFIG_FILES([po/Makefile.in]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_CONFIG_FILES([intl/Makefile]) AC_CONFIG_FILES([src/Makefile]) AC_CONFIG_FILES([src/librrd.sym.in]) AC_CONFIG_FILES([src/librrd.pc]) @@ -946,7 +913,7 @@ echo " Build Tcl Bindings: $enable_tcl" echo " Build Python Bindings: $enable_python" echo " Build rrdcgi: $enable_rrdcgi" echo " Build librrd MT: $enable_pthread" -echo " Link with libintl: $enable_libintl" +echo " Use gettext: $USE_NLS" echo " With libDBI: $have_libdbi" echo echo " Libraries: $ALL_LIBS" diff --git a/doc/Makefile.am b/doc/Makefile.am index 40b0b38..617beb3 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -46,22 +46,22 @@ all-local: link txt man html-local perl -n -e 'if (/^=include\s+(\S+)/){open F,"$$1.inc" || die $$?;print ; close F} else {print}' $< > $@ .pod.1 .pm.1 .pl.1: - @POD2MAN@ --release=$(VERSION) --center=rrdtool $< > $@ + $(AM_V_GEN)@POD2MAN@ --release=$(VERSION) --center=rrdtool $< > $@ .1.txt: - GROFF_NO_SGR=1 @NROFF@ -man -Tlp $< > $@ + $(AM_V_GEN)GROFF_NO_SGR=1 @NROFF@ -man -Tlp $< > $@ .1.pdf: - @TROFF@ -man $< | ps2pdf - $@ + $(AM_V_GEN)@TROFF@ -man $< | ps2pdf - $@ .pm.html .pod.html .pl.html: - @POD2HTML@ --infile=$< --outfile=$@ --noindex --htmlroot=. --podpath=. --title=$* + $(AM_V_GEN)@POD2HTML@ --infile=$< --outfile=$@ --noindex --htmlroot=. --podpath=. --title=$* RRDs.pod: - $(LN_S) $(top_srcdir)/bindings/perl-shared/RRDs.pm RRDs.pod + $(AM_V_GEN)$(LN_S) $(top_srcdir)/bindings/perl-shared/RRDs.pm RRDs.pod RRDp.pod: - $(LN_S) $(top_srcdir)/bindings/perl-piped/RRDp.pm RRDp.pod + $(AM_V_GEN)$(LN_S) $(top_srcdir)/bindings/perl-piped/RRDp.pm RRDp.pod link: RRDp.pod RRDs.pod @@ -76,4 +76,4 @@ pdf-local: $(PDF) pod: $(POD) install-data-hook: - cd $(DESTDIR)$(ihtmldir) && rm -f index.html && $(LN_S) rrdtool.html index.html + $(AM_V_GEN)cd $(DESTDIR)$(ihtmldir) && rm -f index.html && $(LN_S) rrdtool.html index.html diff --git a/acinclude.m4 b/m4/acinclude.m4 similarity index 100% rename from acinclude.m4 rename to m4/acinclude.m4 diff --git a/po/ChangeLog b/po/ChangeLog index 8251db8..f738a7b 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1 +1,12 @@ -# no change log yet +2009-05-26 gettextize + + * Makefile.in.in: New file, from gettext-0.17. + * Rules-quot: New file, from gettext-0.17. + * boldquot.sed: New file, from gettext-0.17. + * en@boldquot.header: New file, from gettext-0.17. + * en@quot.header: New file, from gettext-0.17. + * insert-header.sin: New file, from gettext-0.17. + * quot.sed: New file, from gettext-0.17. + * remove-potcdate.sin: New file, from gettext-0.17. + * POTFILES.in: New file. + diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..c450650 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Tobias Oetiker + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = http://oss.oetiker.ch/rrdtool-trac/newticket + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/src/Makefile.am b/src/Makefile.am index 5cfc523..97b4f44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -124,4 +124,4 @@ EXTRA_DIST= librrd.pc.in strftime.c strftime.h rrd_getopt.c rrd_getopt1.c rrd_g librrd.sym: librrd.sym.in - grep -v LIBC_HAS_GETOPT_LONG librrd.sym.in >$@ + $(AM_V_GEN)grep -v LIBC_HAS_GETOPT_LONG librrd.sym.in >$@ diff --git a/src/rrd_i18n.h b/src/rrd_i18n.h index 9f640ef..36d79e7 100644 --- a/src/rrd_i18n.h +++ b/src/rrd_i18n.h @@ -11,18 +11,18 @@ extern "C" { #ifndef _RRD_I18N_H #define _RRD_I18N_H -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) -# include -#define _(String) gettext (String) +#ifdef ENABLE_NLS +# ifdef _LIBC +# include +# else +# include "gettext.h" +# define _(String) gettext (String) +# endif #else -#define _(String) (String) -#endif -#define N_(String) (String) +# define _(String) (String) #endif +#define N_(String) String #endif -- 2.11.0