]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Ldns included.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 18 Oct 2007 13:05:41 +0000 (13:05 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 18 Oct 2007 13:05:41 +0000 (13:05 +0000)
git-svn-id: file:///svn/unbound/trunk@695 be551aaa-1e26-0410-a405-d3ace91eadb9

Makefile.in
configure.ac
doc/Changelog
doc/README
doc/README.tests
ldns-src.tar.gz [new file with mode: 0644]
makedist.sh

index 5eff514ac6eb7365725f143f9fe36b6472319e03..5a4185605886ff36c5a5a14374dfb853251d196b 100644 (file)
@@ -93,7 +93,7 @@ $(BUILD)%.o:    $(srcdir)/%.c
        @if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi
        $Q$(COMPILE) -c $< -o $@
 
-.PHONY:        clean realclean doc lint all install uninstall tests test
+.PHONY:        clean realclean doc lint all install uninstall tests test download_ldns strip
 
 all:   $(COMMON_OBJ) unbound unbound-checkconf
 
@@ -164,6 +164,7 @@ realclean: clean
        rm -f config.status config.log config.h.in config.h
        rm -f configure config.sub config.guess ltmain.sh aclocal.m4 libtool
        rm -f util/configlexer.c util/configparser.c util/configparser.h
+       if test -d ldns-src; then rm -rf ldns-src; fi
        rm -f Makefile 
 
 $(BUILD)%.lint:    $(srcdir)/%.c 
@@ -182,6 +183,10 @@ ifdef doxygen
        $(doxygen) $(srcdir)/doc/unbound.doxygen
 endif
 
+strip:
+       strip unbound
+       strip unbound-checkconf
+
 install:
        $(INSTALL) -d $(bindir)
        $(INSTALL) -d $(mandir)
@@ -197,6 +202,12 @@ uninstall:
        rm -f -- $(bindir)/unbound $(bindir)/unbound-checkconf
        rm -f -- $(mandir)/man8/unbound.8 $(mandir)/man8/unbound-checkconf.8 $(mandir)/man5/unbound.conf.5
 
+download_ldns:
+       svn export https://www.nlnetlabs.nl/ldns/svn/trunk/makedist.sh ldns_makedist.sh
+       ./ldns_makedist.sh -s -d https://www.nlnetlabs.nl/ldns/svn/trunk
+       mv ldns-*_pre_*.tar.gz ldns-src.tar.gz
+       rm ldns-*_pre_*.tar.gz.sha1 ldns_makedist.sh
+
 # Automatic dependencies.
 $(BUILD)%.d: $(srcdir)/%.c
        $(INFO) Depend $<
index 2210f5bc7f9ab482448f48cba79d2b87e19b8ac0..61987610673168c292e56e269bfa544f72051287 100644 (file)
@@ -532,6 +532,49 @@ AC_TYPE_SIGNAL
 AC_FUNC_FSEEKO
 AC_SYS_LARGEFILE
 
+# check this after all other compilation checks, since the linking of the lib
+# may break checks after this.
+AC_ARG_WITH(ldns,
+        AC_HELP_STRING([--with-ldns=PATH        specify prefix of path of ldns library to use])
+       , [ specialldnsdir="$withval"
+       CPPFLAGS="$CPPFLAGS -I$withval/include"
+       LDFLAGS="$LDFLAGS -L$withval -L$withval/lib -lldns"
+       ldnsdir="$withval"
+       AC_SUBST(ldnsdir)
+])
+
+AC_CHECK_LIB(ldns, ldns_rr_new,, [
+dnl use the builtin ldns-src.tar.gz file to build ldns.
+if test ! -f ldns-src.tar.gz; then
+       AC_MSG_ERROR([No ldns library found and no ldns-src.tar.gz, use --with-ldns=path.])
+fi
+echo "****************************************************************"
+echo "***                                                          ***"
+echo "*** ldns library not found (--with-ldns= to specify by hand) ***"
+echo "*** Building ldns library from package included in this one. ***"
+echo "***                                                          ***"
+echo "****************************************************************"
+if test -d ldns-src; then rm -rf ldns-src; fi
+mkdir ldns-src; (cd ldns-src; gzip -cd ../ldns-src.tar.gz | tar xf -)
+ldnsdir=`ls -d ldns-src/ldns*`
+AC_MSG_NOTICE([Configure $ldnsdir])
+echo "(cd $ldnsdir; ./configure)"
+(cd $ldnsdir; ./configure)
+AC_MSG_NOTICE([Build $ldnsdir])
+if test ! -x "`which gmake`"; then
+       echo "(cd $ldnsdir; make)"
+       (cd $ldnsdir; make)
+else
+       echo "(cd $ldnsdir; gmake)"
+       (cd $ldnsdir; gmake)
+fi
+AC_MSG_NOTICE([Finished $ldnsdir])
+CPPFLAGS="$CPPFLAGS -I$ldnsdir/include"
+LDFLAGS="$LDFLAGS $ldnsdir/lib/*.o"
+AC_SUBST(ldnsdir)
+])
+
+# check func replacements after ldns had a chance to already provide them.
 AC_REPLACE_FUNCS(inet_aton)
 AC_REPLACE_FUNCS(inet_pton)
 AC_REPLACE_FUNCS(inet_ntop)
@@ -544,18 +587,6 @@ if test $ac_cv_func_getaddrinfo = no; then
 AC_LIBOBJ([fake-rfc2553])
 fi
 
-# check this after all other compilation checks, since the linking of the lib
-# may break checks after this.
-AC_ARG_WITH(ldns,
-        AC_HELP_STRING([--with-ldns=PATH        specify prefix of path of ldns library to use])
-       , [ specialldnsdir="$withval"
-       CPPFLAGS="$CPPFLAGS -I$withval/include"
-       LDFLAGS="$LDFLAGS -L$withval -L$withval/lib -lldns"
-       ldnsdir="$withval"
-       AC_SUBST(ldnsdir)
-])
-
-AC_CHECK_LIB(ldns, ldns_rr_new,, [AC_MSG_ERROR([Can't find ldns library])])
 
 AC_DEFINE_UNQUOTED([MAXSYSLOGMSGLEN], [5120], [Define to the maximum message length to pass to syslog.])
 
index e515f9025d5f2f56dc51d88803ae02c830f52fcd..7ac4f45615fabcd1bd986631f8a2b2c343b5c8d9 100644 (file)
@@ -3,6 +3,13 @@
        - fixup testcode fake event to remove pending before callback
          since the callback may create new pending items.
        - tests updated because retries are now in iterator module.
+       - ldns-testpkts code is checked for differences between unbound
+         and ldns by makedist.sh.
+       - ldns trunk from today added in svn repo for fallback in case
+         no ldns is installed on the system.
+         make download_ldns refreshes the tarball with ldns svn trunk.
+       - ldns-src.tar.gz is used if no ldns is found on the system, and
+         statically linked into unbound.
 
 17 October 2007: Wouter
        - fixup another cycle detect and ns-addr timeout resolution bug.
index 85ba0fccaffc3f68639af34ca9b13ec624206f9b..e10eedc955d0259de090694f4df5917a6f8b0b75 100644 (file)
@@ -9,7 +9,7 @@ This software is under BSD license, see LICENSE for details.
   or get a beta version from the svn repository at 
        http://unbound.net/svn/
 
-* Needs the following libraries
+* Uses the following libraries; 
   * ldns       http://www.nlnetlabs.nl/ldns/                   (BSD license)
   * libevent   http://www.monkey.org/~provos/libevent/         (BSD license)
 
@@ -19,6 +19,9 @@ This software is under BSD license, see LICENSE for details.
 
 * Make and install: ./configure; make; make install
   * --with-ldns=/path/to/ldns
+       If ldns is not detected on the system, a prepackaged incuded tarball
+       of the ldns library is used to compile and statically link against.
+       If detected on the system, it will dynamically link against it.
   * --with-libevent=/path/to/libevent
        Can be set to either the system install or the build directory.
        --with-libevent=no gives a builtin alternative implementation.
index 05fc89d2132e7865763453e6c4f247b0601c4129..5c83cc08434499d334876420e4869ab5c820e45b 100644 (file)
@@ -1,6 +1,9 @@
 README unbound tests
 
-There is a test setup for unbound.
+There is a test setup for unbound. Use
+       make test
+To make and run the tests. The results are summarized at the end.
+You can also run ./unittest by hand, if the system lacks other debug tools.
 
 testdata/ contains the data for tests. 
 testcode/ contains scripts and c code for the tests.
@@ -8,4 +11,4 @@ testcode/ contains scripts and c code for the tests.
 do-tests.sh : runs all the tests in the testdata directory.
 testbed.sh : compiles on a set of (user specific) hosts and runs do-tests.
 
-Tests are run using tpkg.
+Tests are run using testcode/mini_tpkg.sh.
diff --git a/ldns-src.tar.gz b/ldns-src.tar.gz
new file mode 100644 (file)
index 0000000..8c54790
Binary files /dev/null and b/ldns-src.tar.gz differ
index 9449c89351fe1896a3b3e15bad37efec162a119e..15eb19b5f744f7c7d659b8ac600dd839a806d287 100755 (executable)
@@ -148,15 +148,11 @@ if test -z "$LDNSDIR"; then
          eval `grep 'ldnsdir=' Makefile`
          LDNSDIR="$ldnsdir"
     fi
-    if test -z "$LDNSDIR"; then
-       error "LDNSDIR not detected in Makefile, specify manually (using -l)"
-    fi
 fi
 
 # Start the packaging process.
 info "SVNROOT  is $SVNROOT"
 info "SNAPSHOT is $SNAPSHOT"
-info "LDNSDIR  is $LDNSDIR"
 
 #question "Do you wish to continue with these settings?" || error "User abort."
 
@@ -185,9 +181,15 @@ echo "#include \"util/configyyrename.h\"" > util/configlexer.c || error_cleanup
 flex -i -t util/configlexer.lex >> util/configlexer.c  || error_cleanup "Failed to create configlexer"
 bison -y -d -o util/configparser.c util/configparser.y || error_cleanup "Failed to create configparser"
 
-# copy ldns-testpkts from ldns examples
-#cp $LDNSDIR/examples/ldns-testpkts.c testcode/ldns-testpkts.c || error_cleanup "copy ldns/examples/.. failed"
-#cp $LDNSDIR/examples/ldns-testpkts.h testcode/ldns-testpkts.h || error_cleanup "copy ldns/examples/.. failed"
+# check shared code, ldns-testpkts from ldns examples, if possible.
+if test ! -z "$LDNSDIR"; then
+       if diff -q $LDNSDIR/examples/ldns-testpkts.c testcode/ldns-testpkts.c &&
+          diff -q $LDNSDIR/examples/ldns-testpkts.h testcode/ldns-testpkts.h; then
+               info "ldns-testpkts.c and ldns-testpkts.h are OK"
+       else
+               error_cleanup "ldns-testpkts is different in ldns and unbound"
+       fi
+fi
 
 find . -name .c-mode-rc.el -exec rm {} \;
 find . -name .cvsignore -exec rm {} \;