diff --git a/Makefile.in b/Makefile.in index 114a22257..bb1643010 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,6 +30,9 @@ PYTHONMOD_INSTALL=@PYTHONMOD_INSTALL@ PYTHONMOD_UNINSTALL=@PYTHONMOD_UNINSTALL@ PYUNBOUND_INSTALL=@PYUNBOUND_INSTALL@ PYUNBOUND_UNINSTALL=@PYUNBOUND_UNINSTALL@ +UNBOUND_VERSION_MAJOR=@UNBOUND_VERSION_MAJOR@ +UNBOUND_VERSION_MINOR=@UNBOUND_VERSION_MINOR@ +UNBOUND_VERSION_MICRO=@UNBOUND_VERSION_MICRO@ ALLTARGET=@ALLTARGET@ # _unbound.la if pyunbound enabled. @@ -275,7 +278,7 @@ test: unittest$(EXEEXT) testbound$(EXEEXT) longtest: tests if test -x "`which bash`"; then bash testcode/do-tests.sh; else sh testcode/do-tests.sh; fi -lib: libunbound.la +lib: libunbound.la unbound.h libunbound.la: $(LIBUNBOUND_OBJ_LINK) $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) -lssl $(LIBS) @@ -340,6 +343,9 @@ delayer$(EXEEXT): $(DELAYER_OBJ_LINK) harvest$(EXEEXT): $(HARVEST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HARVEST_OBJ_LINK) $(LIBS) -L. -L.libs -lunbound +unbound.h: $(srcdir)/libunbound/unbound.h + sed -e 's/@''UNBOUND_VERSION_MAJOR@/$(UNBOUND_VERSION_MAJOR)/' -e 's/@''UNBOUND_VERSION_MINOR@/$(UNBOUND_VERSION_MINOR)/' -e 's/@''UNBOUND_VERSION_MICRO@/$(UNBOUND_VERSION_MICRO)/' < $(srcdir)/libunbound/unbound.h > $@ + unbound-control-setup: $(srcdir)/smallapp/unbound-control-setup.sh sed -e 's:^DESTDIR=.*$$:DESTDIR=$(UNBOUND_RUN_DIR):' < $(srcdir)/smallapp/unbound-control-setup.sh > $@ -chmod +x $@ @@ -367,8 +373,8 @@ pythonmod/interface.h: $(srcdir)/pythonmod/interface.i config.h $(SWIG) $(CPPFLAGS) -o $@ -python $(srcdir)/pythonmod/interface.i libunbound_wrap.lo libunbound_wrap.o: libunbound/python/libunbound_wrap.c \ - $(srcdir)/libunbound/unbound.h -libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i $(srcdir)/libunbound/unbound.h + unbound.h +libunbound/python/libunbound_wrap.c: $(srcdir)/libunbound/python/libunbound.i unbound.h @-if test ! -d libunbound/python; then $(INSTALL) -d libunbound/python; fi $(SWIG) -python -o $@ $(CPPFLAGS) $(srcdir)/libunbound/python/libunbound.i @@ -391,7 +397,7 @@ util/configparser.c util/configparser.h: $(srcdir)/util/configparser.y clean: rm -f *.o *.d *.lo *~ tags - rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-anchor$(EXEEXT) unbound-control-setup libunbound.la + rm -f unbound$(EXEEXT) unbound-checkconf$(EXEEXT) unbound-host$(EXEEXT) unbound-control$(EXEEXT) unbound-anchor$(EXEEXT) unbound-control-setup libunbound.la unbound.h rm -f $(ALL_SRC:.c=.lint) rm -f _unbound.la libunbound/python/libunbound_wrap.c libunbound/python/unbound.py pythonmod/interface.h pythonmod/unboundmodule.py rm -rf autom4te.cache .libs build doc/html doc/xml @@ -483,7 +489,7 @@ install: all $(PYTHONMOD_INSTALL) $(PYUNBOUND_INSTALL) done $(INSTALL) -c -m 755 unbound-control-setup $(DESTDIR)$(sbindir)/unbound-control-setup if test ! -e $(DESTDIR)$(configfile); then $(INSTALL) -d `dirname $(DESTDIR)$(configfile)`; $(INSTALL) -c -m 644 doc/example.conf $(DESTDIR)$(configfile); fi - $(LIBTOOL) --mode=install cp $(srcdir)/libunbound/unbound.h $(DESTDIR)$(includedir)/unbound.h + $(LIBTOOL) --mode=install cp unbound.h $(DESTDIR)$(includedir)/unbound.h $(LIBTOOL) --mode=install cp libunbound.la $(DESTDIR)$(libdir) $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir) diff --git a/acx_nlnetlabs.m4 b/acx_nlnetlabs.m4 index e90c81ea0..bc18187fd 100644 --- a/acx_nlnetlabs.m4 +++ b/acx_nlnetlabs.m4 @@ -2,7 +2,8 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 21 +# Version 22 +# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers. # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h. # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns. # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc. @@ -101,7 +102,7 @@ dnl Calculate comma separated windows-resource numbers from package version. dnl Picks the first three(,0) or four numbers out of the name. dnl $1: variable for the result AC_DEFUN([ACX_RSRC_VERSION], -[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*$/\1,\2,\3,0/' `] +[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' `] ]) dnl Routine to help check for compiler flags. diff --git a/configure b/configure index 1f1780be3..f0a6cbbc6 100755 --- a/configure +++ b/configure @@ -743,6 +743,9 @@ build LIBUNBOUND_AGE LIBUNBOUND_REVISION LIBUNBOUND_CURRENT +UNBOUND_VERSION_MICRO +UNBOUND_VERSION_MINOR +UNBOUND_VERSION_MAJOR target_alias host_alias build_alias @@ -2483,6 +2486,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +UNBOUND_VERSION_MAJOR=1 + +UNBOUND_VERSION_MINOR=4 + +UNBOUND_VERSION_MICRO=21 + LIBUNBOUND_CURRENT=4 LIBUNBOUND_REVISION=1 @@ -4140,7 +4149,7 @@ _ACEOF $as_echo "#define WINVER 0x0502" >>confdefs.h -wnvs=`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*$/\1,\2,\3,0/' ` +wnvs=`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' ` cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index 08e424859..62d7492c7 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,14 @@ sinclude(acx_pthread.m4) sinclude(acx_python.m4) sinclude(ac_pkg_swig.m4) -AC_INIT(unbound, 1.4.21, unbound-bugs@nlnetlabs.nl, unbound) +# must be numbers. ac_defun because of later processing +m4_define([VERSION_MAJOR],[1]) +m4_define([VERSION_MINOR],[4]) +m4_define([VERSION_MICRO],[21]) +AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound) +AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR]) +AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR]) +AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO]) LIBUNBOUND_CURRENT=4 LIBUNBOUND_REVISION=1 diff --git a/doc/Changelog b/doc/Changelog index 7123ed686..b4ff97c03 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,9 @@ 22 March 2013: Wouter - Fix resolve of names that use a mix of public and private addresses. - iana portlist update. + - Fix makedist for new svn for -d option. + - unbound.h header file has UNBOUND_VERSION_MAJOR define. + - Fix windows RSRC version for long version numbers. 21 March 2013: Wouter - release 1.4.20 diff --git a/libunbound/unbound.h b/libunbound/unbound.h index d435bf28d..1ab7d45ef 100644 --- a/libunbound/unbound.h +++ b/libunbound/unbound.h @@ -97,6 +97,11 @@ extern "C" { #endif +/** the version of this header file */ +#define UNBOUND_VERSION_MAJOR @UNBOUND_VERSION_MAJOR@ +#define UNBOUND_VERSION_MINOR @UNBOUND_VERSION_MINOR@ +#define UNBOUND_VERSION_MICRO @UNBOUND_VERSION_MICRO@ + /** * The validation context is created to hold the resolver status, * validation keys and a small cache (containing messages, rrsets, diff --git a/makedist.sh b/makedist.sh index ef930bf7a..f1735515e 100755 --- a/makedist.sh +++ b/makedist.sh @@ -109,16 +109,24 @@ replace_all () { info "Updating '$1' with today's date." replace_text "$1" "@date@" "`date +'%b %e, %Y'`" } + +replace_version () { + local v1=`echo $2 | sed -e 's/^.*\..*\.//'` + local v2=`echo $3 | sed -e 's/^.*\..*\.//'` + replace_text "$1" "VERSION_MICRO\],\[$v1" "VERSION_MICRO\],\[$v2" + head -20 "$1" +} check_svn_root () { # Check if SVNROOT is specified. if [ -z "$SVNROOT" ]; then - if test -f .svn/entries; then - eval `svn info | grep 'URL:' | sed -e 's/URL: /url=/' | head -1` - SVNROOT="$url" - fi - if test -z "$SVNROOT"; then - error "SVNROOT must be specified (using -d)" + if svn info 2>&1 | grep "not a working copy" >/dev/null; then + if test -z "$SVNROOT"; then + error "SVNROOT must be specified (using -d)" + fi + else + eval `svn info | grep 'URL:' | sed -e 's/URL: /url=/' | head -1` + SVNROOT="$url" fi fi } @@ -277,7 +285,7 @@ if [ "$DOWIN" = "yes" ]; then version2=`echo $version | sed -e 's/rc.*$//' -e 's/_20.*$//'` version2="${version2}_`date +%Y%m%d`" fi - replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2" + replace_version "configure.ac" "$version" "$version2" version="$version2" info "Rebuilding configure script (autoconf) snapshot." autoconf || error_cleanup "Autoconf failed." @@ -404,7 +412,7 @@ if [ "$RC" != "no" ]; then version2="${version}rc$RC" info "Version number: $version2" - replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2" + replace_version "configure.ac" "$version" "$version2" version="$version2" RECONFIGURE="yes" fi @@ -414,7 +422,7 @@ if [ "$SNAPSHOT" = "yes" ]; then version2="${version}_`date +%Y%m%d`" info "Snapshot version number: $version2" - replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2" + replace_version "configure.ac" "$version" "$version2" version="$version2" RECONFIGURE="yes" fi