[ooo-build-commit] Branch 'ooo/master' - 3 commits - berkeleydb/makefile.mk cairo/cairo curl/makefile.mk icu/icu-4.0.patch icu/makefile.mk libxml2/libxml2-2.6.31-mingw.patch libxml2/libxml2-2.6.31.patch libxml2/makefile.mk libxslt/makefile.mk moz/extractfiles.mk moz/prj moz/README moz/zipped nss/download nss/makefile.mk nss/nss_3_12_3.patch nss/nss_3_12_3.patch.mingw nss/prj nss/readme.txt python/makefile.mk python/Python-2.6.1-mingw.patch

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Aug 27 18:22:35 PDT 2009


 berkeleydb/makefile.mk             |   10 --
 cairo/cairo/makefile.mk            |   11 ++
 curl/makefile.mk                   |   10 +-
 icu/icu-4.0.patch                  |   13 ++
 icu/makefile.mk                    |   13 ++
 libxml2/libxml2-2.6.31-mingw.patch |   13 ++
 libxml2/libxml2-2.6.31.patch       |  128 ++++++++++++++++++++++++++
 libxml2/makefile.mk                |   11 ++
 libxslt/makefile.mk                |   10 +-
 moz/README                         |    4 
 moz/extractfiles.mk                |  132 +++++++++++++++++++++++++--
 moz/prj/build.lst                  |    2 
 moz/zipped/makefile.mk             |  119 ++++++++++++++++++++++++
 nss/download/nss_3_12_3.tar.gz     |binary
 nss/makefile.mk                    |  179 +++++++++++++++++++++++++++++++++++++
 nss/nss_3_12_3.patch               |  131 +++++++++++++++++++++++++++
 nss/nss_3_12_3.patch.mingw         |  166 ++++++++++++++++++++++++++++++++++
 nss/prj/build.lst                  |    3 
 nss/prj/d.lst                      |   10 ++
 nss/readme.txt                     |   56 +++++++++++
 python/Python-2.6.1-mingw.patch    |    6 +
 python/makefile.mk                 |    3 
 22 files changed, 1003 insertions(+), 27 deletions(-)

New commits:
commit 1e523de71948d12d1cddf49f2d7f672d5e4837c1
Author: Vladimir Glazounov <vg at openoffice.org>
Date:   Thu Aug 27 15:58:22 2009 +0000

    CWS-TOOLING: integrate CWS sb114_DEV300
    2009-08-12 09:02:01 +0200 sb  r274880 : #i104149# missing PATCH flag
    2009-08-11 16:39:16 +0200 sb  r274864 : #i104149# merged in difference between <http://ftp.debian.org/debian/pool/main/libx/libxml2/libxml2_2.6.32.dfsg-5.diff.gz> and <http://security.debian.org/pool/updates/main/libx/libxml2/libxml2_2.6.32.dfsg-5+lenny1.diff.gz> (which appears to also apply cleanly to the libxml2 2.6.31 source base checked into OOo)

diff --git a/libxml2/libxml2-2.6.31.patch b/libxml2/libxml2-2.6.31.patch
index 53f35c1..cba8f23 100644
--- a/libxml2/libxml2-2.6.31.patch
+++ b/libxml2/libxml2-2.6.31.patch
@@ -282,3 +282,131 @@
   #define LIBXML_DEBUG_RUNTIME
   #endif
   
+diff -r -cN misc/libxml2-2.6.31/changelog misc/build/libxml2-2.6.31/changelog
+*** misc/libxml2-2.6.31/changelog
+--- misc/build/libxml2-2.6.31/changelog
+***************
+*** 0 ****
+--- 1,10 ----
++ libxml2 (2.6.32.dfsg-5+lenny1) stable-security; urgency=high
++ 
++   * Non-maintainer upload by the Security Team.
++   * Fix multiple use-after-free flaws when parsing notation and
++     enumeration attribute types (CVE-2009-2416).
++   * Fix stack overflow when parsing root XML document element DTD
++     definition (CVE-2009-2414).
++ 
++  -- Nico Golde <nion at debian.org>  Thu, 06 Aug 2009 13:04:00 +0000
++ 
+diff -r -cN misc/libxml2-2.6.31/parser.c misc/build/libxml2-2.6.31/parser.c
+*** misc/libxml2-2.6.31/parser.c
+--- misc/build/libxml2-2.6.31/parser.c
+***************
+*** 4752,4761 ****
+  	if (name == NULL) {
+  	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+  			   "Name expected in NOTATION declaration\n");
+! 	    return(ret);
+  	}
+  	cur = xmlCreateEnumeration(name);
+! 	if (cur == NULL) return(ret);
+  	if (last == NULL) ret = last = cur;
+  	else {
+  	    last->next = cur;
+--- 4752,4766 ----
+  	if (name == NULL) {
+  	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+  			   "Name expected in NOTATION declaration\n");
+! 	    xmlFreeEnumeration(ret);
+! 	    return(NULL);
+  	}
+  	cur = xmlCreateEnumeration(name);
+!         if (cur == NULL) {
+!              xmlFreeEnumeration(ret);
+!              return(NULL);
+!          }
+! 
+  	if (last == NULL) ret = last = cur;
+  	else {
+  	    last->next = cur;
+***************
+*** 4765,4773 ****
+      } while (RAW == '|');
+      if (RAW != ')') {
+  	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
+! 	if ((last != NULL) && (last != ret))
+! 	    xmlFreeEnumeration(last);
+! 	return(ret);
+      }
+      NEXT;
+      return(ret);
+--- 4770,4777 ----
+      } while (RAW == '|');
+      if (RAW != ')') {
+  	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
+!         xmlFreeEnumeration(ret);
+!         return(NULL);
+      }
+      NEXT;
+      return(ret);
+***************
+*** 4808,4814 ****
+  	}
+  	cur = xmlCreateEnumeration(name);
+  	xmlFree(name);
+! 	if (cur == NULL) return(ret);
+  	if (last == NULL) ret = last = cur;
+  	else {
+  	    last->next = cur;
+--- 4812,4822 ----
+  	}
+  	cur = xmlCreateEnumeration(name);
+  	xmlFree(name);
+!         if (cur == NULL) {
+!              xmlFreeEnumeration(ret);
+!              return(NULL);
+!          }
+! 
+  	if (last == NULL) ret = last = cur;
+  	else {
+  	    last->next = cur;
+***************
+*** 5206,5211 ****
+--- 5214,5226 ----
+      const xmlChar *elem;
+      xmlChar type = 0;
+  
++     if (ctxt->depth > 128) {
++         xmlFatalErrMsgInt(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED,
++                 "xmlParseElementChildrenContentDecl : depth %d too deep\n",
++                           ctxt->depth);
++        return(NULL);
++     }
++ 
+      SKIP_BLANKS;
+      GROW;
+      if (RAW == '(') {
+***************
+*** 5214,5220 ****
+--- 5229,5237 ----
+          /* Recurse on first child */
+  	NEXT;
+  	SKIP_BLANKS;
++ 	ctxt->depth++;
+          cur = ret = xmlParseElementChildrenContentDecl(ctxt, inputid);
++ 	ctxt->depth--;
+  	SKIP_BLANKS;
+  	GROW;
+      } else {
+***************
+*** 5344,5350 ****
+--- 5361,5369 ----
+  	    /* Recurse on second child */
+  	    NEXT;
+  	    SKIP_BLANKS;
++ 	    ctxt->depth++;
+  	    last = xmlParseElementChildrenContentDecl(ctxt, inputid);
++ 	    ctxt->depth--;
+  	    SKIP_BLANKS;
+  	} else {
+  	    elem = xmlParseName(ctxt);
commit 258cc6f9fe022df1fd232778c4c71ae5a7945ac2
Author: Release Engineers <releng at openoffice.org>
Date:   Wed Aug 26 08:22:01 2009 +0000

    CWS-TOOLING: integrate CWS jl127
    2009-07-30 10:12:10 +0200 jl  r274470 : #i100873# switch on checking for symbol definitions. It works with the current xpcom lib.
    2009-07-29 09:48:29 +0200 jl  r274443 : #i100873#
    2009-07-29 09:47:36 +0200 jl  r274442 : #i100873# changes after resync with DEV300m53 which contains the seamonkey update
    2009-07-28 10:00:03 +0200 jl  r274389 : #100873# Patches from tono
    2009-07-27 16:59:39 +0200 jl  r274372 : CWS-TOOLING: rebase CWS jl127 to trunk at 274203 (milestone: DEV300:m53)
    2009-07-07 09:08:53 +0200 jl  r273768 : #100873#
    2009-07-06 17:16:10 +0200 jl  r273754 : #100873#
    2009-07-01 13:58:09 +0200 jl  r273576 : #100873# added to readme
    2009-07-01 13:15:02 +0200 jl  r273573 : #100873# deliver lib files when building with MS compiler
    2009-06-30 11:22:06 +0200 jl  r273498 : #i100873# accidentally commented out patch_files
    2009-06-30 09:01:10 +0200 jl  r273489 : #100873# make rc.exe work in ooo windows build
    2009-06-29 09:47:56 +0200 jl  r273451 : #i100873# applied mingw patch from tono
    2009-06-24 12:52:14 +0200 jl  r273332 : #100873# reapplying the configure.in patch on version 273150
    2009-06-24 12:51:12 +0200 jl  r273331 : #100873# reapplying the patch on version 273150
    2009-06-23 17:17:36 +0200 jl  r273299 : #100873# manually modified patch from tono
    2009-06-22 17:05:41 +0200 jl  r273243 : #100873# applying mingw patch from tono
    2009-06-22 17:02:30 +0200 jl  r273242 : #100873# applying mingw patch from tono
    2009-06-22 12:49:57 +0200 jl  r273216 : #100873# dependency to stlport
    2009-06-19 11:56:16 +0200 jl  r273155 : #100873# undoing a previous change, instset_native complained about missing libjpipe.jnilib (jurt)
    2009-06-19 10:13:03 +0200 jl  r273150 : #100873# ooo builds shall also use the new nss by default
    2009-06-18 14:32:07 +0200 jl  r273117 : #110873# more debug output when verifying a certificate
    2009-06-16 11:23:50 +0200 jl  r273012 : #i10873#
    2009-06-16 10:57:41 +0200 jl  r273011 : #100873# wrong parameter definition in nsscrypto_initialize
    2009-06-16 10:56:45 +0200 jl  r273010 : #100873# wrong parameter definition in nsscrypto_initialize
    2009-06-15 16:20:42 +0200 jl  r272996 : #100873# initialization of NSS is now threadsafe
    2009-06-10 12:50:46 +0200 jl  r272804 : #100873# rename in foreach fails in 4nt
    2009-06-09 13:43:00 +0200 jl  r272768 : #i100873# deliver only .h from inc/nss otherwise we get a warning when nss/nssck.api is delivered
    2009-06-08 16:15:44 +0200 jl  r272739 : #i100873#
    2009-06-08 16:04:54 +0200 jl  r272738 : #i100873#
    2009-06-08 15:45:52 +0200 jl  r272736 : #i100873#
    2009-06-08 15:44:15 +0200 jl  r272735 : #i100873# unzipping of nss.tar.z not working with 4nt
    2009-06-08 09:45:46 +0200 jl  r272720 : #i100873#
    2009-06-03 13:53:52 +0200 jl  r272562 : #i100873#  MOZILLABUILD not correct
    2009-06-03 13:17:54 +0200 jl  r272557 : #i100873#  readme and makefile changes from cws jl125, support of new nss module
    2009-06-03 09:57:40 +0200 jl  r272544 : #i100873#  added readme
    2009-06-02 16:47:47 +0200 jl  r272512 : #i100873#  removed no longer needed stuff regarding jnilibs
    2009-06-02 15:54:42 +0200 jl  r272510 : #i100873# added NSS to BUILD_TYPE
    2009-06-02 15:20:18 +0200 jl  r272508 : #i100873# DEREFERENCE option for copy command
    2009-06-02 13:00:12 +0200 jl  r272496 : #i100873# PATCH_FILE_NAMES is now PATCH_FILES
    2009-06-02 12:23:39 +0200 jl  r272494 : #i100873# build dependency to nss
    2009-05-29 16:21:40 +0200 jl  r272470 : #i100873# seting ENABLE_NSS_MODULE==YES and includeing mozilla-build-1.3 folder in environment
    2009-05-29 16:03:23 +0200 jl  r272468 : #i100873# use intermediate certificates when validating a certificate
    2009-05-29 15:57:16 +0200 jl  r272466 : #i100873# use intermediate certificates when validating a certificate
    2009-05-29 15:49:58 +0200 jl  r272464 : #i100873# using ENABLE_NSS_MODULE
    2009-05-29 15:33:14 +0200 jl  r272463 : #i100873# using ENABLE_NSS_MODULE
    2009-05-29 15:28:39 +0200 jl  r272461 : #i100873# build dependency to nss module
    2009-05-29 15:24:57 +0200 jl  r272460 : #i100873# pass additional certificates into verifyCertificate function
    2009-05-29 14:49:40 +0200 jl  r272458 : #i100873# new NSS module
    2009-05-29 14:43:44 +0200 jl  r272457 : #i100873# new NSS module

diff --git a/moz/README b/moz/README
new file mode 100755
index 0000000..6b1d0a2
--- /dev/null
+++ b/moz/README
@@ -0,0 +1,4 @@
+Rebuild moz whenever changes have been made in the nss module. Those libs are
+merged into mozruntime.zip which is build in this project.
+
+Please read nss/readme.txt !!!
\ No newline at end of file
diff --git a/moz/extractfiles.mk b/moz/extractfiles.mk
index d702762..654cbc8 100644
--- a/moz/extractfiles.mk
+++ b/moz/extractfiles.mk
@@ -36,6 +36,46 @@ RUNTIME_DIR=$(MISC)$/$(MOZTARGET)runtime
 LIB_DIR=$(LB)
 INCLUDE_DIR=$(INCCOM)
 
+
+
+#If we build the NSS module then we do not need the old nss libs from here
+.IF "$(ENABLE_NSS_MODULE)"=="YES"
+
+
+.IF "$(OS)" == "SOLARIS" 
+.IF "$(CPU)" == "S" #32bit
+FREEBL_LIB=freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
+.ELIF "$(CPU)" == "U" #64bit unxsolu4
+FREEBL_LIB=freebl_64int_3 freebl_64fpu_3
+.ELSE
+FREEBL_LIB=freebl3
+.ENDIF #"$(CPU)" == "S"
+
+.ELSE # "$(OS)" == "SOLARIS" 
+FREEBL_LIB=freebl3
+.ENDIF # "$(OS)" == "SOLARIS" 
+
+
+NSS_MODULE_RUNTIME_LIST:= \
+    $(FREEBL_LIB) \
+    nspr4 \
+    nss3 \
+    nssckbi \
+    nssdbm3 \
+    nssutil3 \
+    plc4 \
+    plds4 \
+    smime3 \
+    softokn3 \
+    sqlite3 \
+    ssl3
+
+BIN_RUNTIMELIST= \
+    xpcom \
+    xpcom_core \
+    xpcom_compat	
+.ELSE
+
 .IF "$(GUI)" == "WNT"
     FREEBL_LIB=freebl3
 .ELSE # "$(GUI)" == "WNT"
@@ -46,6 +86,7 @@ INCLUDE_DIR=$(INCCOM)
     .ENDIF # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
 .ENDIF # "$(GUI)" == "WNT"
 
+
 BIN_RUNTIMELIST=	\
     nspr4	\
     plc4	\
@@ -58,7 +99,8 @@ BIN_RUNTIMELIST=	\
     softokn3	\
     smime3 \
     $(FREEBL_LIB)
-    
+.ENDIF #  "$(ENABLE_NSS_MODULE)"=="YES"
+
 .IF "$(GUI)"=="WNT"
 BIN_RUNTIMELIST+=	\
     js3250 	\
@@ -87,7 +129,7 @@ COMPONENT_RUNTIMELIST=	\
     vcard	\
     i18n 	\
     pipnss
-    
+
 .IF "$(GUI)"=="WNT"
 COMPONENT_RUNTIMELIST+=	\
     xppref32	\
@@ -126,8 +168,52 @@ DEFAULTS_RUNTIMELIST=	\
     greprefs$/all.js	\
     greprefs$/security-prefs.js
 
+.IF "$(ENABLE_NSS_MODULE)"=="YES"
+#These headers come from the separate NSS module if enabled
+NSS_INCLUDE_LIST= nspr nss
+
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+
+
+LIBLIST=        \
+        libembed_base_s.a \
+        libmozreg_s.a \
+        libnslber32v50.a \
+        libnsldap32v50.a \
+    libxpcom_core.dll.a \
+        libxpcom.dll.a 
+
+.ELSE #"$(COM)"=="GCC"
+
+LIBLIST=        \
+        embed_base_s.lib \
+        mozreg_s.lib \
+        nslber32v50.lib \
+        nsldap32v50.lib \
+    xpcom_core.lib	\
+        xpcom.lib 
+
+.ENDIF #"$(COM)"=="GCC"
+
+.ELSE   #"$(GUI)"=="WNT"
+
+LIBLIST=        \
+        libembed_base_s.a \
+        libmozreg_s.a \
+        liblber50.a \
+    libxpcom_core$(DLLPOST)	\
+        libxpcom$(DLLPOST)      \
+        libmsgbaseutil$(DLLPOST)        \
+        libldap50$(DLLPOST) \
+
+.ENDIF
+
+.ELSE # .IF"$(ENABLE_NSS_MODULE)"=="YES"
+
 .IF "$(GUI)"=="WNT"
 .IF "$(COM)"=="GCC"
+
 LIBLIST=	\
     libembed_base_s.a	\
     libmozreg_s.a	\
@@ -138,7 +224,9 @@ LIBLIST=	\
     libxpcom.dll.a	\
     libnss3.a	\
     libsmime3.a
+
 .ELSE
+
 LIBLIST=	\
     embed_base_s.lib	\
     mozreg_s.lib	\
@@ -152,8 +240,11 @@ LIBLIST=	\
     nss3.lib	\
     ssl3.lib	\
     smime3.lib
+
 .ENDIF
-.ELSE	#"$(GUI)"=="WNT"
+
+.ELSE   #"$(GUI)"=="WNT"
+
 LIBLIST=	\
     libembed_base_s.a	\
     libmozreg_s.a	\
@@ -169,7 +260,9 @@ LIBLIST=	\
     libnss3$(DLLPOST)	\
     libssl3$(DLLPOST)	\
     libsmime3$(DLLPOST)
+
 .ENDIF
+.ENDIF # .IF "$(ENABLE_NSS_MODULE)"=="YES"
 
 INCLUDE_PATH=$(MOZ_DIST_DIR)$/include$/
 PUBLIC_PATH=$(MOZ_DIST_DIR)$/public$/
@@ -188,7 +281,7 @@ extract_mozab_files:	$(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) \
     $(MISC)$/build$/so_moz_runtime_files	\
     $(MISC)$/build$/so_moz_include_files	\
     $(MISC)$/build$/so_moz_lib_files
-    
+
 make_temp_dir:
     @@-$(MKDIR)	$(RUNTIME_DIR)
     @@-$(MKDIR)	$(RUNTIME_DIR)$/components
@@ -212,7 +305,21 @@ $(MISC)$/build$/so_moz_runtime_files: 	$(OUT)$/bin$/mozruntime.zip
     $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \
     $(LIB_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
     echo >& $(NULLDEV)
+.IF "$(ENABLE_NSS_MODULE)" == "YES"
+# We add the libraries from the separate nss module
+    $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(DLLPRE)$(file)$(DLLPOST) \
+    $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
+    echo >& $(NULLDEV)
 .ENDIF
+.ELSE # .IF "$(GUI)" == "UNX"
+.IF "$(ENABLE_NSS_MODULE)" == "YES"
+# We add the libraries from the separate nss module
+    $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARBINDIR)$/$(DLLPRE)$(file)$(DLLPOST) \
+    $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \
+    echo >& $(NULLDEV)
+.ENDIF
+.ENDIF # .IF "$(GUI)" == "UNX"
+
 
 # copy files in RES_FILELIST
 .IF "$(OS)"=="SOLARIS"
@@ -275,12 +382,13 @@ $(MISC)$/build$/so_moz_runtime_files: 	$(OUT)$/bin$/mozruntime.zip
 
 # zip runtime files to mozruntime.zip
     cd $(RUNTIME_DIR) && zip -r ..$/..$/bin$/mozruntime.zip *
-    
+
     $(TOUCH) $@
 
 $(INCCOM)$/nsBuildID.h: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 
     @-echo "You can delete $(INCCOM) to force it copy all include files again."
-    
+
+
 $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h
 .IF "$(USE_SHELL)"=="4nt"
     $(COPY) /QSZ $(INCLUDE_PATH)* $(INCLUDE_DIR)
@@ -299,6 +407,13 @@ $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h
     chmod -R 775 $(INCCOM)
 .ENDIF
     $(TOUCH) $@
+.IF "$(ENABLE_NSS_MODULE)"=="YES"
+        +$(foreach,dir,$(NSS_INCLUDE_LIST) $(RENAME:s/+//) $(INCLUDE_DIR)$/$(dir) \
+    $(INCLUDE_DIR)$/$(dir)_remove_me &&) \
+        echo >& $(NULLDEV)
+        $(foreach,dir,$(NSS_INCLUDE_LIST) rm -r -f $(INCLUDE_DIR)$/$(dir)_remove_me &&) \
+        echo >& $(NULLDEV)
+.ENDIF
 
 # On UNX the rules for so_moz_runtime_files copy files into the same directory
 # used here (LIB_DIR), and on MACOSX all those files together need to be
@@ -316,13 +431,13 @@ $(MISC)$/build$/so_moz_lib_files:		$(foreach,file,$(LIBLIST) $(LIB_DIR)$/$(file)
     chmod -R 775 $(LB)
 .ENDIF
     $(TOUCH) $@
-    
+
 $(BIN_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 
     @$(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/$(DLLPRE)$@$(DLLPOST)
 
 $(COMPONENT_RUNTIMELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 
     @$(COPY) $(MOZ_BIN_DIR)$/components$/$(DLLPRE)$@$(DLLPOST) $(RUNTIME_DIR)$/components$/$(DLLPRE)$@$(DLLPOST)
-    
+
 $(COMREGISTRY_FILELIST): $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 
     @$(COPY) $(MOZ_BIN_DIR)$/components$/$@ $(RUNTIME_DIR)$/components$/$@
 
@@ -336,7 +451,6 @@ RES_FILELIST: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
     @echo No Res Files to copy.
 .ENDIF
 
-    
 $(LIB_DIR)$/%: $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
     noop
 
diff --git a/moz/prj/build.lst b/moz/prj/build.lst
index f5593fa..717c309 100644
--- a/moz/prj/build.lst
+++ b/moz/prj/build.lst
@@ -1,4 +1,4 @@
-moz	moz : solenv SO:so_prereq NULL
+moz	moz : solenv SO:so_prereq NSS:nss NULL
 moz	moz				usr1	-	all	moz_mkout NULL
 moz	moz				nmake	-	all	moz_mozilla     NULL
 moz	moz\zipped			nmake	-	all	moz_zipped	moz_mozilla NULL
diff --git a/moz/zipped/makefile.mk b/moz/zipped/makefile.mk
index 9015bed..400b576 100644
--- a/moz/zipped/makefile.mk
+++ b/moz/zipped/makefile.mk
@@ -55,7 +55,8 @@ ALLTAR:
 ALLTAR: \
     $(MISC)$/unpacked_$(TARGET)_inc \
     $(MISC)$/unpacked_$(TARGET)_lib \
-    $(BIN)$/mozruntime.zip
+    $(BIN)$/mozruntime.zip \
+    $(MISC)$/replace_old_nss_libs
 .ENDIF
 .IF "$(GUI)" == "UNX"
 
@@ -81,6 +82,120 @@ $(MISC)$/unpacked_$(TARGET)_inc : $(OS)$(COM)$(CPU)inc.zip
 $(BIN)$/mozruntime.zip : $(OS)$(COM)$(CPU)runtime.zip
     $(COPY) $(OS)$(COM)$(CPU)runtime.zip $(BIN)$/mozruntime.zip
 
+LIBLIST =
+BIN_RUNTIMELIST = 
+NSS_INCLUDE_LIST =
+NSS_MODULE_RUNTIME_LIST =
+
+.IF "$(ENABLE_NSS_MODULE)"=="YES"
+# The prebuilt moz files include all the old NSS stuff from moz and not the new
+# NSS libs, headers, etc, from the separate nss module. If we use the nss module
+# then we must take care not to deliver the old NSS stuff from the "prebuilts"
+.IF "$(GUI)" == "WNT"
+    FREEBL_LIB_OLD=freebl3
+.ELSE # "$(GUI)" == "WNT"
+    .IF "$(OS)$(CPUNAME)" == "SOLARISSPARC"
+        FREEBL_LIB_OLD=freebl_32fpu_3
+    .ELSE # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
+        FREEBL_LIB_OLD=freebl3
+    .ENDIF # "$(OS)$(CPUNAME)" == "SOLARISSPARC"
+.ENDIF # "$(GUI)" == "WNT"
+
+BIN_RUNTIMELIST= \
+    $(FREEBL_LIB_OLD) \
+    nspr4 \
+    plc4 \
+    plds4 \
+    nss3 \
+    ssl3 \
+    softokn3 \
+    smime3
+
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+LIBLIST= \
+    libnspr4.a \
+    libnss3.a \
+    libsmime3.a \
+    libplc4.a \
+    libplds4.a \
+    libssl3.a
 
-.ENDIF	 # unpack mozab zips
+.ELSE
+LIBLIST= \
+    nspr4.lib \
+    plc4.lib \
+    plds4.lib \
+    nss3.lib \
+    ssl3.lib\
+    smime3.lib
+.ENDIF
+.ELSE   #"$(GUI)"=="WNT"
+LIBLIST= \
+    lib$(FREEBL_LIB_OLD)$(DLLPOST) \
+    libnspr4$(DLLPOST) \
+    libsoftokn3$(DLLPOST) \
+    libplc4$(DLLPOST) \
+    libplds4$(DLLPOST) \
+    libnss3$(DLLPOST) \
+    libssl3$(DLLPOST) \
+    libsmime3$(DLLPOST)
+
+.ENDIF # .IF "$(GUI)"=="WNT"
+
+
+NSS_INCLUDE_LIST= nspr nss
+
+
+.IF "$(OS)" == "SOLARIS" 
+.IF "$(CPU)" == "S" #32bit
+FREEBL=freebl_32fpu_3 freebl_32int64_3 freebl_32int_3
+.ELIF "$(CPU)" == "U" #64bit unxsolu4
+FREEBL=freebl_64int_3 freebl_64fpu_3
+.ELSE
+FREEBL=freebl3
+.ENDIF #"$(CPU)" == "S"
+
+.ELSE # "$(OS)" == "SOLARIS" 
+FREEBL=freebl3
+.ENDIF # "$(OS)" == "SOLARIS" 
+
+
+NSS_MODULE_RUNTIME_LIST:= \
+    $(FREEBL) \
+    nspr4 \
+    nss3 \
+    nssckbi \
+    nssdbm3 \
+    nssutil3 \
+    plc4 \
+    plds4 \
+    smime3 \
+    softokn3 \
+    sqlite3 \
+    ssl3
+
+
+.ENDIF #.IF "$(ENABLE_NSS_MODULE)"=="YES"
+# Remove the nss libs build in moz and those build in the nss module
+$(MISC)$/replace_old_nss_libs : $(MISC)$/unpacked_$(TARGET)_lib \
+$(MISC)$/unpacked_$(TARGET)_inc $(BIN)$/mozruntime.zip
+    +$(foreach,dir,$(NSS_INCLUDE_LIST) $(RENAME:s/+//) $(INCCOM)$/$(dir) \
+    $(INCCOM)$/$(dir)_remove_me &&)  echo >& $(NULLDEV)
+    $(foreach,dir,$(NSS_INCLUDE_LIST) rm -r -f $(INCCOM)$/$(dir)_remove_me &&) \
+        echo >& $(NULLDEV)
+    $(foreach,lib,$(LIBLIST) rm -f $(LB)$/$(lib) &&) \
+    echo >& $(NULLDEV)
+    $(foreach,lib,$(BIN_RUNTIMELIST) zip -d $(BIN)$/mozruntime.zip $(DLLPRE)$(lib)$(DLLPOST) &&) \
+    echo >& $(NULLDEV)
+.IF "$(GUI)"=="WNT"
+    $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARBINDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \
+    echo >& $(NULLDEV)
+.ELSE
+    $(foreach,lib,$(NSS_MODULE_RUNTIME_LIST) zip -g -j $(BIN)$/mozruntime.zip $(SOLARLIBDIR)$/$(DLLPRE)$(lib)$(DLLPOST) &&) \
+    echo >& $(NULLDEV)
+.ENDIF
+    $(TOUCH) $@     
+
+.ENDIF   # unpack mozab zips
 
diff --git a/nss/download/nss_3_12_3.tar.gz b/nss/download/nss_3_12_3.tar.gz
new file mode 100644
index 0000000..416c663
Binary files /dev/null and b/nss/download/nss_3_12_3.tar.gz differ
diff --git a/nss/makefile.mk b/nss/makefile.mk
new file mode 100644
index 0000000..06881d3
--- /dev/null
+++ b/nss/makefile.mk
@@ -0,0 +1,179 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.48 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=.
+
+PRJNAME=nss
+TARGET=nss
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE :	settings.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(ENABLE_NSS_MODULE)"!="YES"
+all:
+    @echo "NSS will not be built. ENABLE_NSS_MODULE is '$(ENABLE_NSS_MODULE)'"
+.ENDIF	
+
+TARFILE_NAME=nss_3_12_3
+TARFILE_ROOTDIR=mozilla
+PATCH_FILES=nss_3_12_3.patch
+
+.IF "$(debug)" != ""
+.ELSE
+BUILD_OPT=1
+.EXPORT: BUILD_OPT
+.ENDIF
+
+
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)$(COM)"=="LINUXGCC"
+#LDFLAGS:=-Wl,-rpath,'$$$$ORIGIN'
+.EXPORT: LDFLAGS
+
+.IF "$(CPU)"=="X"
+# force 64-bit buildmode
+USE_64:=1
+.EXPORT : USE_64
+.ENDIF			# "$(CPU)"=="X"
+.ENDIF                  # "$(OS)$(COM)"=="LINUXGCC"
+
+
+.IF "$(OS)"=="MACOSX"
+.IF "$(EXTRA_CFLAGS)"!=""
+CPP:=gcc -E $(EXTRA_CFLAGS)
+CXX:=g++ $(EXTRA_CFLAGS)
+CC:=gcc $(EXTRA_CFLAGS)
+.EXPORT : CPP
+.ENDIF # "$(EXTRA_CFLAGS)"!=""
+.ENDIF # "$(OS)"=="MACOSX"
+
+OUT2LIB=dist$/out$/lib$/*$(DLLPOST)
+
+BUILD_DIR=security$/nss
+BUILD_ACTION= $(GNUMAKE) nss_build_all
+
+.ENDIF			# "$(GUI)"=="UNX"
+
+
+.IF "$(GUI)"=="WNT"
+
+.IF "$(COM)"=="GCC"
+
+PATCH_FILES+=nss_3_12_3.patch.mingw
+
+moz_build:=$(shell cygpath -p $(MOZILLABUILD))
+PATH!:=$(moz_build)/bin:$(PATH)
+
+nss_CC=$(CC)
+nss_CXX=$(CXX)
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+nss_CC+=-shared-libgcc
+nss_CXX+=-shared-libgcc
+.ENDIF
+
+nss_LIBS=
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+nss_LIBS+=-lstdc++_s
+.ENDIF
+
+
+BUILD_DIR=security$/nss
+BUILD_ACTION=NS_USE_GCC=1 CC="$(nss_CC)" CXX="$(nss_CXX)" OS_LIBS="$(nss_LIBS)" OS_TARGET=WIN95 _WIN32_IE=0x500 PATH=$(PATH) DEFINES=-D_WIN32_IE=0x500 $(GNUMAKE) nss_build_all
+
+OUT2LIB= \
+    dist$/out$/lib$/libnspr4.a \
+    dist$/out$/lib$/libnss3.a \
+    dist$/out$/lib$/libnssdbm3.a \
+    dist$/out$/lib$/libnssutil3.a \
+    dist$/out$/lib$/libplc4.a \
+    dist$/out$/lib$/libplds4.a \
+    dist$/out$/lib$/libsmime3.a \
+    dist$/out$/lib$/libsoftokn3.a \
+    dist$/out$/lib$/libsqlite3.a \
+    dist$/out$/lib$/libssl3.a
+
+.ELSE			# "$(COM)"=="GCC"
+MOZ_MSVCVERSION= 9
+.EXPORT : MOZ_MSVCVERSION
+.IF "$(USE_SHELL)"=="4nt"
+PATH!:=$(MOZILLABUILD)/msys/bin;$(MOZILLABUILD)/moztools/bin;$(PATH)
+.ELSE			# $(USE_SHELL)"=="4nt"
+moz_build:=$(shell cygpath -p $(MOZILLABUILD))
+PATH!:=$(moz_build)/msys/bin:$(moz_build)/moztools/bin:$(PATH)
+.ENDIF			# $(USE_SHELL)"=="4nt"
+.EXPORT : PATH
+
+#Using WINNT will cause at least that nspr4.dll, plc4.dll, plds4.dll 
+#become libnspr4.dll, libplc4.dll, libplds4.dll
+#WINNT causes the use of Microsoft fibers (specific to Windows NT and Windows 2000). 
+#OS_TARGET= WINNT
+OS_TARGET=WIN95
+.EXPORT : OS_TARGET
+
+# make use of stlport headerfiles
+EXT_USE_STLPORT=TRUE
+
+#To build nss one has to call "make nss_build_all" in 
+#mozilla/security/nss
+NSS_BUILD_DIR= $(subst,\,/ $(PWD)/$(MISC)/build/mozilla/security/nss)
+BUILD_ACTION= $(subst,/,$/ $(MOZILLABUILD)/msys/bin/bash) -i \
+    -c "cd $(NSS_BUILD_DIR) && make nss_build_all"
+
+OUT2LIB= \
+     dist$/out$/lib$/nspr4.lib \
+     dist$/out$/lib$/nss3.lib \
+     dist$/out$/lib$/nssdbm3.lib \
+     dist$/out$/lib$/nssutil3.lib \
+     dist$/out$/lib$/plc4.lib \
+     dist$/out$/lib$/plds4.lib \
+     dist$/out$/lib$/smime3.lib \
+     dist$/out$/lib$/softokn3.lib \
+     dist$/out$/lib$/sqlite3.lib \
+     dist$/out$/lib$/ssl3.lib
+
+.ENDIF			# "$(COM)"=="GCC"
+
+OUT2BIN=dist$/out$/lib$/*$(DLLPOST)
+.ENDIF			# "$(GUI)"=="WNT"
+
+
+OUTDIR2INC=dist$/public$/nss dist$/out$/include
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : set_ext.mk
+.INCLUDE :	target.mk
+.INCLUDE :	tg_ext.mk
+
+
diff --git a/nss/nss_3_12_3.patch b/nss/nss_3_12_3.patch
new file mode 100755
index 0000000..de1ff8c
--- /dev/null
+++ b/nss/nss_3_12_3.patch
@@ -0,0 +1,131 @@
+--- misc/mozilla/nsprpub/config/rules.mk	Tue Mar 24 23:49:17 2009
++++ misc/build/mozilla/nsprpub/config/rules.mk	Mon Jun 29 15:45:22 2009
+@@ -363,7 +363,11 @@
+ ifdef NS_USE_GCC
+ 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
+ else
+-	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
++        #We remove stl from the paths to avoid that rc.exe finds the stlport of
++        #OOo. stlport includes the system stl which will fail. By removing it,
++        #rc will use the stl from the system if the path is in the INCLUDE
++        #variable.
++	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
+ endif # GCC
+ 	@echo $(RES) finished
+ endif
+--- misc/mozilla/nsprpub/configure	Fri Dec  5 01:46:50 2008
++++ misc/build/mozilla/nsprpub/configure	Mon Jun 29 15:28:52 2009
+@@ -3905,7 +3905,7 @@
+     PR_MD_CSRCS=linux.c
+     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+     DSO_CFLAGS=-fPIC
+-    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
++    DSO_LDOPTS='-shared -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
+     _OPTIMIZE_FLAGS=-O2
+     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
+                                    # combo is not yet good at debugging inlined
+--- misc/mozilla/security/coreconf/Darwin.mk	Fri Mar 20 08:19:35 2009
++++ misc/build/mozilla/security/coreconf/Darwin.mk	Mon Jun 29 15:28:52 2009
+@@ -38,9 +38,12 @@
+ include $(CORE_DEPTH)/coreconf/UNIX.mk
+ 
+ DEFAULT_COMPILER = cc
++# CC is taken from environment automatically.
++#CC		= cc
++# Use CCC from environment.
++#CCC		= c++
++CCC		= $(CXX)
+ 
+-CC		= cc
+-CCC		= c++
+ RANLIB		= ranlib
+ 
+ ifndef CPU_ARCH
+--- misc/mozilla/security/coreconf/Linux.mk	Sat Sep  6 01:17:23 2008
++++ misc/build/mozilla/security/coreconf/Linux.mk	Mon Jun 29 15:28:52 2009
+@@ -46,8 +46,11 @@
+ 	IMPL_STRATEGY = _PTH
+ endif
+ 
+-CC			= gcc
+-CCC			= g++
++# CC is taken from environment automatically.
++#CC			= gcc
++# Use CCC from environment.
++#CCC			= g++
++CCC		= $(CXX)
+ RANLIB			= ranlib
+ 
+ DEFAULT_COMPILER = gcc
+@@ -174,7 +177,7 @@
+ ARCH			= linux
+ 
+ DSO_CFLAGS		= -fPIC
+-DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,-z,defs
++DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,-z,defs  '-Wl,-rpath,$$ORIGIN'
+ DSO_LDFLAGS		=
+ LDFLAGS			+= $(ARCHFLAG)
+ 
+--- misc/mozilla/security/coreconf/SunOS5.mk	Thu Nov 22 05:39:56 2007
++++ misc/build/mozilla/security/coreconf/SunOS5.mk	Mon Jun 29 15:28:52 2009
+@@ -89,8 +89,11 @@
+ 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
+ 	endif
+ else
+-	CC         = cc
+-	CCC        = CC
++# CC is taken from environment automatically.
++#	CC         = cc
++# Use CXX from environment.
++#	CCC        = CC
++        CCC       = $(CXX)
+ 	ASFLAGS   += -Wa,-P
+ 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
+ 	ifndef BUILD_OPT
+--- misc/mozilla/security/coreconf/arch.mk	Wed Mar 11 19:54:24 2009
++++ misc/build/mozilla/security/coreconf/arch.mk	Mon Jun 29 15:28:52 2009
+@@ -329,8 +329,14 @@
+ # IMPL_STRATEGY may be defined too.
+ #
+ 
+-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++# OBJDIR_NAME is used to build the directory containing the built objects, for 
++# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
++# We need to deliver the contents of that folder into the solver. To make that easier
++# in the makefile we rename this directory to "out". 
++#OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
++OBJDIR_NAME = out
+ 
++
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+ ifndef BUILD_OPT
+ #
+--- misc/mozilla/security/coreconf/rules.mk	Wed Jan 21 00:30:57 2009
++++ misc/build/mozilla/security/coreconf/rules.mk	Mon Jun 29 15:47:42 2009
+@@ -359,7 +359,11 @@
+ ifdef NS_USE_GCC
+ 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
+ else
+-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
++        #We remove stl from the paths to avoid that rc.exe finds the stlport of
++        #OOo. stlport includes the system stl which will fail. By removing it,
++        #rc will use the stl from the system if the path is in the INCLUDE
++        #variable.
++	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
+ endif
+ 	@echo $(RES) finished
+ endif
+--- misc/mozilla/security/nss/cmd/platlibs.mk	Wed Dec  3 00:24:46 2008
++++ misc/build/mozilla/security/nss/cmd/platlibs.mk	Mon Jun 29 15:28:52 2009
+@@ -52,9 +52,9 @@
+ 
+ ifeq ($(OS_ARCH), Linux)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:$$ORIGIN/../lib'
++EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN:$$ORIGIN'
+ else
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib'
++EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
+ endif
+ endif
+ 
diff --git a/nss/nss_3_12_3.patch.mingw b/nss/nss_3_12_3.patch.mingw
new file mode 100644
index 0000000..942b44c
--- /dev/null
+++ b/nss/nss_3_12_3.patch.mingw
@@ -0,0 +1,166 @@
+--- misc/mozilla/nsprpub/config/autoconf.mk.in	2007-06-10 01:28:46.000000000 +0900
++++ misc/build/mozilla/nsprpub/config/autoconf.mk.in	2009-07-26 19:50:43.845875000 +0900
+@@ -22,6 +22,7 @@
+ RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
+ OBJDIR_NAME	= @OBJDIR_NAME@
+ OBJDIR		= @OBJDIR@
++LIB_PREFIX	= @LIB_PREFIX@
+ OBJ_SUFFIX	= @OBJ_SUFFIX@
+ LIB_SUFFIX	= @LIB_SUFFIX@
+ DLL_SUFFIX	= @DLL_SUFFIX@
+--- misc/mozilla/nsprpub/config/rules.mk	2009-03-25 07:49:17.000000000 +0900
++++ misc/build/mozilla/nsprpub/config/rules.mk	2009-07-26 19:50:44.002125000 +0900
+@@ -113,9 +113,9 @@
+ # other platforms do not.
+ #
+ ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
+-LIBRARY		= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
++LIBRARY		= $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+ SHARED_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
+-IMPORT_LIBRARY	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
++IMPORT_LIBRARY	= $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
+ SHARED_LIB_PDB	= $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
+ else
+ LIBRARY		= $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
+--- misc/mozilla/nsprpub/configure	2008-12-05 09:46:50.000000000 +0900
++++ misc/build/mozilla/nsprpub/configure	2009-07-26 19:50:45.158375000 +0900
+@@ -2767,6 +2767,7 @@
+ LIB_SUFFIX=a
+ DLL_SUFFIX=so
+ ASM_SUFFIX=s
++LIB_PREFIX=lib
+ MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
+ PR_MD_ASFILES=
+ PR_MD_CSRCS=
+@@ -4005,6 +4006,7 @@
+         OBJ_SUFFIX=obj
+         LIB_SUFFIX=lib
+         DLL_SUFFIX=dll
++        LIB_PREFIX=
+ 
+         # Determine compiler version
+         CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
+@@ -6169,6 +6171,7 @@
+ s%@LIB_SUFFIX@%$LIB_SUFFIX%g
+ s%@DLL_SUFFIX@%$DLL_SUFFIX%g
+ s%@ASM_SUFFIX@%$ASM_SUFFIX%g
++s%@LIB_PREFIX@%$LIB_PREFIX%g
+ s%@MKSHLIB@%$MKSHLIB%g
+ s%@DSO_CFLAGS@%$DSO_CFLAGS%g
+ s%@DSO_LDOPTS@%$DSO_LDOPTS%g
+--- misc/mozilla/nsprpub/pr/src/Makefile.in	2008-06-08 05:25:59.000000000 +0900
++++ misc/build/mozilla/nsprpub/pr/src/Makefile.in	2009-07-26 20:57:15.324875000 +0900
+@@ -195,7 +195,7 @@
+ 
+ ifeq ($(OS_ARCH),WINNT)
+ ifdef NS_USE_GCC
+-OS_LIBS		= -ladvapi32 -lwsock32 -lwinmm
++OS_LIBS		+= -ladvapi32 -lwsock32 -lwinmm
+ else
+ OS_LIBS		= advapi32.lib wsock32.lib winmm.lib
+ endif
+--- misc/mozilla/security/coreconf/WIN32.mk	2009-04-01 09:49:48.000000000 +0900
++++ misc/build/mozilla/security/coreconf/WIN32.mk	2009-07-26 19:50:45.252125000 +0900
+@@ -43,8 +43,8 @@
+ DEFAULT_COMPILER = cl
+ 
+ ifdef NS_USE_GCC
+-	CC           = gcc
+-	CCC          = g++
++#	CC           = gcc
++	CCC          = $(CXX)
+ 	LINK         = ld
+ 	AR           = ar
+ 	AR          += cr $@
+--- misc/mozilla/security/coreconf/WIN95.mk	2009-02-14 14:51:10.000000000 +0900
++++ misc/build/mozilla/security/coreconf/WIN95.mk	2009-07-26 19:50:45.377125000 +0900
+@@ -44,4 +44,8 @@
+ DEFINES += -DWIN95
+ 
+ # WINNT uses the lib prefix, Win95 and WinCE don't
+-NSPR31_LIB_PREFIX = $(NULL)
++ifdef NS_USE_GCC
++  NSPR31_LIB_PREFIX = lib
++else
++  NSPR31_LIB_PREFIX = $(NULL)
++endif
+--- misc/mozilla/security/coreconf/rules.mk	2009-01-21 08:30:57.000000000 +0900
++++ misc/build/mozilla/security/coreconf/rules.mk	2009-07-26 19:50:45.689625000 +0900
+@@ -281,8 +281,12 @@
+ 	fi
+ endif	# MSVC with manifest tool
+ else
++ifeq (,$(filter-out WIN%,$(OS_TARGET)))
++	$(MKPROG) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) -Wl,--start-group $(EXTRA_LIBS) -Wl,--end-group $(EXTRA_SHARED_LIBS) $(OS_LIBS)
++else
+ 	$(MKPROG) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
+ endif
++endif
+ 
+ get_objs:
+ 	@echo $(OBJS)
+--- misc/mozilla/security/nss/Makefile	2008-12-03 08:24:39.000000000 +0900
++++ misc/build/mozilla/security/nss/Makefile	2009-07-26 19:50:45.845875000 +0900
+@@ -108,7 +108,7 @@
+ NSPR_CONFIGURE_OPTS += --enable-debug-rtl
+ endif
+ ifdef NS_USE_GCC
+-NSPR_COMPILERS = CC=gcc CXX=g++
++NSPR_COMPILERS = CC="$(CC)" CXX="$(CXX)"
+ endif
+ 
+ #
+--- misc/mozilla/security/nss/cmd/crmftest/Makefile	2005-11-14 09:17:21.000000000 +0900
++++ misc/build/mozilla/security/nss/cmd/crmftest/Makefile	2009-07-26 19:50:45.970875000 +0900
+@@ -90,7 +90,7 @@
+ LDDIST = $(DIST)/lib
+ 
+ ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+-EXTRA_LIBS += $(LDDIST)/sectool.lib
++EXTRA_LIBS += $(LDDIST)/$(LIB_PREFIX)sectool.$(LIB_SUFFIX)
+ endif
+ 
+ include ../platrules.mk
+--- misc/mozilla/security/nss/cmd/shlibsign/Makefile	2008-11-21 00:44:11.000000000 +0900
++++ misc/build/mozilla/security/nss/cmd/shlibsign/Makefile	2009-07-26 22:58:48.687625000 +0900
+@@ -112,10 +112,16 @@
+ 	$(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
+ 	$(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
+ else
++ifeq ($(OS_TARGET), WIN95)
++	sh ./sign.sh $(shell cygpath -m -a $(DIST)) \
++	$(shell cygpath -m -a $(OBJDIR)) $(OS_TARGET) \
++	$(shell cygpath -m -a $(NSPR_LIB_DIR)) $(shell cygpath -m -a $<)
++else
+ 	cd $(OBJDIR) ; sh $(SRCDIR)/sign.sh $(call core_abspath,$(DIST)) \
+ 	$(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
+ 	$(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
+ endif
++endif
+ 
+ libs install :: $(CHECKLOC)
+ 
+--- misc/mozilla/security/nss/lib/freebl/config.mk	2009-02-03 06:57:23.000000000 +0900
++++ misc/build/mozilla/security/nss/lib/freebl/config.mk	2009-07-26 19:50:46.127125000 +0900
+@@ -84,10 +84,6 @@
+ RES     = $(OBJDIR)/$(LIBRARY_NAME).res
+ RESNAME = freebl.rc
+ 
+-ifndef WINCE
+-OS_LIBS += shell32.lib
+-endif
+-
+ ifdef NS_USE_GCC
+ EXTRA_SHARED_LIBS += \
+ 	-L$(DIST)/lib \
+@@ -96,6 +92,10 @@
+ 	-lnspr4 \
+ 	$(NULL)
+ else # ! NS_USE_GCC
++ifndef WINCE
++OS_LIBS += shell32.lib
++endif
++
+ EXTRA_SHARED_LIBS += \
+ 	$(DIST)/lib/nssutil3.lib \
+ 	$(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.lib \
diff --git a/nss/prj/build.lst b/nss/prj/build.lst
new file mode 100644
index 0000000..1465b16
--- /dev/null
+++ b/nss/prj/build.lst
@@ -0,0 +1,3 @@
+ns	nss	: solenv stlport NULL
+ns	nss						nmake	-	usr1	ns_mkout NULL
+ns	nss						nmake	-	all	ns_nss NULL
diff --git a/nss/prj/d.lst b/nss/prj/d.lst
new file mode 100755
index 0000000..891eb77
--- /dev/null
+++ b/nss/prj/d.lst
@@ -0,0 +1,10 @@
+mkdir: %_DEST%\inc%_EXT%\mozilla\nspr
+mkdir: %_DEST%\inc%_EXT%\mozilla\nspr\obsolete
+mkdir: %_DEST%\inc%_EXT%\mozilla\nss
+
+..\%__SRC%\inc\include\* %_DEST%\inc%_EXT%\mozilla\nspr
+..\%__SRC%\inc\include\obsolete\protypes.h %_DEST%\inc%_EXT%\mozilla\nspr\obsolete\protypes.h
+..\%__SRC%\inc\nss\*.h %_DEST%\inc%_EXT%\mozilla\nss
+..\%__SRC%\lib\* %_DEST%\lib%_EXT%
+..\%__SRC%\bin\* %_DEST%\bin%_EXT%
+
diff --git a/nss/readme.txt b/nss/readme.txt
new file mode 100755
index 0000000..de23a26
--- /dev/null
+++ b/nss/readme.txt
@@ -0,0 +1,56 @@
+Relation between nss, moz, moz_prebuilt
+---------------------------------------
+nss containes the security libraries which are also part of moz. However nss is
+meant to be more current, that is it to be updated more often. This should be
+easier than doing this with moz. 
+
+If nss is build depends on an environment variable (ENABLE_NSS_MODULE=YES) which
+is per default set to YES. In this case nss is build before moz. The nss
+libraries/lib files/headers built in moz are then not delivered. Otherwise they
+would overwrite those from nss. That is, the nss libraries build in moz are
+removed from mozruntime.zip (build in moz/solver/bin), they are removed from the
+lib directory (for example moz/unxlngi6.pro/lib), and the nss and nspr headers
+are also removed (inc/nss and inc/nspr).  The nss libraries from the nss module
+are then added to mozruntime.zip.
+
+This also applies for moz_prebuilt. Therefore moz and moz_prebuilt must be build
+again after changes have been made to the libraries in the nss module.
+
+Also when moz was updated to use a newer version of mozilla, then one must make
+sure that new files which also belong to nss are not delivered and are removed
+from mozruntime.zip.
+
+Fips 140 and signed libraries
+-------------------------------
+Fips 140 mode is not supported. That is, the *.chk files containing the
+checksums for the cryptographic module are not delivered into solver and will
+not be part of the OOo installation sets.
+
+The *chk files do not match the libraries because we change the rpatch.
+
+libfreebl3
+----------
+Porting to other platforms may require to deliver other variants of
+libfreebl*. The library name varies according to the platform. Changes need to
+be made to 
+ooo/moz/extractfiles.mk
+ooo/moz/zipped/makefile.mk
+sun/moz_prebuilt/zipped/makefile.mk
+
+
+See also
+http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
+
+
+Windows builds of nss
+---------------------
+To build mozilla on windows you'll need the mozilla build tools
+
+Build requirements containing the link to the build tools:
+https://developer.mozilla.org/en/Windows_Build_Prerequisites#ss2.2
+
+The direct link:
+
+http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-1.3.exe
+
+
commit 172bf06b5d6510df2a46b4287caa5f7201fc8c69
Author: Vladimir Glazounov <vg at openoffice.org>
Date:   Wed Aug 26 06:36:38 2009 +0000

    CWS-TOOLING: integrate CWS mingwport22
    2009-08-19 16:18:46 +0200 tono  r275156 : i#103794: mingw gcc-4.4.0 port: make use of dwarf2 eh
    2009-08-05 12:27:41 +0200 tono  r274650 : CWS-TOOLING: rebase CWS mingwport22 to trunk at 274622 (milestone: DEV300:m54)
    2009-08-01 00:56:35 +0200 tono  r274552 : i#103795: mingw gcc-4.4.0 port: use gcc dll
    2009-07-27 00:13:27 +0200 tono  r274344 : i#103795: mingw gcc-4.4.0 port: use gcc dll
    2009-07-25 06:19:59 +0200 tono  r274332 : i#103803: mingw gcc-4.4.0 port: invalid "extern static"
    2009-07-25 06:13:56 +0200 tono  r274331 : i#103802: mingw gcc-4.4.0 port: inhibit use of pthread
    2009-07-25 06:05:22 +0200 tono  r274330 : i#103801: mingw gcc-4.4.0 port: specify relocatable data section
    2009-07-25 05:54:09 +0200 tono  r274329 : i#103800: mingw gcc-4.4.0 port: remove invalid scope
    2009-07-25 05:44:58 +0200 tono  r274328 : i#103799: mingw gcc-4.4.0 port: add some #include
    2009-07-25 05:33:09 +0200 tono  r274327 : i#103798: mingw gcc-4.4.0 port: add backward in include path
    2009-07-25 05:24:42 +0200 tono  r274326 : i#103797: mingw gcc-4.4.0 port: nooptimize c++-uno bridge
    2009-07-25 05:16:20 +0200 tono  r274325 : i#103795: mingw gcc-4.4.0 port: use gcc dll
    2009-07-25 04:01:59 +0200 tono  r274324 : i#103794: mingw gcc-4.4.0 port: make use of dwarf2 eh
    2009-07-25 02:44:01 +0200 tono  r274322 : i#103793: mingw port: Exclude msvc[pr]80.dll from packaging
    2009-07-25 02:28:21 +0200 tono  r274321 : i#103791: mingw port fix typo

diff --git a/berkeleydb/makefile.mk b/berkeleydb/makefile.mk
index 5c8f590..fd9f4d7 100644
--- a/berkeleydb/makefile.mk
+++ b/berkeleydb/makefile.mk
@@ -129,7 +129,7 @@ OUT2INC= \
 CONFIGURE_DIR=out
 #relative to CONFIGURE_DIR
 # TODO needs clean up
-CPPFLAGS+=-nostdinc -D_MT
+CFLAGS+=-nostdinc -D_MT
 db_CC=$(CC)
 db_CXX=$(CXX)
 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
@@ -140,10 +140,7 @@ db_LDFLAGS=-no-undefined -L$(SOLARVER)/$(INPATH)/lib -L$(SOLARVER)/$(INPATH)/bin
 .IF "$(USE_MINGW)"=="cygwin"
 db_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api
 .ENDIF
-db_LDFLAGS+=-L$(COMPATH)/lib
-.IF "$(MINGW_CLIB_DIR)"!=""
-db_LDFLAGS+=-L$(MINGW_CLIB_DIR)
-.ENDIF
+db_LDFLAGS+=-L$(COMPATH)/lib -L$(MINGW_CLIB_DIR)
 db_LIBS=-lmingwthrd
 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
 db_LIBS+=-lstdc++_s
@@ -153,8 +150,7 @@ db_LIBXSO_LIBS=$(LIBSTLPORT) $(db_LIBS)
 db_LIBXSO_LIBS+=-lgcc_s
 .ENDIF
 CONFIGURE_ACTION=..$/dist$/configure
-#CONFIGURE_FLAGS=--enable-cxx --enable-dynamic --enable-shared --build=i586-pc-mingw32 --host=i586-pc-mingw32 --enable-mingw LN_S=ln NM="$(WRAPCMD) nm" OBJDUMP="$(WRAPCMD) objdump" JAVA="$(WRAPCMD) -env java" JAVAC="$(WRAPCMD) -env javac" CFLAGS="$(CFLAGS)" CPPFLAGS="$(INCLUDE)" LIBS="-lmingwthrd" LIBSO_LIBS="-lmingwthrd" LIBJSO_LIBS="-lmingwthrd" LIBXSO_LIBS="-lmingwthrd $(LIBSTLPORT)"
-CONFIGURE_FLAGS=--disable-cxx --enable-dynamic --enable-shared --build=i586-pc-mingw32 --host=i586-pc-mingw32 --enable-mingw CC="$(db_CC)" CXX="$(db_CXX)" LN_S=ln NM="$(WRAPCMD) nm" OBJDUMP="$(WRAPCMD) objdump" JAVA="$(WRAPCMD) -env java" JAVAC="$(WRAPCMD) -env javac" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) $(INCLUDE)" LDFLAGS="$(db_LDFLAGS)" LIBS="$(db_LIBS)" LIBSO_LIBS="$(db_LIBS)" LIBJSO_LIBS="$(db_LIBS)" LIBXSO_LIBS="$(db_LIBXSO_LIBS)"
+CONFIGURE_FLAGS=--enable-cxx --enable-dynamic --enable-shared --build=i586-pc-mingw32 --host=i586-pc-mingw32 --enable-mingw CC="$(db_CC)" CXX="$(db_CXX)" LN_S=ln NM="$(WRAPCMD) nm" OBJDUMP="$(WRAPCMD) objdump" JAVA="$(WRAPCMD) -env java" JAVAC="$(WRAPCMD) -env javac" CFLAGS="$(CFLAGS)" CPPFLAGS="$(INCLUDE)" LDFLAGS="$(db_LDFLAGS)" LIBS="$(db_LIBS)" LIBSO_LIBS="$(db_LIBS)" LIBJSO_LIBS="$(db_LIBS)" LIBXSO_LIBS="$(db_LIBXSO_LIBS)"
 
 BUILD_DIR=$(CONFIGURE_DIR)
 BUILD_DIR_OUT=$(CONFIGURE_DIR)
diff --git a/cairo/cairo/makefile.mk b/cairo/cairo/makefile.mk
index 59a3a35..16dcb4f 100644
--- a/cairo/cairo/makefile.mk
+++ b/cairo/cairo/makefile.mk
@@ -74,10 +74,19 @@ cairo_CPPFLAGS+=$(INCLUDE)
 cairo_CFLAGS+=-D_MT
 cairo_LDFLAGS+=-no-undefined -L$(ILIB:s/;/ -L/)
 cairo_CPPFLAGS+=-nostdinc
+cairo_CC=$(CC)
+cairo_LIBS+=-lmingwthrd
+
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+cairo_CC+=-shared-libgcc
+.ENDIF
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+cairo_LIBS+=-lstdc++_s
+.ENDIF
 
 CONFIGURE_DIR=
 CONFIGURE_ACTION=cp $(SRC_ROOT)$/$(PRJNAME)$/cairo$/dummy_pkg_config . && .$/configure
-CONFIGURE_FLAGS=--disable-xlib --disable-ft --disable-pthread --disable-svg --disable-png --enable-gtk-doc=no --enable-test-surfaces=no --enable-static=no --build=i586-pc-mingw32 --host=i586-pc-mingw32 PKG_CONFIG=./dummy_pkg_config LIBS=-lmingwthrd ZLIB3RDLIB=$(ZLIB3RDLIB) COMPRESS=$(cairo_COMPRESS) OBJDUMP="$(WRAPCMD) objdump"
+CONFIGURE_FLAGS=--disable-xlib --disable-ft --disable-pthread --disable-svg --disable-png --enable-gtk-doc=no --enable-test-surfaces=no --enable-static=no --build=i586-pc-mingw32 --host=i586-pc-mingw32 PKG_CONFIG=./dummy_pkg_config CC="$(cairo_CC)" LIBS="$(cairo_LIBS)" ZLIB3RDLIB=$(ZLIB3RDLIB) COMPRESS=$(cairo_COMPRESS) OBJDUMP="$(WRAPCMD) objdump"
 BUILD_ACTION=$(GNUMAKE)
 BUILD_FLAGS+= -j$(EXTMAXPROCESS)
 BUILD_DIR=$(CONFIGURE_DIR)
diff --git a/curl/makefile.mk b/curl/makefile.mk
index f836e04..d3ad3ba 100644
--- a/curl/makefile.mk
+++ b/curl/makefile.mk
@@ -87,10 +87,18 @@ OUT2LIB=$(BUILD_DIR)$/.libs$/libcurl$(DLLPOST).3
 
 .IF "$(GUI)"=="WNT"
 .IF "$(COM)"=="GCC"
+curl_CC=$(CC)
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+curl_CC+=-shared-libgcc
+.ENDIF
+curl_LIBS=-lws2_32 -lwinmm -lmingwthrd
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+curl_LIBS+=-lstdc++_s
+.ENDIF
 CONFIGURE_DIR=.$/
 #relative to CONFIGURE_DIR
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS= --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 OBJDUMP="$(WRAPCMD) objdump" CFLAGS=-D_MT LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="-lws2_32 -lwinmm -lmingwthrd"
+CONFIGURE_FLAGS= --without-ssl --enable-ftp --enable-ipv6 --disable-http --disable-gopher --disable-file --disable-ldap --disable-telnet --disable-dict --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(curl_CC)" OBJDUMP="$(WRAPCMD) objdump" CFLAGS=-D_MT LDFLAGS="-L$(ILIB:s/;/ -L/)" LIBS="$(curl_LIBS)"
 BUILD_DIR=$(CONFIGURE_DIR)$/lib
 BUILD_ACTION=make
 OUT2BIN=$(BUILD_DIR)$/.libs$/libcurl*.dll
diff --git a/icu/icu-4.0.patch b/icu/icu-4.0.patch
index cb46b9c..172d624 100644
--- a/icu/icu-4.0.patch
+++ b/icu/icu-4.0.patch
@@ -9,6 +9,19 @@
  #define _XOPEN_SOURCE_EXTENDED 1
  #endif
  
+--- misc/icu/source/common/unicode/pwin32.h	2008-07-01 10:41:12.000000000 +0900
++++ misc/build/icu/source/common/unicode/pwin32.h	2008-11-05 22:37:21.479250000 +0900
+@@ -32,6 +32,10 @@
+ #define __STDC_CONSTANT_MACROS
+ #endif
+ 
++#if defined(__MINGW32__)
++#define U_HAVE_INTTYPES_H 1
++#endif
++
+ /* _MSC_VER is used to detect the Microsoft compiler. */
+ #if defined(_MSC_VER)
+ #define U_INT64_IS_LONG_LONG 0
 --- misc/icu/source/config/mh-darwin	Tue Jul  1 03:41:24 2008
 +++ misc/build/icu/source/config/mh-darwin	Tue Jan 20 18:33:16 2009
 @@ -25,7 +25,7 @@
diff --git a/icu/makefile.mk b/icu/makefile.mk
index 6b3c15a..71e2c91 100644
--- a/icu/makefile.mk
+++ b/icu/makefile.mk
@@ -149,11 +149,18 @@ OUT2BIN= \
 CONFIGURE_DIR=source
 .IF "$(COM)"=="GCC"
 CONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ;
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+icu_LDFLAGS+=-shared-libgcc
+.ENDIF
 .IF "$(USE_MINGW)"=="cygwin"
-CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api -L$(COMPATH)$/lib" LIBS="-lmingwthrd" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no'
-.ELSE
-CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="-L$(COMPATH)$/lib" LIBS="-lmingwthrd" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no'
+icu_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api
+.ENDIF
+icu_LDFLAGS+=-L$(COMPATH)$/lib
+icu_LIBS=-lmingwthrd
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+icu_LIBS+=-lstdc++_s
 .ENDIF
+CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no'
 
 #CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
 CONFIGURE_FLAGS=
diff --git a/libxml2/libxml2-2.6.31-mingw.patch b/libxml2/libxml2-2.6.31-mingw.patch
new file mode 100755
index 0000000..102ef3e
--- /dev/null
+++ b/libxml2/libxml2-2.6.31-mingw.patch
@@ -0,0 +1,13 @@
+--- misc/libxml2-2.6.31/libxml.h	2007-11-23 19:47:23.000000000 +0900
++++ misc/build/libxml2-2.6.31/libxml.h	2009-07-10 14:37:34.988250000 +0900
+@@ -30,6 +30,10 @@
+ #include <libxml/xmlversion.h>
+ #else
+ #include "config.h"
++#ifdef __MINGW32__
++#undef HAVE_LIBPTHREAD 
++#undef HAVE_PTHREAD_H 
++#endif
+ #include <libxml/xmlversion.h>
+ #endif
+ 
diff --git a/libxml2/makefile.mk b/libxml2/makefile.mk
index 7ae2265..b99c52f 100644
--- a/libxml2/makefile.mk
+++ b/libxml2/makefile.mk
@@ -59,9 +59,18 @@ PATCH_FILES=$(TARFILE_NAME).patch
 
 .IF "$(OS)"=="WNT"
 .IF "$(COM)"=="GCC"
+PATCH_FILES+=$(TARFILE_NAME)-mingw.patch
+xml2_CC=$(CC)
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+xml2_CC+=-shared-libgcc
+.ENDIF
+xml2_LIBS=-lws2_32 -lmingwthrd
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+xml2_LIBS+=-lstdc++_s
+.ENDIF
 CONFIGURE_DIR=
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-python --enable-static=no --without-debug --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CFLAGS=-D_MT LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc -L$(ILIB:s/;/ -L/)" LIBS="-lws2_32 -lmingwthrd" OBJDUMP="$(WRAPCMD) objdump"
+CONFIGURE_FLAGS=--enable-ipv6=no --without-python --enable-static=no --without-debug --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(xml2_CC)" CFLAGS=-D_MT LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc -L$(ILIB:s/;/ -L/)" LIBS="$(xml2_LIBS)" OBJDUMP="$(WRAPCMD) objdump"
 BUILD_ACTION=$(GNUMAKE)
 BUILD_DIR=$(CONFIGURE_DIR)
 .ELSE
diff --git a/libxslt/makefile.mk b/libxslt/makefile.mk
index 76cbcd3..ba335ee 100644
--- a/libxslt/makefile.mk
+++ b/libxslt/makefile.mk
@@ -57,9 +57,17 @@ PATCH_FILES=$(TARFILE_NAME).patch $(TARFILE_NAME)_win_manifest.patch
 
 .IF "$(OS)"=="WNT"
 .IF "$(COM)"=="GCC"
+xslt_CC=$(CC)
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+xslt_CC+=-shared-libgcc
+.ENDIF
+xslt_LIBS=-lmingwthrd
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
+xslt_LIBS+=-lstdc++_s
+.ENDIF
 CONFIGURE_DIR=
 CONFIGURE_ACTION=.$/configure
-CONFIGURE_FLAGS=--enable-ipv6=no --without-crypto --without-python --enable-static=no --with-sax1=yes --build=i586-pc-mingw32 --host=i586-pc-mingw32 CFLAGS="$(xslt_CFLAGS) -D_MT" LDFLAGS="$(xslt_LDFLAGS) -no-undefined -L$(ILIB:s/;/ -L/)" LIBS="-lmingwthrd"  LIBXML2LIB=$(LIBXML2LIB) OBJDUMP="$(WRAPCMD) objdump"
+CONFIGURE_FLAGS=--enable-ipv6=no --without-crypto --without-python --enable-static=no --with-sax1=yes --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(xslt_CC)" CFLAGS="$(xslt_CFLAGS) -D_MT" LDFLAGS="-no-undefined -L$(ILIB:s/;/ -L/)" LIBS="$(xslt_LIBS)"  LIBXML2LIB=$(LIBXML2LIB) OBJDUMP="$(WRAPCMD) objdump"
 BUILD_ACTION=chmod 777 xslt-config && $(GNUMAKE)
 BUILD_FLAGS+= -j$(EXTMAXPROCESS)
 BUILD_DIR=$(CONFIGURE_DIR)
diff --git a/python/Python-2.6.1-mingw.patch b/python/Python-2.6.1-mingw.patch
index 6306722..26bc4cb 100644
--- a/python/Python-2.6.1-mingw.patch
+++ b/python/Python-2.6.1-mingw.patch
@@ -1,6 +1,6 @@
 --- misc/Python-2.6.1/Include/pyport.h	2008-06-11 16:41:16.000000000 +0900
 +++ misc/build/Python-2.6.1/Include/pyport.h	2009-03-29 23:28:13.859000000 +0900
-@@ -3,6 +3,26 @@
+@@ -3,6 +3,30 @@
  
  #include "pyconfig.h" /* include for defines */
  
@@ -9,6 +9,7 @@
 +#undef HAVE_OPENPTY
 +#undef HAVE_DEV_PTMX
 +#undef _POSIX_THREADS
++#undef HAVE_PTHREAD_H
 +#define MS_WINDOWS
 +#define MS_WIN32
 +#define Py_WIN_WIDE_FILENAMES
@@ -18,6 +19,9 @@
 +#define NT_THREADS
 +#define WITH_THREAD
 +#define WINVER 0x0501
++#ifdef socklen_t
++#undef socklen_t
++#endif
 +#define HAVE_ADDRINFO
 +#define HAVE_GETADDRINFO
 +#define HAVE_GETNAMEINFO
diff --git a/python/makefile.mk b/python/makefile.mk
index a84fccb..663a560 100644
--- a/python/makefile.mk
+++ b/python/makefile.mk
@@ -95,6 +95,9 @@ BUILD_DIR=
 MYCWD=$(shell cygpath -m $(shell @pwd))/$(INPATH)/misc/build
 python_CFLAGS=-mno-cygwin -mthreads
 python_LDFLAGS=-mno-cygwin -mthreads
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
+python_LDFLAGS+=-shared-libgcc
+.ENDIF
 CONFIGURE_ACTION=./configure --prefix=$(MYCWD)/python-inst --enable-shared CC="$(CC:s/guw.exe //)" CXX="$(CXX:s/guw.exe //)" MACHDEP=MINGW32 LN="cp -p" CFLAGS="$(python_CFLAGS)" LDFLAGS="$(python_LDFLAGS)"
 BUILD_ACTION=$(ENV_BUILD) make ; make install
 .ELSE


More information about the ooo-build-commit mailing list