From 5b36f89cdbd9c0f881518db21806db58bdb8b9f8 Mon Sep 17 00:00:00 2001
From: "cbiesinger%web.de" <cbiesinger%web.de>
Date: Thu, 28 Sep 2006 21:22:27 +0000
Subject: [PATCH] bug 353983 add --enable-application=netwerk option
 r=bsmedberg sr=darin

---
 Makefile.in                     |  7 +++
 client.mk                       | 45 +++++++++++++------
 configure.in                    | 11 +++++
 intl/strres/tests/Makefile.in   |  1 -
 modules/libpref/src/Makefile.in |  1 -
 netwerk/build.mk                | 80 +++++++++++++++++++++++++++++++++
 netwerk/build/Makefile.in       |  2 -
 toolkit/toolkit-tiers.mk        | 22 +--------
 8 files changed, 132 insertions(+), 37 deletions(-)
 create mode 100644 netwerk/build.mk

diff --git a/Makefile.in b/Makefile.in
index bee0b547ed57f..4f6757af757df 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -94,9 +94,16 @@ include $(topsrcdir)/config/rules.mk
 tier_toolkit::
 	$(MAKE) tools_tier_js
 	$(MAKE) tools_tier_xpcom
+	$(MAKE) tools_tier_necko
 	$(MAKE) tools_tier_gecko
 	$(MAKE) tools_tier_toolkit
 
+ifeq (netwerk,$(MOZ_BUILD_APP))
+tier_necko::
+	$(EXIT_ON_ERROR) \
+	$(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
+endif
+
 distclean::
 	cat unallmakefiles | $(XARGS) rm -f
 	rm -f unallmakefiles $(DIST_GARBAGE)
diff --git a/client.mk b/client.mk
index 5656ba783dca6..f950a73aa8efe 100644
--- a/client.mk
+++ b/client.mk
@@ -112,21 +112,37 @@ AVAILABLE_PROJECTS = \
   calendar \
   xulrunner \
   camino \
+  necko \
   $(NULL)
 
 # Trailing / on top-level mozilla dir required to stop fast-update thinking
 # it is a module name.
-MODULES_NS_core :=                              \
+MODULES_NS_necko :=                             \
   mozilla/                                      \
+  $(NULL)
+
+MODULES_necko :=                                \
+  mozilla/README                                \
+  mozilla/config                                \
+  mozilla/build                                 \
+  mozilla/intl                                  \
+  mozilla/modules/libpref                       \
+  mozilla/modules/zlib                          \
+  mozilla/netwerk                               \
+  mozilla/xpcom                                 \
+  mozilla/extensions/auth                       \
+  mozilla/tools/test-harness                    \
+  $(NULL)
+
+MODULES_NS_core :=                              \
+  $(MODULES_NS_necko)                           \
   mozilla/js                                    \
   mozilla/js/src                                \
   mozilla/js/jsd                                \
   $(NULL)                                       \
 
 MODULES_core :=                                 \
-  mozilla/README                                \
-  mozilla/config                                \
-  mozilla/build                                 \
+  $(MODULES_necko)                              \
   mozilla/caps                                  \
   mozilla/content                               \
   mozilla/db/.cvsignore                         \
@@ -142,7 +158,6 @@ MODULES_core :=                                 \
   mozilla/gfx                                   \
   mozilla/parser                                \
   mozilla/layout                                \
-  mozilla/intl                                  \
   mozilla/jpeg                                  \
   mozilla/js/src/fdlibm                         \
   mozilla/js/src/liveconnect                    \
@@ -151,14 +166,11 @@ MODULES_core :=                                 \
   mozilla/modules/libimg                        \
   mozilla/modules/libjar                        \
   mozilla/modules/libpr0n                       \
-  mozilla/modules/libpref                       \
   mozilla/modules/libreg                        \
   mozilla/modules/libutil                       \
   mozilla/modules/oji                           \
   mozilla/modules/plugin                        \
-  mozilla/modules/zlib                          \
   mozilla/modules/staticmod                     \
-  mozilla/netwerk                               \
   mozilla/plugin/oji                            \
   mozilla/profile                               \
   mozilla/rdf                                   \
@@ -176,7 +188,6 @@ MODULES_core :=                                 \
   mozilla/view                                  \
   mozilla/webshell                              \
   mozilla/widget                                \
-  mozilla/xpcom                                 \
   mozilla/xpfe                                  \
   mozilla/xpinstall                             \
   mozilla/toolkit                               \
@@ -184,11 +195,14 @@ MODULES_core :=                                 \
   mozilla/db/sqlite3                            \
   mozilla/db/morkreader                         \
   mozilla/tools/cross-commit                    \
-  mozilla/tools/test-harness                    \
   $(NULL)
 
-LOCALES_core :=                                 \
+LOCALES_necko :=                                \
   netwerk                                       \
+  $(NULL)
+
+LOCALES_core :=                                 \
+  $(LOCALES_necko)                              \
   dom                                           \
   $(NULL)
 
@@ -199,6 +213,10 @@ BOOTSTRAP_core :=                               \
   mozilla/suite/config/version.txt              \
   $(NULL)
 
+BOOTSTRAP_core :=                               \
+  $(BOOTSTRAP_necko)                            \
+  $(NULL)
+
 MODULES_NS_toolkit :=                           \
   $(MODULES_NS_core)                            \
   $(NULL)
@@ -768,8 +786,9 @@ real_checkout:
 	$(CHECKOUT_MODULES) \
 	$(CHECKOUT_LOCALES);
 	@echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
-# update the NSS checkout timestamp
-	@if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
+# update the NSS checkout timestamp, if we checked PSM out
+	@if test -d $(TOPSRCDIR)/security/manager -a \
+		 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
 		touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
 	fi
 #	@: Check the log for conflicts. ;
diff --git a/configure.in b/configure.in
index ab76909ded2fe..63a5a299c83fa 100644
--- a/configure.in
+++ b/configure.in
@@ -4104,6 +4104,7 @@ MOZ_ARG_ENABLE_STRING(application,
                             xulrunner
                             camino
                             content/xslt (Standalone Transformiix XSLT)
+                            netwerk (Standalone Necko)
                             tools/update-packaging (AUS-related packaging tools)
                             standalone (use this for standalone
                               xpcom/xpconnect or to manually drive a build)],
@@ -4396,6 +4397,16 @@ content/xslt)
   MOZ_APP_VERSION=$MOZILLA_VERSION
   ;;
 
+netwerk)
+  MOZ_APP_NAME=mozilla
+  MOZ_EXTENSIONS_DEFAULT=""
+  MOZ_APP_VERSION=$MOZILLA_VERSION
+  MOZ_NO_XPCOM_OBSOLETE=1
+  MOZ_SINGLE_PROFILE=1
+  MOZ_PROFILESHARING=
+  MOZ_XPINSTALL=
+  ;;
+
 standalone) 
   MOZ_APP_NAME=mozilla
   MOZ_APP_DISPLAYNAME=Mozilla
diff --git a/intl/strres/tests/Makefile.in b/intl/strres/tests/Makefile.in
index 3a62997882ec8..8982c5bb709d9 100644
--- a/intl/strres/tests/Makefile.in
+++ b/intl/strres/tests/Makefile.in
@@ -62,7 +62,6 @@ EXPORT_RESOURCE	= \
 
 LIBS		= \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
-		$(MOZ_JS_LIBS) \
 		$(XPCOM_LIBS) \
 		$(NSPR_LIBS) \
 		$(NULL)
diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
index 2b7650f04df80..15381a8dc86a8 100644
--- a/modules/libpref/src/Makefile.in
+++ b/modules/libpref/src/Makefile.in
@@ -93,7 +93,6 @@ endif
 
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
-		$(MOZ_JS_LIBS) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(NULL)
 
diff --git a/netwerk/build.mk b/netwerk/build.mk
new file mode 100644
index 0000000000000..af827dd77dca1
--- /dev/null
+++ b/netwerk/build.mk
@@ -0,0 +1,80 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla 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/MPL/
+#
+# 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 the Mozilla build system.
+#
+# The Initial Developer of the Original Code is
+# Google Inc.
+# Portions created by the Initial Developer are Copyright (C) 2006
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+# NOTE: We need NSPR and xpcom, but their build.mk may or may not be
+# included yet. Include it if needed.
+
+ifndef tier_nspr_dirs
+include $(topsrcdir)/config/nspr/build.mk
+endif
+
+ifndef tier_xpcom_dirs
+include $(topsrcdir)/xpcom/build.mk
+endif
+
+TIERS += zlib \
+	necko \
+	$(NULL)
+
+
+ifndef MOZ_NATIVE_ZLIB
+tier_zlib_dirs	+= modules/zlib
+endif
+
+#
+# tier "necko" - the networking library and its dependencies
+#
+
+# these are only in the necko tier because libpref needs it
+
+ifneq (1_,$(MOZ_NO_XPCOM_OBSOLETE)_$(MOZ_XPINSTALL))
+tier_necko_dirs += modules/libreg
+endif
+
+ifndef MOZ_NO_XPCOM_OBSOLETE
+tier_necko_dirs += xpcom/obsolete
+endif
+
+tier_necko_dirs += \
+		modules/libpref \
+		intl \
+		netwerk \
+		$(NULL)
+
+ifdef MOZ_AUTH_EXTENSION
+tier_necko_dirs += extensions/auth
+endif
+
diff --git a/netwerk/build/Makefile.in b/netwerk/build/Makefile.in
index 1ce741f80418f..eba1bdc3284fc 100644
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -56,7 +56,6 @@ ifdef ENABLE_TESTS
 PACKAGE_FILE += necko-tests.pkg
 endif
 
-# caps is needed for nsICryptoHash
 REQUIRES	= xpcom \
 		  string \
 		  nkcache \
@@ -66,7 +65,6 @@ REQUIRES	= xpcom \
 		  intl \
 		  uconv \
 		  unicharutil \
-		  caps \
 		  $(ZLIB_REQUIRES) \
 		  $(NULL)
 
diff --git a/toolkit/toolkit-tiers.mk b/toolkit/toolkit-tiers.mk
index 513ebc226b1a2..8bf74255bf431 100644
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -43,6 +43,7 @@ endif
 include $(topsrcdir)/config/nspr/build.mk
 include $(topsrcdir)/js/src/build.mk
 include $(topsrcdir)/xpcom/build.mk
+include $(topsrcdir)/netwerk/build.mk
 
 TIERS += \
 	external \
@@ -58,10 +59,6 @@ ifndef MOZ_NATIVE_JPEG
 tier_external_dirs	+= jpeg
 endif
 
-ifndef MOZ_NATIVE_ZLIB
-tier_external_dirs	+= modules/zlib
-endif
-
 # Installer needs standalone libjar, hence standalone zlib
 ifdef MOZ_INSTALLER
 tier_external_dirs	+= modules/zlib/standalone
@@ -73,24 +70,15 @@ tier_external_dirs += modules/libmar
 endif
 
 #
-# tier "gecko" - core components (necko,gecko)
+# tier "gecko" - core components
 #
 
-ifneq (,$(MOZ_NO_XPCOM_OBSOLETE)$(MOZ_XPINSTALL))
-tier_gecko_dirs += modules/libreg
-endif
-
-ifndef MOZ_NO_XPCOM_OBSOLETE
-tier_gecko_dirs += xpcom/obsolete
-endif
-
 ifdef NS_TRACE_MALLOC
 tier_gecko_dirs += tools/trace-malloc/lib
 endif
 
 tier_gecko_dirs += \
 		js/src/xpconnect \
-		intl \
 		intl/chardet \
 		$(NULL)
 
@@ -112,7 +100,6 @@ endif
 
 tier_gecko_dirs	+= \
 		modules/libutil \
-		netwerk \
 		modules/libjar \
 		db \
 		$(NULL)
@@ -138,7 +125,6 @@ endif
 
 tier_gecko_dirs	+= \
 		uriloader \
-		modules/libpref \
 		modules/libimg \
 		caps \
 		parser/expat \
@@ -165,10 +151,6 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 tier_gecko_dirs += plugin/oji/JEP
 endif
 
-ifdef MOZ_AUTH_EXTENSION
-tier_gecko_dirs += extensions/auth
-endif
-
 ifdef MOZ_XMLEXTRAS
 tier_gecko_dirs += extensions/xmlextras
 endif
-- 
GitLab