diff --git a/CHANGELOG b/CHANGELOG index 463d38c..5a29451 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -115,7 +115,13 @@ version 2.77 that privileged hosts are not given "guest" addresses by accident. Thanks to Todd Sanket for the suggestion. + Remove historic automatic inclusion of IDN support when + building internationalisation support. This doesn't + fit now there is a choice of IDN libraries. Be sure + to include either -DHAVE_IDN or _DHAVE_LIBIDN2 for + IDN support. + version 2.76 Include 0.0.0.0/8 in DNS rebind checks. This range translates to hosts on the local network, or, at diff --git a/Makefile b/Makefile index 5526aab..73ea23e 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,8 @@ dbus_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) dbus_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1` idn_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --cflags libidn` idn_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn` -idn2_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFIG) --cflags libidn2` -idn2_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFIG) --libs libidn2` +idn2_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFIG) --cflags libidn2` +idn2_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFIG) --libs libidn2` ct_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack` ct_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack` lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.2` @@ -108,8 +108,8 @@ all-i18n : $(BUILDDIR) @cd $(BUILDDIR) && $(MAKE) \ top="$(top)" \ i18n=-DLOCALEDIR=\'\"$(LOCALEDIR)\"\' \ - build_cflags="$(version) $(dbus_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags) `$(PKG_CONFIG) --cflags libidn`" \ - build_libs="$(dbus_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) `$(PKG_CONFIG) --libs libidn`" \ + build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ + build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \ -f $(top)/Makefile dnsmasq for f in `cd $(PO); echo *.po`; do \ cd $(top) && cd $(BUILDDIR) && $(MAKE) top="$(top)" -f $(top)/Makefile $${f%.po}.mo; \ diff --git a/debian/rules b/debian/rules index fc0dcf4..2df656f 100755 --- a/debian/rules +++ b/debian/rules @@ -48,6 +48,10 @@ ifeq (,$(filter nodbus,$(DEB_BUILD_OPTIONS))) DEB_COPTS += -DHAVE_DBUS endif +ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS))) + DEB_COPTS += -DHAVE_IDN +endif + ifeq (,$(filter noconntrack,$(DEB_BUILD_OPTIONS))) ifeq ($(DEB_HOST_ARCH_OS),linux) DEB_COPTS += -DHAVE_CONNTRACK @@ -84,9 +88,6 @@ endif ifneq (,$(filter noi18n,$(DEB_BUILD_OPTIONS))) TARGET = install - ifeq (,$(filter noidn, $(DEB_BUILD_OPTIONS))) - DEB_COPTS += -DHAVE_IDN - endif endif ifneq (,$(filter uselua,$(DEB_BUILD_OPTIONS))) diff --git a/src/config.h b/src/config.h index 72f32db..de960d8 100644 --- a/src/config.h +++ b/src/config.h @@ -95,10 +95,7 @@ HAVE_DBUS HAVE_IDN define this if you want international domain name 2003 support. - NOTE: for backwards compatibility, IDN support is automatically - included when internationalisation support is built, using the - *-i18n makefile targets, even if HAVE_IDN is not explicitly set. - + HAVE_LIBIDN2 define this if you want international domain name 2008 support. @@ -400,14 +397,14 @@ static char *compile_opts = "no-" #endif "i18n " -#if !defined(LOCALEDIR) && !defined(HAVE_IDN) -"no-" -#endif -"IDN " -#if !defined(HAVE_LIBIDN2) -"no-" -#endif +#if defined(HAVE_LIBIDN2) "IDN2 " +#else + #if !defined(HAVE_IDN) +"no-" + #endif +"IDN " +#endif #ifndef HAVE_DHCP "no-" #endif diff --git a/src/util.c b/src/util.c index 27fbece..145e53a 100644 --- a/src/util.c +++ b/src/util.c @@ -24,9 +24,9 @@ #include #endif -#ifdef HAVE_LIBIDN2 +#if defined(HAVE_LIBIDN2) #include -#elif defined(LOCALEDIR) || defined(HAVE_IDN) +#elif defined(HAVE_IDN) #include #endif @@ -136,7 +136,7 @@ static int check_name(char *in) else if (isascii((unsigned char)c) && iscntrl((unsigned char)c)) /* iscntrl only gives expected results for ascii */ return 0; -#if !defined(LOCALEDIR) && !defined(HAVE_IDN) && !defined(HAVE_LIBIDN2) +#if !defined(HAVE_IDN) && !defined(HAVE_LIBIDN2) else if (!isascii((unsigned char)c)) return 0; #endif @@ -186,7 +186,7 @@ int legal_hostname(char *name) char *canonicalise(char *in, int *nomem) { char *ret = NULL; -#if defined(LOCALEDIR) || defined(HAVE_IDN) || defined(HAVE_LIBIDN2) +#if defined(HAVE_IDN) || defined(HAVE_LIBIDN2) int rc; #endif @@ -196,7 +196,7 @@ char *canonicalise(char *in, int *nomem) if (!check_name(in)) return NULL; -#if defined(LOCALEDIR) || defined(HAVE_IDN) || defined(HAVE_LIBIDN2) +#if defined(HAVE_IDN) || defined(HAVE_LIBIDN2) #ifdef HAVE_LIBIDN2 rc = idn2_to_ascii_lz(in, &ret, IDN2_NONTRANSITIONAL); if (rc == IDN2_DISALLOWED)