[Dnsmasq-discuss] Announce: dnsmasq-2.51rc1

Matthias Andree matthias.andree at gmx.de
Thu Oct 1 15:00:56 BST 2009

Am 01.10.2009, 14:19 Uhr, schrieb Simon Kelley <simon at thekelleys.org.uk>:

>>  - During build, I18N - which currently comprises IDN _and_ NLS as an  
>> inseparable union - only works with GNU make, not with BSD's make.
> Where is the problem? I ensured that the build works with BSD make, but  
> only for the non-IDN build, it would be good to fix that.

Dear Simon,

The problem lies in bld/Makefile which uses %-pattern rules (a GNUism) on  
line 16 rather than traditional suffix rules (lines 7 - 8).

      1  CFLAGS = -Wall -W -O2
      3  OBJS = cache.o rfc1035.o util.o option.o forward.o network.o \
      4         dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
      5         helper.o tftp.o log.o
      7  .c.o:
      8          $(CC) $(CFLAGS) $(COPTS) $(I18N) $(DNSMASQ_CFLAGS)  
$(RPM_OPT_FLAGS) -c $<
     10  dnsmasq : $(OBJS)
     11          $(CC) $(LDFLAGS) -o $@  $(OBJS) $(DNSMASQ_LIBS) $(LIBS)
     13  dnsmasq.pot : $(OBJS:.o=.c) dnsmasq.h config.h
     14          $(XGETTEXT) -d dnsmasq --foreign-user --omit-header  
--keyword=_ -o $@ -i $(OBJS:.o=.c)
     16  %.mo : ../po/%.po dnsmasq.pot
     17          $(MSGMERGE) -o - ../po/$*.po dnsmasq.pot | $(MSGFMT) -o  
$*.mo -

ll 13f: The ":.o=.c" modifier is supported on SysV and BSD, but I'm not  
sure about its portability to other systems.

l 16: The % patterns are unsupported in BSD make; in a traditional .po.mo:  
pattern you cannot directly list the prerequisite dnsmasq.pot, and if you  
list a $(MAKE) dnsmasq.pot you'll break parallel builds (make -j3) (so  
better list it in the command block of another rule instead), and I'm not  
sure how you could express the ../po/ path insert at all. Perhaps a  
POFILES=da.po de.po es pt_BR ro... style variable which you substitue from  
might help a bit, too.

Relevant documentation:
- Tutorial http://www.freebsd.org/doc/en_US.ISO8859-1/books/pmake/
- Manpage   

Note that overriding CFLAGS (line 1) is frowned upon in BSD, too, although  
I think DNSMASQ_CFLAGS and RPM_OPT_FLAGS offers plenty ways to merge  

>> - I wonder how dnsmasq will figure out the proper character set for  
>> these files -- or will it just assume UTF-8? Older systems might use  
>> some ISO-8859-* variant. (Sorry, no time to read source now.)
> It calls idna_to_ascii_lz() which uses the current locale.

...which derives from implicit assumptions that the user starting dnsmasq  
uses the proper locale for the /etc/ files subjected to IDN/Punycode  
handling, particularly on systems where root users don't usually log in,  
but use sudo (Ubuntu Linux) - the console locale used to edit files may  
differ from the locale in effect when /etc/init.d/dnsmasq or init or  
Upstart or whichever launches the daemon.

This should be documented very clearly in the manpage and the relevant  
.html file to avoid surprises - the locale used to edit these /etc/ files  
must get set in the environment where dnsmasq is launched.

>>  - The "all-i18n" target creates the .mo files under /src which I find  
>> counterintuitive.
> I can't remember why it's done like that. It must have made sense at the  
> time!

Well at least they are side to side with the .o files which also end up in  
src/, and then I wonder what the bld/ directory is for if it's static. I  
would've guessed from the name that bld/ is build/ and hence where the  
outputs are supposed to end up, but apparently not so. :)


Matthias Andree

More information about the Dnsmasq-discuss mailing list