[ldns-users] ldns clean target, spec file for rpm building

Paul Wouters paul at xelerance.com
Wed Oct 5 07:28:47 UTC 2005

Hi guys,

some comments about ldns :)

It seems the Makefile is incorrectly using prefix instead of my directed
--libdir directory. The Makefile shows that while using 
./configure --libdir=/usr/lib64, I end up with:

install-lib:    lib
                 $(LIBTOOL) --mode=install cp libldns.la $(prefix)/lib
                 $(LIBTOOL) --mode=finish $(prefix)/lib


./libtool --mode=finish /usr/lib

These are all not using configure's --libdir argument properly.
Makefile.in has the proper reference:

install-lib:    lib
                 $(LIBTOOL) --mode=install cp libldns.la $(libdir)
                 $(LIBTOOL) --mode=finish $(libdir)

I *think* this is partialy fixed by adding the following line to Makefile.in

libdir          = @libdir@

But I am not an autoconf/automake/libtool expert, so someone who is should
verify this.

Similarly, Makefile.in has:

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

Where rpath should probably be $(libdir).

libtool seems to have another problem related to libdir later on:

 	./libtool --mode=install cp libldns.la /var/tmp/ldns-0.70-1-root-root/usr/lib64

That is the command that runs from make install, but it shows:

cp .libs/libldns.so.0.0.0 /var/tmp/ldns-0.70-1-root-root/usr/libldns.so.0.0.0
(cd /var/tmp/ldns-0.70-1-root-root/usr && rm -f libldns.so.0 && ln -s libldns.so.0.0.0 libldns.so.0)
(cd /var/tmp/ldns-0.70-1-root-root/usr && rm -f libldns.so && ln -s libldns.so.0.0.0 libldns.so)
cp .libs/libldns.lai /var/tmp/ldns-0.70-1-root-root/usr/libldns.la
cp .libs/libldns.a /var/tmp/ldns-0.70-1-root-root/usr/libldns.a
ranlib /var/tmp/ldns-0.70-1-root-root/usr/libldns.a
chmod 644 /var/tmp/ldns-0.70-1-root-root/usr/libldns.a

There are all wrongly using "prefix" instead of "libdir".

Another problem is in the uninstall target, though I will never use it myself:

 	$(LIBTOOL) --mode=uninstall rm $(prefix)/lib/libldns.la

That should also be using $(libdir) and not $(prefix)/lib.
There are more of these with other configure options too, such as --includedir, eg:

 	 $(INSTALL) -m 755 -d $(prefix)/include/ldns

It seems 'make clean' does not clean out everything, and there is no make
distclean target. Though I see 'make realclean'. hmmm.

A warning I got compiling on gcc4:

dnssec.c: In function 'ldns_create_nsec':
dnssec.c:1231: warning: 'owner' is used uninitialized in this function
dnssec.c:1231: warning: 'nsec_types' is used uninitialized in this function


doxygen: /usr/src/redhat/BUILD/ldns-0.70/ldns/buffer.h:482: Warning: Found unknown command `\0'
doxygen: /usr/src/redhat/BUILD/ldns-0.70/ldns/buffer.h:483: Warning: Found unknown command `\0'
doxygen: /usr/src/redhat/BUILD/ldns-0.70/ldns/resolver.h:295: Warning: argument `resolver' of command @param is not found in the argument list of ldns_axfr_last_pkt(ldns_resolver *res)
doxygen: /usr/src/redhat/BUILD/ldns-0.70/ldns/resolver.h:295: Warning: The following parameters of ldns_axfr_last_pkt(ldns_resolver *res) are not documented:
   parameter res

I would personally call the "progs" target "programs". And there should
probably be a "install-progs" (or install-programs) target.

And finally, as with the nsd build process, the 'make install' target does
not allow installing in a "dist" or "inst_prefix_dir"  directory, so it
cannot be re-used for rpm building.


More information about the ldns-users mailing list