* Mozilla IDN patch -- standalone version -- To apply this patch, % cd mozilla_top_dir_where_README_file_resides % patch -p0 < this_patch_file This patch doesn't contain a patch to `configure' script because even the small difference among the versions of the script may cause the patch to fail. So after applying it, you have to re-generate `configure' by running `autoconf'. % autoconf Then run `configure' with `--with-mdnkit' option. % ./configure --with-mdnkit=/usr/local The rest is the same as the standard compilation/installation process. This patch modifies the following files: aclocal.m4 allmakefiles.sh build/unix/modules.mk config/autoconf.mk.in configure.in modules/libpref/src/init/all.js xpcom/Makefile.in and creates the following files: build/autoconf/mdnkit.m4 xpcom/idn/Makefile.in xpcom/idn/nsIDNService.cpp xpcom/idn/nsIDNService.h xpcom/idn/nsIDNServiceModule.cpp *** aclocal.m4.org Wed Jan 9 23:35:21 2002 --- aclocal.m4 Tue Jan 29 13:16:18 2002 *************** *** 10,15 **** --- 10,16 ---- builtin(include, build/autoconf/libart.m4)dnl builtin(include, build/autoconf/pkg.m4)dnl builtin(include, build/autoconf/freetype2.m4)dnl + builtin(include, build/autoconf/mdnkit.m4)dnl dnl define(MOZ_TOPSRCDIR,.)dnl MOZ_TOPSRCDIR is used in altoptions.m4 builtin(include, build/autoconf/altoptions.m4)dnl *** allmakefiles.sh.org Fri Dec 28 17:38:13 2001 --- allmakefiles.sh Wed Jan 23 18:30:19 2002 *************** *** 545,550 **** --- 545,551 ---- xpcom/components/Makefile xpcom/ds/Makefile xpcom/glue/Makefile + xpcom/idn/Makefile xpcom/io/Makefile xpcom/typelib/Makefile xpcom/reflect/Makefile *** /dev/null Thu Jan 31 12:01:19 2002 --- build/autoconf/mdnkit.m4 Tue Jan 29 14:40:47 2002 *************** *** 0 **** --- 1,18 ---- + # Configure paths for mDNkit (minimal version) + + AC_DEFUN(AM_PATH_MDNKIT, + [dnl + mdnkit_prefix=no + AC_ARG_WITH(mdnkit,[ --with-mdnkit=PFX Prefix where mDNkit is installed (default=/usr/local)], + mdnkit_prefix="$withval") + if test x$mdnkit_prefix = xyes ; then + mdnkit_prefix=/usr/local + fi + if test x$mdnkit_prefix != xno ; then + MDN_CFLAGS="-I$mdnkit_prefix/include" + MDN_LIBS="-L$mdnkit_prefix/lib -lmdnlite" + fi + + AC_SUBST(MDN_CFLAGS) + AC_SUBST(MDN_LIBS) + ]) *** build/unix/modules.mk.org Thu Dec 20 10:21:28 2001 --- build/unix/modules.mk Wed Jan 23 18:31:04 2002 *************** *** 69,75 **** BM_DIRS_xpcom = $(BM_DIRS_xpidl) modules/libreg string xpcom BM_DEP_DIRS_xpcom = intl/unicharutil/public intl/uconv/public modules/libjar netwerk/base/public netwerk/build BM_CVS_NS_xpcom = $(BM_CVS_NS_xpidl) xpcom intl/uconv/public netwerk/base/public netwerk/build ! BM_CVS_xpcom = $(BM_CVS_xpidl) modules/libreg xpcom/glue xpcom/base xpcom/ds xpcom/io xpcom/components xpcom/threads xpcom/reflect xpcom/proxy xpcom/build xpcom/tools xpcom/sample string modules/libjar intl/unicharutil/public # # xpconnect --- 69,75 ---- BM_DIRS_xpcom = $(BM_DIRS_xpidl) modules/libreg string xpcom BM_DEP_DIRS_xpcom = intl/unicharutil/public intl/uconv/public modules/libjar netwerk/base/public netwerk/build BM_CVS_NS_xpcom = $(BM_CVS_NS_xpidl) xpcom intl/uconv/public netwerk/base/public netwerk/build ! BM_CVS_xpcom = $(BM_CVS_xpidl) modules/libreg xpcom/glue xpcom/base xpcom/ds xpcom/idn xpcom/io xpcom/components xpcom/threads xpcom/reflect xpcom/proxy xpcom/build xpcom/tools xpcom/sample string modules/libjar intl/unicharutil/public # # xpconnect *** config/autoconf.mk.in.org Wed Jan 16 14:09:18 2002 --- config/autoconf.mk.in Tue Jan 29 13:57:53 2002 *************** *** 272,277 **** --- 272,280 ---- LDAP_CFLAGS = @LDAP_CFLAGS@ LDAP_LIBS = @LDAP_LIBS@ + MDN_CFLAGS = @MDN_CFLAGS@ + MDN_LIBS = @MDN_LIBS@ + # MKSHLIB_FORCE_ALL is used to force the linker to include all object # files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker # to normal behavior. Makefile's that create shared libraries out of *** configure.in.org Wed Jan 16 17:45:57 2002 --- configure.in Tue Jan 29 14:02:22 2002 *************** *** 4122,4127 **** --- 4122,4132 ---- AC_SUBST(MOZ_INTERNAL_LIBART_LGPL) dnl ======================================================== + dnl Check for mDNkit + dnl ======================================================== + AM_PATH_MDNKIT + + dnl ======================================================== dnl disable xul dnl ======================================================== MOZ_XUL=1 *** modules/libpref/src/init/all.js.org Sun Jan 20 06:53:59 2002 --- modules/libpref/src/init/all.js Wed Jan 23 18:31:46 2002 *************** *** 452,458 **** pref("signon.rememberSignons", true); pref("signon.expireMasterPassword", false); pref("network.enablePad", false); // Allow client to do proxy autodiscovery ! pref("network.enableIDN", false); // Turn on/off IDN (Internationalized Domain Name) resolution pref("converter.html2txt.structs", true); // Output structured phrases (strong, em, code, sub, sup, b, i, u) pref("converter.html2txt.header_strategy", 1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention pref("wallet.captureForms", true); --- 452,458 ---- pref("signon.rememberSignons", true); pref("signon.expireMasterPassword", false); pref("network.enablePad", false); // Allow client to do proxy autodiscovery ! pref("network.enableIDN", true); // Turn on/off IDN (Internationalized Domain Name) resolution pref("converter.html2txt.structs", true); // Output structured phrases (strong, em, code, sub, sup, b, i, u) pref("converter.html2txt.header_strategy", 1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention pref("wallet.captureForms", true); *** xpcom/Makefile.in.org Sun Dec 9 16:04:19 2001 --- xpcom/Makefile.in Tue Jan 29 14:08:07 2002 *************** *** 40,45 **** --- 40,49 ---- tools \ $(NULL) + ifneq ($(MDN_CFLAGS),) + DIRS += idn + endif + ifeq ($(OS_ARCH),WINNT) ifdef MOZ_DEBUG DIRS += windbgdlg *** /dev/null Thu Jan 31 12:01:19 2002 --- xpcom/idn/Makefile.in Thu Jan 31 11:09:25 2002 *************** *** 0 **** --- 1,58 ---- + # + # The contents of this file are subject to the Netscape Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/NPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is mozilla.org code. + # + # The Initial Developer of the Original Code is Netscape + # Communications Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): + # + + DEPTH = ../.. + topsrcdir = @top_srcdir@ + srcdir = @srcdir@ + VPATH = @srcdir@ + + include $(DEPTH)/config/autoconf.mk + + OS_CXXFLAGS += $(MDN_CFLAGS) + + MODULE = xpcom + XPIDL_MODULE = xpcom_idn + LIBRARY_NAME = xpcomidn_s + IS_COMPONENT = 1 + MODULE_NAME = nsIDNServiceModule + REQUIRES = xpcom \ + string \ + necko \ + $(NULL) + + CPPSRCS = nsIDNService.cpp \ + nsIDNServiceModule.cpp \ + $(NULL) + + include $(topsrcdir)/config/config.mk + + LIBS += \ + $(XPCOM_LIBS) \ + $(NULL) + + include $(topsrcdir)/config/rules.mk + + EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(MDN_LIBS) + + #install:: $(TARGETS) + # $(INSTALL) $(srcdir)/xpconnect-sample.html $(DIST)/bin/res/samples + # $(INSTALL) $(srcdir)/nsSample.js $(DIST)/bin/components + *** /dev/null Thu Jan 31 12:01:19 2002 --- xpcom/idn/nsIDNService.cpp Thu Jan 31 10:33:30 2002 *************** *** 0 **** --- 1,135 ---- + /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* + * Copyright (c) 2002 Japan Network Information Center. All rights reserved. + * + * By using this file, you agree to the terms and conditions set forth bellow. + * + * LICENSE TERMS AND CONDITIONS + * + * The following License Terms and Conditions apply, unless a different + * license is obtained from Japan Network Information Center ("JPNIC"), + * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, + * Chiyoda-ku, Tokyo 101-0047, Japan. + * + * 1. Use, Modification and Redistribution (including distribution of any + * modified or derived work) in source and/or binary forms is permitted + * under this License Terms and Conditions. + * + * 2. Redistribution of source code must retain the copyright notices as they + * appear in each source code file, this License Terms and Conditions. + * + * 3. Redistribution in binary form must reproduce the Copyright Notice, + * this License Terms and Conditions, in the documentation and/or other + * materials provided with the distribution. For the purposes of binary + * distribution the "Copyright Notice" refers to the following language: + * "Copyright (c) Japan Network Information Center. All rights reserved." + * + * 4. Neither the name of JPNIC may be used to endorse or promote products + * derived from this Software without specific prior written approval of + * JPNIC. + * + * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * 6. Indemnification by Licensee + * Any person or entities using and/or redistributing this Software under + * this License Terms and Conditions shall defend indemnify and hold + * harmless JPNIC from and against any and all judgements damages, + * expenses, settlement liabilities, cost and other liabilities of any + * kind as a result of use and redistribution of this Software or any + * claim, suite, action, litigation or proceeding by any third party + * arising out of or relates to this License Terms and Conditions. + * + * 7. Governing Law, Jurisdiction and Venue + * This License Terms and Conditions shall be governed by and and + * construed in accordance with the law of Japan. Any person or entities + * using and/or redistributing this Software under this License Terms and + * Conditions hereby agrees and consent to the personal and exclusive + * jurisdiction and venue of Tokyo District Court of Japan. + */ + + #include "nsIDNService.h" + + #include "nsMemory.h" + #include "nsError.h" + #include "nsCOMPtr.h" + #include "plstr.h" + + extern "C" { + #include + #include + #include + } + + /****************************************************************************** + * Platform specific defines and includes + *****************************************************************************/ + + /** + * XP_MAC + */ + + /** + * XP_UNIX + */ + + /** + * XP_WIN + */ + + + /****************************************************************************** + * nsIDNService + *****************************************************************************/ + + NS_IMPL_ISUPPORTS1_CI(nsIDNService, nsIIDNService); + + nsIDNService::nsIDNService() + { + NS_INIT_ISUPPORTS(); + } + + nsIDNService::~nsIDNService() + { + } + + NS_IMETHODIMP + nsIDNService::UTF8ToIDNHostName(const char *utf8, char **idn) + { + NS_ENSURE_ARG_POINTER(idn); + + char *buf = NULL; + PRUint32 utf8len = PL_strlen(utf8); + PRUint32 bufsize = utf8len * 4 + 8; // usually large enough + // (+8 for ACE prefix and NUL) + *idn = NULL; + + for (;;) { + char *newbuf = (char *) realloc(buf, bufsize); + + if (newbuf == NULL) + return NS_ERROR_OUT_OF_MEMORY; + buf = newbuf; + + mdn_result_t r = mdn_encodename(MDN_ENCODE_APP, utf8, buf, bufsize); + if (r == mdn_success) + break; + else if (r != mdn_buffer_overflow) { + PL_strcpy(buf, utf8); + break; + } + bufsize += utf8len; + } + + *idn = buf; + return NS_OK; + } *** /dev/null Thu Jan 31 12:01:19 2002 --- xpcom/idn/nsIDNService.h Wed Jan 30 14:45:36 2002 *************** *** 0 **** --- 1,88 ---- + /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* + * Copyright (c) 2002 Japan Network Information Center. All rights reserved. + * + * By using this file, you agree to the terms and conditions set forth bellow. + * + * LICENSE TERMS AND CONDITIONS + * + * The following License Terms and Conditions apply, unless a different + * license is obtained from Japan Network Information Center ("JPNIC"), + * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, + * Chiyoda-ku, Tokyo 101-0047, Japan. + * + * 1. Use, Modification and Redistribution (including distribution of any + * modified or derived work) in source and/or binary forms is permitted + * under this License Terms and Conditions. + * + * 2. Redistribution of source code must retain the copyright notices as they + * appear in each source code file, this License Terms and Conditions. + * + * 3. Redistribution in binary form must reproduce the Copyright Notice, + * this License Terms and Conditions, in the documentation and/or other + * materials provided with the distribution. For the purposes of binary + * distribution the "Copyright Notice" refers to the following language: + * "Copyright (c) Japan Network Information Center. All rights reserved." + * + * 4. Neither the name of JPNIC may be used to endorse or promote products + * derived from this Software without specific prior written approval of + * JPNIC. + * + * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * 6. Indemnification by Licensee + * Any person or entities using and/or redistributing this Software under + * this License Terms and Conditions shall defend indemnify and hold + * harmless JPNIC from and against any and all judgements damages, + * expenses, settlement liabilities, cost and other liabilities of any + * kind as a result of use and redistribution of this Software or any + * claim, suite, action, litigation or proceeding by any third party + * arising out of or relates to this License Terms and Conditions. + * + * 7. Governing Law, Jurisdiction and Venue + * This License Terms and Conditions shall be governed by and and + * construed in accordance with the law of Japan. Any person or entities + * using and/or redistributing this Software under this License Terms and + * Conditions hereby agrees and consent to the personal and exclusive + * jurisdiction and venue of Tokyo District Court of Japan. + */ + + #ifndef nsIDNService_h__ + #define nsIDNService_h__ + + #include "nsIIDNService.h" + #include "nsCOMPtr.h" + + #define NS_IDNSERVICE_CID \ + { /* 468C5EEA-1DC3-45c6-87AB-2992D03BB3A2 */ \ + 0x468c5eea, \ + 0x1dc3, \ + 0x45c6, \ + {0x87, 0xab, 0x29, 0x92, 0xd0, 0x3b, 0xb3, 0xa2} \ + } + + /****************************************************************************** + * nsIDNService + *****************************************************************************/ + class nsIDNService : public nsIIDNService + { + public: + NS_DECL_ISUPPORTS + NS_DECL_NSIIDNSERVICE + + // nsIDNService methods: + nsIDNService(); + virtual ~nsIDNService(); + }; + + #endif /* nsIDNService_h__ */ *** /dev/null Thu Jan 31 12:01:19 2002 --- xpcom/idn/nsIDNServiceModule.cpp Wed Jan 30 14:42:59 2002 *************** *** 0 **** --- 1,83 ---- + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* + * Copyright (c) 2002 Japan Network Information Center. All rights reserved. + * + * By using this file, you agree to the terms and conditions set forth bellow. + * + * LICENSE TERMS AND CONDITIONS + * + * The following License Terms and Conditions apply, unless a different + * license is obtained from Japan Network Information Center ("JPNIC"), + * a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, + * Chiyoda-ku, Tokyo 101-0047, Japan. + * + * 1. Use, Modification and Redistribution (including distribution of any + * modified or derived work) in source and/or binary forms is permitted + * under this License Terms and Conditions. + * + * 2. Redistribution of source code must retain the copyright notices as they + * appear in each source code file, this License Terms and Conditions. + * + * 3. Redistribution in binary form must reproduce the Copyright Notice, + * this License Terms and Conditions, in the documentation and/or other + * materials provided with the distribution. For the purposes of binary + * distribution the "Copyright Notice" refers to the following language: + * "Copyright (c) Japan Network Information Center. All rights reserved." + * + * 4. Neither the name of JPNIC may be used to endorse or promote products + * derived from this Software without specific prior written approval of + * JPNIC. + * + * 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * 6. Indemnification by Licensee + * Any person or entities using and/or redistributing this Software under + * this License Terms and Conditions shall defend indemnify and hold + * harmless JPNIC from and against any and all judgements damages, + * expenses, settlement liabilities, cost and other liabilities of any + * kind as a result of use and redistribution of this Software or any + * claim, suite, action, litigation or proceeding by any third party + * arising out of or relates to this License Terms and Conditions. + * + * 7. Governing Law, Jurisdiction and Venue + * This License Terms and Conditions shall be governed by and and + * construed in accordance with the law of Japan. Any person or entities + * using and/or redistributing this Software under this License Terms and + * Conditions hereby agrees and consent to the personal and exclusive + * jurisdiction and venue of Tokyo District Court of Japan. + */ + #include "nsIGenericFactory.h" + + #include "nsIDNService.h" + #include "nsNetCID.h" + + NS_GENERIC_FACTORY_CONSTRUCTOR(nsIDNService) + + NS_DECL_CLASSINFO(nsIDNService) + + static nsModuleComponentInfo components[] = + { + { "IDN Service", + NS_IDNSERVICE_CID, + NS_IDNSERVICE_CONTRACTID, + nsIDNServiceConstructor, + NULL, + NULL, + NULL, + NS_CI_INTERFACE_GETTER_NAME(nsIDNService), + NULL, + &NS_CLASSINFO_NAME(nsIDNService) + } + }; + + NS_IMPL_NSGETMODULE(nsIDNServiceModule, components)