From: Matthijs Mekking Date: Mon, 1 Feb 2010 10:04:35 +0000 (+0000) Subject: ondrej patch X-Git-Tag: release-1.6.5~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb8e2b3eeee61853dd39bd0685416ddd8f6439ef;p=thirdparty%2Fldns.git ondrej patch --- diff --git a/Makefile.in b/Makefile.in index 670220ab..f415989a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,6 +42,12 @@ CFLAGS = $(strip @CFLAGS@) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ LIBOBJS = @LIBOBJS@ +PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ +PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ +LIBNSL_LIBS = @LIBNSL_LIBS@ +LIBSSL_CPPFLAGS = @LIBSSL_CPPFLAGS@ +LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ +LIBSSL_LIBS = @LIBSSL_LIBS@ RUNTIME_PATH = @RUNTIME_PATH@ DATE = $(shell date +%Y%m%d) LIBTOOL = $(libtool) --tag=CC --quiet @@ -97,7 +103,7 @@ LINK = $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS)) LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined) %.o: $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/util.h ldns/config.h - $(COMP_LIB) -c $< + $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $< .PHONY: clean realclean docclean manpages doc lint all lib pyldns .PHONY: install uninstall install-doc uninstall-doc uninstall-pyldns @@ -115,7 +121,7 @@ lib-export-all: libldns.la-export-all if [ ! -d lib ] ; then ln -s .libs lib ; fi ; libldns.la: $(LIBDNS_OBJECTS) - $(LINK_LIB) --export-symbols $(srcdir)/ldns_symbols.def -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir) $(RUNTIME_PATH) + $(LINK_LIB) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) --export-symbols $(srcdir)/ldns_symbols.def -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir) $(RUNTIME_PATH) libldns.la-export-all: $(LIBDNS_OBJECTS) $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir) $(RUNTIME_PATH) @@ -133,7 +139,7 @@ mancheck: doxygen: manpages $(INSTALL) -d doc ifdef doxygen - # if we are not in base we need to copy some html files too +# if we are not in base we need to copy some html files too if [ ! -e doc/header.html ] ; then \ $(INSTALL) -c -m 644 $(srcdir)/doc/header.html doc/ ; \ fi ; @@ -148,13 +154,13 @@ manpages: $(srcdir)/doc/function_manpages pyldns: _ldns.la $(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/util.h ldns/config.h - $(swig) -python -o $@ $(CPPFLAGS) $< + $(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $< ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/util.h ldns/config.h - $(COMP_LIB) -I./include/ldns -c $< -o $@ + $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) -c $< -o $@ _ldns.la: ldns_wrapper.lo libldns.la - $(LIBTOOL) --tag=CC --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ $< -rpath $(python_site) -L. -L.libs -lldns $(LIBS)) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(strip $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ $< -rpath $(python_site) -L. -L.libs -lldns $(LIBS)) install: install-h install-lib install-config install-manpages $(pyldns_inst) @@ -191,7 +197,7 @@ uninstall-h: rm -f $(DESTDIR)$(includedir)/$$i; done [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone" exit 0 - + install-lib: lib $(INSTALL) -m 755 -d $(DESTDIR)$(libdir) $(LIBTOOL) --mode=install cp libldns.la $(DESTDIR)$(libdir) diff --git a/configure.ac b/configure.ac index 6dc39f61..61d386a2 100644 --- a/configure.ac +++ b/configure.ac @@ -91,8 +91,6 @@ if test x_$withval != x_no; then fi # Have Python AC_DEFINE(HAVE_PYTHON,1,[Define if you have Python libraries and header files.]) - LIBS="$PYTHON_LDFLAGS $LIBS" - CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" ldns_have_python=yes fi @@ -112,13 +110,20 @@ if test x_$withval != x_no; then fi fi +# Use libtool +ACX_LIBTOOL_C_ONLY + +tmp_CPPFLAGS=$CPPFLAGS +tmp_LDFLAGS=$LDFLAGS +tmp_LIBS=$LIBS +CPPFLAGS= +LDFLAGS= +LIBS= + ACX_WITH_SSL_OPTIONAL AC_CHECK_FUNCS([EVP_sha256]) -# Use libtool -ACX_LIBTOOL_C_ONLY - # for macosx, see if glibtool exists and use that # BSD's need to know the version... #AC_CHECK_PROG(glibtool, glibtool, [glibtool], ) @@ -126,16 +131,17 @@ ACX_LIBTOOL_C_ONLY AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support])) case "$enable_sha2" in - no) - ;; yes|*) - if test "x$HAVE_SSL" = "xyes"; then - AC_MSG_CHECKING(for SHA256 and SHA512) - AC_CHECK_LIB(crypto, SHA256_Init,, [ - AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2]) - ]) - AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.]) + if test "x$HAVE_SSL" != "xyes"; then + AC_MSG_ERROR([SHA2 enabled, but no SSL support]) fi + AC_MSG_CHECKING(for SHA256 and SHA512) + AC_CHECK_FUNC(SHA256_Init, [], [ + AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2]) + ]) + AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.]) + ;; + no) ;; esac @@ -146,13 +152,21 @@ case "$enable_gost" in AC_MSG_ERROR([GOST enabled, but no SSL support]) fi AC_MSG_CHECKING(for GOST) - AC_CHECK_LIB(crypto, EVP_PKEY_set_type_str,,[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support])]) + AC_CHECK_FUNC(EVP_PKEY_set_type_str, [],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support])]) AC_DEFINE_UNQUOTED([USE_GOST], [1], [Define this to enable GOST support.]) ;; no|*) ;; esac +AC_SUBST(LIBSSL_CPPFLAGS,$CPPFLAGS) +AC_SUBST(LIBSSL_LDFLAGS,$LDFLAGS) +AC_SUBST(LIBSSL_LIBS,$LIBS) + +CPPFLAGS=$tmp_CPPFLAGS +LDFLAGS=$tmp_LDFLAGS +LIBS=$tmp_LIBS + # add option to disable installation of ldns-config script AC_ARG_ENABLE(ldns-config, [ --disable-ldns-config disable installation of ldns-config (default=enabled)], enable_ldns_config=$enableval, enable_ldns_config=yes) @@ -241,7 +255,13 @@ AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], # check to see if libraries are needed for these functions. AC_CHECK_LIB(socket, socket) -AC_CHECK_LIB(nsl, inet_pton) + +tmp_LIBS=$LIBS +LIBS= +AC_SEARCH_LIBS(inet_pton, nsl) +AC_SUBST(LIBNSL_LIBS,$LIBS) +LIBS=$tmp_LIBS + # AC_SEARCH_LIBS([socket], [socket]) # AC_SEARCH_LIBS([inet_pton], [nsl]) diff --git a/drill/configure.ac b/drill/configure.ac index e312a832..6ce2d371 100644 --- a/drill/configure.ac +++ b/drill/configure.ac @@ -186,7 +186,6 @@ AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], # check to see if libraries are needed for these functions. AC_CHECK_LIB(socket, socket) -AC_CHECK_LIB(nsl, inet_pton) ACX_WITH_SSL_OPTIONAL diff --git a/examples/Makefile.in b/examples/Makefile.in index f30af466..57b3c2e4 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -14,6 +14,10 @@ CC = @CC@ CFLAGS = -I. -I${srcdir} @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ +LIBNSL_LIBS = @LIBNSL_LIBS@ +LIBSSL_CPPFLAGS = @LIBSSL_CPPFLAGS@ +LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ +LIBSSL_LIBS = @LIBSSL_LIBS@ LIBS = @LIBS@ RUNTIME_PATH = @RUNTIME_PATH@ LDNSDIR = @LDNSDIR@ @@ -35,7 +39,6 @@ MAIN_SOURCES = ldns-read-zone.c \ ldns-update.c \ ldns-keygen.c \ ldns-key2ds.c \ - ldns-signzone.c \ ldns-version.c \ ldns-rrsig.c \ ldns-walk.c \ @@ -43,24 +46,28 @@ MAIN_SOURCES = ldns-read-zone.c \ ldns-zcat.c \ ldns-dpa.c \ ldns-resolver.c \ - ldnsd.c \ ldns-keyfetcher.c \ ldns-notify.c \ ldns-testns.c \ ldns-compare-zones.c \ + ldnsd.c + +MAIN_SSL_SOURCES = ldns-signzone.c \ ldns-verify-zone.c \ ldns-revoke.c \ ldns-nsec3-hash.c + OTHER_SOURCES = ldns-testpkts.c PROGRAMS=$(MAIN_SOURCES:.c=) +SSL_PROGRAMS=$(MAIN_SSL_SOURCES:.c=) .PHONY: all clean realclean all-static -.SECONDARY: $(MAIN_SOURCES:.c=.o) $(OTHER_SOURCES:.c=.o) +.SECONDARY: $(MAIN_SOURCES:.c=.o) $(OTHER_SOURCES:.c=.o) $(MAIN_SSL_SOURCES:.c=.o) -all: $(addsuffix .prg,$(PROGRAMS)) +all: $(addsuffix .prg,$(PROGRAMS)) $(addsuffix .prg-ssl,$(SSL_PROGRAMS)) -all-static: $(addsuffix .stc,$(PROGRAMS)) +all-static: $(addsuffix .stc,$(PROGRAMS)) $(addsuffix .stc-ssl,$(SSL_PROGRAMS)) %.o: $(srcdir)/%.c $(COMPILE) -o $@ -c $< @@ -70,6 +77,30 @@ ldns-testns.o: $(srcdir)/ldns-testns.c $(srcdir)/ldns-testpkts.c $(srcdir)/ldns- ldns-testns.prg: ldns-testpkts.o ldns-testns.stc: ldns-testpkts.o +ldnsd.prg: ldnsd.o + @if test ! -f $(@:.prg=) -o $< -nt $(@:.prg=); then \ + echo $(LINK) $(LIBNSL_LIBS) -o $(@:.prg=) $^ ; \ + $(LINK) $(LIBNSL_LIBS) -o $(@:.prg=) $^ ; \ + fi + +ldnsd.stc: ldnsd.o + @if test ! -f $@ -o $< -nt $@; then \ + echo $(LINK_STATIC) $(LIBNSL_LDFLAGS) -o $@ $^ ; \ + $(LINK_STATIC) $(LIBNSL_LDFLAGS) -o $@ $^ ; \ + fi + +%.prg-ssl: %.o + @if test ! -f $(@:.prg-ssl=) -o $< -nt $(@:.prg-ssl=); then \ + echo $(LINK) $(LIBNSL_LIBS) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) -o $(@:.prg-ssl=) $^ ; \ + $(LINK) $(LIBNSL_LIBS) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) -o $(@:.prg-ssl=) $^ ; \ + fi + +%.stc-ssl: %.o + @if test ! -f $@ -o $< -nt $@; then \ + echo $(LINK_STATIC) $(LIBNSL_LIBS) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) -o $@ $^ ; \ + $(LINK_STATIC) $(LIBNSL_LIBS) $(LIBSSL_LDFLAGS) $(LIBSSL_LIBS) -o $@ $^ ; \ + fi + %.prg: %.o @if test ! -f $(@:.prg=) -o $< -nt $(@:.prg=); then \ echo $(LINK) -o $(@:.prg=) $^ ; \ @@ -91,8 +122,8 @@ lint: clean: rm -f *.o *.lo rm -rf .libs - rm -f $(PROGRAMS) - rm -f $(addsuffix .stc,$(PROGRAMS)) + rm -f $(PROGRAMS) $(SSL_PROGRAMS) + rm -f $(addsuffix .stc,$(PROGRAMS)) $(addsuffix .stc,$(SSL_PROGRAMS)) realclean: clean rm -rf autom4te.cache/ @@ -102,16 +133,16 @@ realclean: clean confclean: clean rm -rf config.log config.status config.h Makefile -install: $(PROGRAMS) +install: $(PROGRAMS) $(SSL_PROGRAMS) $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(INSTALL) -d -m 755 $(DESTDIR)$(mandir) $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/man1 - for i in $(PROGRAMS); do \ + for i in $(PROGRAMS) $(SSL_PROGRAMS); do \ $(libtool) --tag=CC --mode=install ${INSTALL} -c $$i $(DESTDIR)$(bindir) ; \ $(INSTALL) -c -m 644 $(srcdir)/$$i.1 $(DESTDIR)$(mandir)/man1/$$i.1 ; \ done exit 0 - + install-static: all-static $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(INSTALL) -d -m 755 $(DESTDIR)$(mandir) @@ -120,10 +151,14 @@ install-static: all-static $(libtool) --tag=CC --mode=install ${INSTALL} -c $$i.stc $(DESTDIR)$(bindir) ; \ $(INSTALL) -c -m 644 $(srcdir)/$$i.1 $(DESTDIR)$(mandir)/man1/$$i.1 ; \ done + for i in $(SSL_PROGRAMS); do \ + $(libtool) --tag=CC --mode=install ${INSTALL} -c $$i.stc-ssl $(DESTDIR)$(bindir) ; \ + $(INSTALL) -c -m 644 $(srcdir)/$$i.1 $(DESTDIR)$(mandir)/man1/$$i.1 ; \ + done exit 0 - + uninstall: - for i in $(PROGRAMS); do \ + for i in $(PROGRAMS) $(SSL_PROGRAMS); do \ rm -f $(DESTDIR)$(bindir)/$$i ; \ rm -f $(DESTDIR)$(mandir)/man1/$$i.1 ; \ done diff --git a/examples/configure.ac b/examples/configure.ac index 81607505..1e78f7ca 100644 --- a/examples/configure.ac +++ b/examples/configure.ac @@ -186,10 +186,30 @@ AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], # check to see if libraries are needed for these functions. AC_CHECK_LIB(socket, socket) -AC_CHECK_LIB(nsl, inet_pton) + +tmp_LIBS=$LIBS +LIBS= +AC_SEARCH_LIBS(inet_pton, nsl) +AC_SUBST(LIBNSL_LIBS,$LIBS) +LIBS=$tmp_LIBS + +tmp_CPPFLAGS=$CPPFLAGS +tmp_LDFLAGS=$LDFLAGS +tmp_LIBS=$LIBS +CPPFLAGS= +LDFLAGS= +LIBS= ACX_WITH_SSL_OPTIONAL +AC_SUBST(LIBSSL_CPPFLAGS,$CPPFLAGS) +AC_SUBST(LIBSSL_LDFLAGS,$LDFLAGS) +AC_SUBST(LIBSSL_LIBS,$LIBS) + +CPPFLAGS=$tmp_CPPFLAGS +LDFLAGS=$tmp_LDFLAGS +LIBS=$tmp_LIBS + AC_ARG_ENABLE(sha2, AC_HELP_STRING([--enable-sha2], [Enable SHA256 and SHA512 RRSIG support, experimental])) case "$enable_sha2" in yes)