]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
lotsofmakefilestuff
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Mon, 26 Sep 2005 13:28:28 +0000 (13:28 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Mon, 26 Sep 2005 13:28:28 +0000 (13:28 +0000)
seems to work on osx, bsd and linux now, and in any directory (no relative dependency on the source dirs)

Makefile.in
README
configure.ac
drill/Makefile.in
drill/configure.ac
examples/Makefile.in
examples/configure.ac
examples/ldns-chaos.c
examples/ldns-mx.c
examples/ldns-update.c
zone.c

index 15dd5c18b0f3ddc63bede4b7c77394a0286f8ec9..fe62f24e86dd35f5772b41e96ae1e27f7b91c6de 100644 (file)
@@ -9,6 +9,11 @@ exec_prefix    = @exec_prefix@
 bindir                 = @bindir@
 mandir                 = @mandir@
 doxygen                = @doxygen@
+glibtool       = @glibtool@
+libtool                = @libtool@
+ifdef glibtool
+libtool                = $(glibtool)
+endif
 
 CC             = @CC@
 CPPFLAGS       = @CPPFLAGS@ @DEFS@ -I. -I$(srcdir)
@@ -17,7 +22,7 @@ LDFLAGS               = @LDFLAGS@     -lcrypto
 LIBS           = @LIBS@
 LIBOBJS                = @LIBOBJS@
 DATE           = $(shell date +%Y%m%d)
-LIBTOOL                = libtool --tag=CXX
+LIBTOOL                = $(libtool) --tag=CXX
 
 LINT           = splint
 LINTFLAGS      = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t 
@@ -28,29 +33,29 @@ LIBDNS_SOURCES      =       rdata.c util.c rr.c packet.c wire2host.c \
                        host2str.c buffer.c str2host.c tsig.c resolver.c \
                        net.c host2wire.c dname.c dnssec.c keys.c \
                        higher.c rr_functions.c parse.c update.c error.c zone.c
-LIBDNS_HEADERS =       ldns/error.h            \
-                       ldns/packet.h           \
-                       ldns/common.h           \
-                       ldns/rdata.h            \
-                       ldns/rr.h               \
-                       ldns/wire2host.h        \
-                       ldns/host2str.h         \
-                       ldns/host2wire.h        \
-                       ldns/str2host.h         \
-                       ldns/buffer.h           \
-                       ldns/resolver.h         \
-                       ldns/net.h              \
-                       ldns/dname.h            \
-                       ldns/dnssec.h           \
-                       ldns/keys.h             \
-                       ldns/higher.h           \
-                       ldns/parse.h            \
-                       ldns/rr_functions.h     \
-                       ldns/dns.h              \
-                       ldns/zone.h             \
+LIBDNS_HEADERS =       $(srcdir)/ldns/error.h          \
+                       $(srcdir)/ldns/packet.h         \
+                       $(srcdir)/ldns/common.h         \
+                       $(srcdir)/ldns/rdata.h          \
+                       $(srcdir)/ldns/rr.h             \
+                       $(srcdir)/ldns/wire2host.h      \
+                       $(srcdir)/ldns/host2str.h               \
+                       $(srcdir)/ldns/host2wire.h      \
+                       $(srcdir)/ldns/str2host.h               \
+                       $(srcdir)/ldns/buffer.h         \
+                       $(srcdir)/ldns/resolver.h               \
+                       $(srcdir)/ldns/net.h            \
+                       $(srcdir)/ldns/dname.h          \
+                       $(srcdir)/ldns/dnssec.h         \
+                       $(srcdir)/ldns/keys.h           \
+                       $(srcdir)/ldns/higher.h         \
+                       $(srcdir)/ldns/parse.h          \
+                       $(srcdir)/ldns/rr_functions.h   \
+                       $(srcdir)/ldns/dns.h            \
+                       $(srcdir)/ldns/zone.h           \
                        ldns/util.h             \
-                       ldns/update.h           \
-                       ldns/tsig.h
+                       $(srcdir)/ldns/update.h                 \
+                       $(srcdir)/ldns/tsig.h
 PROG_SOURCES   =       ldns-keygen.c ldns-key2ds.c ldns-signzone.c \
                        ldns-version.c
 PROG_TARGETS   =       $(PROG_SOURCES:.c=)
@@ -78,7 +83,7 @@ all:          lib tools
 tools:         $(PROG_TARGETS) drill
 
 ./drill/config.log:
-               ( mkdir drill ; cd drill ; ../$(srcdir)/drill/configure --with-ldns=$(srcdir))
+               ( mkdir drill ; cd drill ; ../$(srcdir)/drill/configure LDFLAGS="-L../.libs" CPPFLAGS="-I.. -I../..")
 
 drill:                 ./drill/config.log
                ( cd drill ; $(MAKE) -f Makefile all)
@@ -87,9 +92,12 @@ lib:         $(LIBDNS_OBJECTS) b64_pton$U.o b64_ntop$U.o
                $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) b64_pton$U.lo b64_ntop$U.lo \
                -rpath $(prefix)/lib
 
-doc:           doc/function_manpages 
-               $(doxygen)
-               cat ldns/*.h | doc/doxyparse.pl -m doc/function_manpages 2>&1 | \
+doc:           $(srcdir)/doc/function_manpages 
+               $(INSTALL) -d doc
+ifdef doxygen
+               $(doxygen) $(srcdir)/libdns.doxygen
+endif
+               cat $(srcdir)/ldns/*.h | $(srcdir)/doc/doxyparse.pl -m $(srcdir)/doc/function_manpages 2>&1 | \
                grep -v ^doxygen | grep -v ^cat  > doc/ldns_manpages
 
 install:       install-h install-lib install-progs install-doc
@@ -115,7 +123,7 @@ install-doc:        doc
                cp -Rp doc/man/man3/* $(mandir)/man3/
                ${INSTALL} -d $(mandir)/man1
                for i in $(PROG_TARGETS); do \
-                       ${INSTALL} -c -m 644 doc/$$i.1 $(mandir)/man1 ; done
+                       ${INSTALL} -c -m 644 $(srcdir)/doc/$$i.1 $(mandir)/man1 ; done
                exit 0
 
 uninstall-doc: doc
diff --git a/README b/README
index bc3810199ebd04cbcce6be76422cb9e1afaaf60b..dcc2ad03c9db5336ffc7baa2720df6582f83ecc2 100644 (file)
--- a/README
+++ b/README
@@ -8,7 +8,8 @@ ldns is developed on Linux and FreeBSD.
 
 REQUIREMENTS
 - OpenSSL
-- libtool package
+- (GNU) libtool (that's glibtool, not libtool in OSX)
+- GNU make
 
 INSTALLATION
 1. Unpack the tarball
@@ -22,12 +23,28 @@ INSTALLATION
 * Examples
 There are some examples in the examples/ directory. These can be built with:
 1. autoreconf
-2. ./configure --with-ldns=../
+2. ./configure
 3. gmake
 
-When running the examples the main library has to be installed (gmake
-install) or your LD_LIBRARY_PATH must contain the ldns-<VERSION>/.libs
-directory.
+The library has to be installed in order for this to work. If it is not
+installed in one of the default paths you should add the following arguments to
+the configure command:
+LDFLAGS="-L<path_to_library_dir>" CPPFLAGS="-I<path_to_header_dir>"
+
+If you have only built the library and not installed it anywhere, these
+values should be:
+LDFLAGS="-L<build-dir>/.libs" CPPFLAGS="-I<build-dir> -I<src_dir>"
+
+In that last case, you will also need to have your LD_LIBRARY_PATH set to
+the .libs directory to be able to run the examples.
+
+
+* Drill
+
+Drill is automatically built alongside with the main library. If you want to
+build drill by hand, the configure and running options are the same as those
+for the examples. You can use the make target 'lib' if you only want to
+build the library and not drill (and make install-lib to install it).
 
 * Developers
 ldns is developed by the ldns team at NLnet Labs. This team currently
index ae8341a175e8a106c194d007af92cfeb5e18a09e..e0c748f4b7350352fc7cd31c2b7445ee99fad100 100644 (file)
@@ -63,7 +63,7 @@ fi
 ])dnl
 
 # my own checks
-AC_CHECK_PROG(doxygen, doxygen, [doxygen libdns.doxygen])
+AC_CHECK_PROG(doxygen, doxygen, doxygen)
 
 # Checks for libraries.
 # Check for SSL, original taken from
@@ -105,8 +105,13 @@ AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
     fi
 
 # Use libtool 
+# for macosx, see if glibtool exists and use that
+# BSD's need to know the version...
+AC_CHECK_PROG(glibtool, glibtool, [glibtool], )
+AC_CHECK_PROG(libtool, libtool15, [libtool15], libtool)
 AC_PROG_LIBTOOL
 
+
 # Checks for header files.
 AC_HEADER_STDC
 #AC_HEADER_SYS_WAIT
index 825558b8ee4aa09aa917ca394e1906c644a862e9..8137707e38a55841f853c94233d34064c7f0c6c2 100644 (file)
@@ -13,6 +13,7 @@ includedir = @INCLUDEDIR@
 LDNSDIR = @LDNSDIR@
 CC = @CC@
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 INSTALL = $(srcdir)/install-sh -c
@@ -89,7 +90,7 @@ doc:
 install: all
        $(INSTALL) -d $(DESTDIR)$(bindir)
        $(INSTALL) drill $(DESTDIR)$(bindir)/drill
-       $(INSTALL) -m 644 drill.1 $(DESTDIR)$(mandir)/man1/drill.1
+       $(INSTALL) -m 644 $(srcdir)/drill.1 $(DESTDIR)$(mandir)/man1/drill.1
 
 uninstall:
        @echo
index 1cbdc3232d33af3d7e3b5190bfb727b7d614c940..f2d9d28578cb15f7d90009d4212a6ea40e7907fa 100644 (file)
@@ -27,57 +27,18 @@ AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
 
 # ripped from http://autoconf-archive.cryp.to/check_ssl.html
 # check for ldns
+AC_CHECK_LIB(ldns, ldns_rr_new,, [
+       AC_MSG_ERROR([Can't find ldns library])
+       ]
+)
+
 AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATHNAME],[]))
-AC_MSG_CHECKING(for ldns/dns.h)
-#echo "[" $withval "]"
-for dir in $withval /usr/local/ldns /usr/lib/ldns /usr/ldns /usr/pkg /usr/local /usr; do
-ldnsdir="$dir"
-#echo "$dir/include/ldns/dns.h"
-#echo "$dir/ldns/dns.h"
-if test -f "$dir/include/ldns/dns.h"; then
-    found_ldns="yes";
-    LDNSDIR="$ldnsdir/include/"
-    CFLAGS="$CFLAGS -I$LDNSDIR -DHAVE_LDNS";
-    CXXFLAGS="$CXXFLAGS -I$ldnsdir/include/ -DHAVE_LDNS";
-    break;
-fi
-if test -f "$dir/ldns/dns.h"; then
-    found_ldns="yes";
-    LDNSDIR="$ldnsdir/"
-    CFLAGS="$CFLAGS -I$LDNSDIR -DHAVE_LDNS";
-    CXXFLAGS="$CXXFLAGS -I$ldnsdir/ -DHAVE_LDNS";
-    break
-fi
-done
-if test x_$found_ldns != x_yes; then
-        AC_MSG_RESULT(no)
-       AC_MSG_ERROR(Cannot find ldns libraries)
-else
-#        printf "ldns found in $ldnsdir\n";
-       LIBS="$LIBS -lldns";
-       LDFLAGS="$LDFLAGS -L$ldnsdir/lib";
-       LDFLAGS="$LDFLAGS -L$ldnsdir/.libs"; # hack for dev.
-       HAVE_LDNS=yes
-        AC_MSG_RESULT(yes)
-fi
-AC_SUBST(HAVE_LDNS)
-AC_SUBST(LDNSDIR, [$LDNSDIR])
 
-# I don't use these
-# Checks for typedefs, structures, and compiler characteristics.
-#AC_TYPE_UID_T
-#AC_TYPE_MODE_T
-#AC_TYPE_OFF_T
-#AC_TYPE_SIZE_T
-#AC_STRUCT_TM
+AC_CHECK_HEADER(ldns/dns.h,,  [
+       AC_MSG_ERROR([Can't find ldns headers])
+       ]
+)
 
-# Checks for library functions.
-# check for ldns
-#AC_FUNC_CHOWN
-#AC_FUNC_FORK
-#AC_FUNC_MALLOC
-#AC_FUNC_MKTIME
-#AC_FUNC_STAT
 #AC_CHECK_FUNCS([mkdir rmdir strchr strrchr strstr])
 
 #AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
index 99ab81fd3a9946260d914ce1ef8af03113f65bf0..00d750a2bb74559bb17222132e38fd0747a3102c 100644 (file)
@@ -11,6 +11,7 @@ mandir = @mandir@
 
 CC = @CC@
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 
index 5e6d2a4b93bde38e2e467f4da3c7f3251c2d13d5..955acc8bcccbcc6b9076d48a5dfa99d312e1bb1f 100644 (file)
@@ -2,8 +2,8 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(libdns-tests, 1.0.0, ldns@nlnetlabs.nl, ldns-tests-1.0.0)
-AC_CONFIG_SRCDIR([../ldns/config.h])
+AC_INIT(drill, 1.0.0, drill@nlnetlabs.nl, drill)
+AC_CONFIG_SRCDIR([ldns-read-zone.c])
 
 AC_AIX
 # Checks for programs.
@@ -26,58 +26,25 @@ AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
 ])
 
 # ripped from http://autoconf-archive.cryp.to/check_ssl.html
-
-
 # check for ldns
-AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=pathname],[]))
-AC_MSG_CHECKING(for ldns/dns.h)
-for dir in $withval /usr/local/ldns /usr/lib/ldns /usr/ldns /usr/pkg /usr/local /usr; do
-ldnsdir="$dir"
-if test -f "$dir/include/ldns/dns.h"; then
-    found_ldns="yes";
-    CFLAGS="$CFLAGS -I$ldnsdir/include/ -DHAVE_LDNS";
-    CXXFLAGS="$CXXFLAGS -I$ldnsdir/include/ -DHAVE_LDNS";
-    break;
-fi
-if test -f "$dir/ldns/dns.h"; then
-    found_ldns="yes";
-    CFLAGS="$CFLAGS -I$ldnsdir/ -DHAVE_LDNS";
-    CXXFLAGS="$CXXFLAGS -I$ldnsdir/ -DHAVE_LDNS";
-    break
-fi
-done
-if test x_$found_ldns != x_yes; then
-        AC_MSG_RESULT(no)
-       AC_MSG_ERROR(Cannot find ldns libraries)
-else
-#        printf "ldns found in $ldnsdir\n";
-       LIBS="$LIBS -lldns";
-       LDFLAGS="$LDFLAGS -L$ldnsdir/lib";
-       LDFLAGS="$LDFLAGS -L$ldnsdir/.libs"; # hack for dev.
-       HAVE_LDNS=yes
-        AC_MSG_RESULT(yes)
-fi
-AC_SUBST(HAVE_LDNS)
+AC_CHECK_LIB(ldns, ldns_rr_new,, [
+       AC_MSG_ERROR([Can't find ldns library])
+       ]
+)
 
-# I don't use these
-# Checks for typedefs, structures, and compiler characteristics.
-#AC_TYPE_UID_T
-#AC_TYPE_MODE_T
-#AC_TYPE_OFF_T
-#AC_TYPE_SIZE_T
-#AC_STRUCT_TM
+AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATHNAME],[]))
+
+AC_CHECK_HEADER(ldns/dns.h,,  [
+       AC_MSG_ERROR([Can't find ldns headers])
+       ]
+)
 
-# Checks for library functions.
-# check for ldns
-#AC_FUNC_CHOWN
-#AC_FUNC_FORK
-#AC_FUNC_MALLOC
-#AC_FUNC_MKTIME
-#AC_FUNC_STAT
 #AC_CHECK_FUNCS([mkdir rmdir strchr strrchr strstr])
 
 #AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
 
-AC_CONFIG_FILES([Makefile])
+#AC_CONFIG_FILES([Makefile
+#               drill.h
+#                 ])
 AC_CONFIG_HEADER([config.h])
 AC_OUTPUT
index ddf4d113582687f6a7199d3870421231032b604d..c751300b4d034360cf423c977142eecbc7030e7d 100644 (file)
@@ -6,7 +6,13 @@
  * Licensed under the GPL version 2
  */
 
-#include <ldns/config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <stdint.h>
 
 #include <ldns/dns.h>
 
index a4a8c8dc9bd9cdb697536b9c2507913775d9ff10..82c90ccacb9368f147b557e8a6a105c7d2944f62 100644 (file)
@@ -5,7 +5,13 @@
  * Licensed under the GPL version 2
  */
 
-#include <ldns/config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <stdint.h>
 
 #include <ldns/dns.h>
 
index 83d2f94658cd7e0e271f0053372ce1f06f4f92b4..02659a1a2fe6aacf71031c1bbfc5545a6db06862 100644 (file)
@@ -2,7 +2,9 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#include <ldns/config.h>
+#include "config.h"
+
+#include <stdint.h>
 
 #include <ldns/dns.h>
 
diff --git a/zone.c b/zone.c
index e46529cbdaead8f355ebe0cdc1201297ec31fa31..d078587965a8d1cb917cf6a9b982b0bbfda96ce7 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -178,7 +178,6 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c
        i = 0;
        do {
                rr = ldns_rr_new_frm_fp_l(fp, &my_ttl, &my_origin, line_nr);
-printf("RR at %p\n", rr);
                i++;
        } while (!rr && i <= 9);