Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2002 18:19:17 +0200
From:      Jeremy Lea <reg@FreeBSD.org>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        freebsd-gnome@FreeBSD.org
Subject:   Re: A mozilla lite port.
Message-ID:  <20020214181917.A64409@shale.csir.co.za>
In-Reply-To: <3C6A354D.43BA66AD@FreeBSD.org>; from sobomax@FreeBSD.org on Wed, Feb 13, 2002 at 11:43:41AM %2B0200
References:  <20020213002751.A47581@shale.csir.co.za> <3C6A354D.43BA66AD@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Wed, Feb 13, 2002 at 11:43:41AM +0200, Maxim Sobolev wrote:
> In general looks fine to me, however I'm little concerned about the
> fact that your patch removes all CXX, CFLAGS and -pthread tweaks. Have
> you verifyed that -D_THREAD_SAFE/-pthread is inserted where
> appropriate and that system CXX and CFLAGS are respected everywhere?

Of course.  Actually, while testing to make sure it respected $CC, I
found the NSS is being built with the wrong options.  I've fixed this in
the attached patch, but CFLAGS are not being respected.  I can't find a
simple fix at the moment, I don't feel like hacking it in, and the
correct fix is to take NSS's build system out the back and shoot it.

This might explain some of the instability with the embedded stuff.  The
NSS port seems to do a better job, and we might benefit from using the
NSS and NSPR ports for Mozilla.

Anyway, the attached patch is Part 1.  It cleans up the building of the
port, changes a few configure options, and merges in the IPv6 stuff.

I've tested on -CURRENT, and I'm looking for people to test it a bit
with Galeon, -STABLE, Alpha, etc.  I'll commit in about 24 hours unless
there are problems.

Regards,
  -Jeremy

-- 
FreeBSD - Because the best things in life are free...
                                           http://www.freebsd.org/

www/mozilla:
  Maintainer:	gnome@FreeBSD.org
  Changes: Makefile
           pkg-plist
           files/patch-ak
           files/patch-qt
  Adds   : files/patch-netwerk::base::src::nsSocketTransport.cpp
           files/patch-netwerk::base::src::nsSocketTransport.h
           files/patch-nsprpub::configure
           files/patch-security::coreconf::FreeBSD.mk
           files/tar-exclude
  Removes: files/patch-mi
           files/patch-nsprpub::pr::include::md::_freebsd.cfg

--- /usr/ports.ref/www/mozilla/Makefile	Mon Feb 11 22:01:57 2002
+++ www/mozilla/Makefile	Thu Feb 14 11:18:50 2002
@@ -7,6 +7,7 @@
 
 PORTNAME=	mozilla
 PORTVERSION=	0.9.8
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	www
 MASTER_SITES=	${MASTER_SITE_MOZILLA} \
@@ -28,58 +29,58 @@
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
 USE_BZIP2=	yes
+EXTRACT_AFTER_ARGS=	| tar -xf - -X ${FILESDIR}/tar-exclude
 USE_X_PREFIX=	yes
 USE_PERL5=	yes
 USE_GMAKE=	yes
-USE_NEWGCC=	yes
 USE_GTK=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=					\
+		--disable-auto-deps		\
+		--enable-chrome-format=jar	\
 		--disable-cpp-exceptions	\
 		--disable-cpp-rtti		\
-		--disable-debug			\
-		--disable-idltool		\
-		--disable-md			\
-		--disable-pedantic		\
-		--disable-xterm-updates		\
 		--enable-crypto			\
+		--disable-debug			\
+		--enable-default-toolkit=gtk	\
 		--enable-double-buffer		\
-		--enable-editor			\
+		--enable-dtd-debug		\
+		--enable-jsd			\
+		--enable-ldap			\
 		--enable-mailnews		\
 		--enable-mathml			\
-		--enable-optimize="${CFLAGS}"	\
-		--enable-pics			\
+		--disable-md			\
+		--disable-optimize		\
+		--disable-pedantic		\
+		--disable-plaintext-editor-only	\
+		--enable-reorder		\
+		--enable-strip			\
 		--enable-svg			\
-		--enable-tests			\
-		--enable-toolkit=gtk		\
-		--enable-x11-shm		\
-		--enable-chrome-format=jar	\
-		--with-jpeg=${LOCALBASE}	\
-		--with-png=${LOCALBASE}		\
-		--with-mng=${LOCALBASE}		\
+		--disable-tests			\
+		--disable-xterm-updates		\
+		--enable-xinerama		\
+		--with-system-jpeg=${LOCALBASE}	\
+		--with-system-mng=${LOCALBASE}	\
+		--with-system-png=${LOCALBASE}	\
 		--with-pthreads
 .if !defined(WITHOUT_CHATZILLA)
 CONFIGURE_ARGS+=	--with-extensions=default,irc
 .endif
-CONFIGURE_ENV=	BSD_PTHREAD_LIBS="${PTHREAD_LIBS}" \
-		CFLAGS="" CXXFLAGS="" \
-		MOZ_INTERNAL_LIBART_LGPL=1
+CONFIGURE_ENV=	MOZ_INTERNAL_LIBART_LGPL=1
 MAKE_ENV=	LD_LIBRARY_PATH=${WRKSRC}/dist/bin \
-		CFLAGS="" CXXFLAGS="" \
-		MALLOC_OPTIONS=j \
 		MOZ_INTERNAL_LIBART_LGPL=1
 ALL_TARGET=	default
 
 post-build:
-	@${SED} -e "s;@PREFIX@;${PREFIX};g" \
+	${SED} -e "s;@PREFIX@;${PREFIX};g" \
 		${FILESDIR}/mozilla.sh >${WRKSRC}/mozilla
-	@(cd ${WRKSRC}/dist/bin; \
+	(cd ${WRKSRC}/dist/bin; \
 	  ${SETENV} LD_LIBRARY_PATH=. MOZILLA_FIVE_HOME=. ./regxpcom; \
 	  ${ECHO_CMD} skin,install,select,classic/1.0 >> chrome/installed-chrome.txt; \
 	  ${ECHO_CMD} locale,install,select,en-US >> chrome/installed-chrome.txt; \
 	  ${SETENV} LD_LIBRARY_PATH=. MOZILLA_FIVE_HOME=. ./regchrome)
-	@/usr/bin/find ${WRKSRC}/dist/bin -type d | /usr/bin/sort -r | \
-		/usr/bin/xargs ${RMDIR} 2> /dev/null || ${TRUE}
+	${FIND} ${WRKSRC}/dist/bin -type d | /usr/bin/sort -r | \
+		${XARGS} ${RMDIR} 2> /dev/null || ${TRUE}
 
 do-install:
 	${MKDIR} ${PREFIX}/lib/mozilla
--- /usr/ports.ref/www/mozilla/files/patch-ak	Mon Feb 11 22:01:57 2002
+++ www/mozilla/files/patch-ak	Thu Feb 14 00:58:10 2002
@@ -3,11 +3,16 @@
 
 --- nsprpub/pr/include/md/_freebsd.h.orig	Sat Jan  5 03:43:00 2002
 +++ nsprpub/pr/include/md/_freebsd.h	Tue Feb  5 11:14:27 2002
-@@ -40,6 +40,7 @@
- #if __FreeBSD__ >= 2
- #include <osreldate.h>  /* for __FreeBSD_version */
- #endif
-+#include <sys/param.h>
- #include <sys/syscall.h>
+@@ -87,6 +88,12 @@
+ 
+ #define _PR_HAVE_SYSV_SEMAPHORES
+ #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
++
++#if __FreeBSD_version >= 400014
++#define _PR_INET6
++#define _PR_HAVE_GETHOSTBYNAME2
++#define _PR_INET6_PROBE
++#endif
+ 
+ #define USE_SETJMP
  
- #define PR_LINKER_ARCH	"freebsd"
--- /usr/ports.ref/www/mozilla/files/patch-mi	Tue Sep 18 10:12:08 2001
+++ www/mozilla/files/patch-mi	Wed Feb 13 22:33:15 2002
@@ -1,42 +0,0 @@
-
-$FreeBSD: ports/www/mozilla/files/patch-mi,v 1.6 2001/09/18 08:12:08 sobomax Exp $
-
---- nsprpub/config/FreeBSD.mk.orig	Sat Jul 29 03:50:35 2000
-+++ nsprpub/config/FreeBSD.mk	Mon Sep 17 10:47:08 2001
-@@ -37,19 +37,21 @@
- 
- include $(MOD_DEPTH)/config/UNIX.mk
- 
--CC			= gcc
--CCC			= g++
-+CCC			= $(CXX)
- RANLIB			= ranlib
- 
-+# During FreeBSD port build, CFLAGS contains all of the optimizations
-+# flags desired...
-+OPTIMIZER		= $(MOZ_OPTIMIZE_FLAGS)
-+
- ifeq ($(OS_TEST),alpha)
- CPU_ARCH		= alpha
- else
--OS_REL_CFLAGS		= -Di386
- CPU_ARCH		= x86
- endif
- CPU_ARCH_TAG		= _$(CPU_ARCH)
- 
--OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
-+OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
- 
- #
- # The default implementation strategy for FreeBSD is pthreads.
-@@ -60,8 +62,8 @@
- else
- USE_PTHREADS		= 1
- IMPL_STRATEGY		= _PTH
--DEFINES			+= -D_THREAD_SAFE
--THREAD_FLAG		+= -pthread
-+DEFINES			+= -D_THREAD_SAFE -D_REENTRANT
-+DSO_LDOPTS		+= -pthread
- endif
- 
- ARCH			= freebsd
--- /usr/ports.ref/www/mozilla/files/patch-netwerk::base::src::nsSocketTransport.cpp	Thu Jan  1 02:00:00 1970
+++ www/mozilla/files/patch-netwerk::base::src::nsSocketTransport.cpp	Thu Feb 14 00:57:25 2002
@@ -0,0 +1,329 @@
+--- netwerk/base/src/nsSocketTransport.cpp.orig	Fri Feb  8 11:20:08 2002
++++ netwerk/base/src/nsSocketTransport.cpp	Fri Feb  8 11:20:16 2002
+@@ -143,6 +143,7 @@
+     mHostName(nsnull),
+     mPort(-1),
+     mMonitor(nsnull),
++    mNetAddress(nsnull),
+     mOperation(eSocketOperation_None),
+     mProxyPort(-1),
+     mProxyHost(nsnull),
+@@ -183,12 +184,6 @@
+     SetWriteType(eSocketWrite_None);
+     
+     //
+-    // Set up Internet defaults...
+-    //
+-    memset(&mNetAddress, 0, sizeof(mNetAddress));
+-    PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, 0, &mNetAddress);
+-    
+-    //
+     // Initialize the global connect timeout value if necessary...
+     //
+     if (PR_INTERVAL_NO_WAIT == gConnectTimeout)
+@@ -415,6 +410,14 @@
+ 
+     while (!done) {
+         //
++        // Check for failure on any socket requests
++        //
++        if (mReadRequest && mReadRequest->HasFailed())
++            mReadRequest->GetStatus(&mStatus);
++        else if (mWriteRequest && mWriteRequest->HasFailed())
++            mWriteRequest->GetStatus(&mStatus);
++
++        //
+         // If an error has occurred then move into the error state...
+         //
+         if (NS_FAILED(mStatus) && (NS_BASE_STREAM_WOULD_BLOCK != mStatus))
+@@ -495,17 +498,40 @@
+             // Send status message
+             // only send a status if doResolveHost is going to do some
+             // resolution
+-            if (mStatus != NS_OK)
++            if (mStatus == NS_BASE_STREAM_WOULD_BLOCK)
+                 OnStatus_Locked(NS_NET_STATUS_RESOLVING_HOST);
+             break;
+ 
+         case eSocketState_WaitConnect:
+             LOG(("nsSocketTransport: Transport [host=%s:%d this=%x] is in WaitConnect state.\n",
+                 mHostName, mPort, this));
+-            mStatus = doConnection(aSelectFlags);
+ 
+             // Send status message
+             OnStatus_Locked(NS_NET_STATUS_CONNECTING_TO);
++
++            mStatus = doConnection(aSelectFlags);
++
++            // on connection failure, reuse next address if one exists
++            if (mStatus == NS_ERROR_CONNECTION_REFUSED) {
++                mNetAddress = mNetAddrList.GetNext(mNetAddress);
++                if (mNetAddress) {
++#if defined(PR_LOGGING)
++                    char buf[50];
++                    PR_NetAddrToString(mNetAddress, buf, sizeof(buf));
++                    LOG(("connection failed... trying %s\n", buf));
++#endif
++                    PR_Close(mSocketFD);
++                    mSocketFD = nsnull;
++
++                    // mask error status so we'll return to this state
++                    mStatus = NS_OK;
++
++                    // need to re-enter Process() asynchronously
++                    mService->AddToWorkQ(this);
++                    done = PR_TRUE;
++                    continue;
++                }
++            }
+             break;
+ 
+         case eSocketState_WaitReadWrite:
+@@ -633,21 +659,19 @@
+ 
+     NS_ASSERTION(eSocketState_WaitDNS == mCurrentState, "Wrong state.");
+ 
+-    LOG(("nsSocketTransport: Entering doResolveHost() [host=%s:%d this=%x].\n", 
++    LOG(("nsSocketTransport: Entering doResolveHost() [host=%s:%d %x].\n", 
+         mHostName, mPort, this));
+ 
++    // 
++    // The hostname is being resolved...
++    //
++    if (mDNSRequest)
++        return NS_BASE_STREAM_WOULD_BLOCK;
++
+     //
+     // The hostname has not been resolved yet...
+     //
+-    if (PR_IsNetAddrType(&mNetAddress, PR_IpAddrAny)) {
+-        //
+-        // Initialize the port used for the connection...
+-        //
+-        // XXX: The list of ports must be restricted - see net_bad_ports_table[] in 
+-        //      mozilla/network/main/mkconect.c
+-        //
+-        mNetAddress.ipv6.port = PR_htons(((mProxyPort != -1 && !mProxyTransparent) ? mProxyPort : mPort));
+-
++    if (mNetAddress == nsnull) {
+         PR_ExitMonitor(mMonitor);
+ 
+         nsIDNSService* pDNSService = mService->GetCachedDNSService();
+@@ -659,9 +683,7 @@
+         // Give up the SocketTransport lock.  This allows the DNS thread to call the
+         // nsIDNSListener notifications without blocking...
+         //
+-        rv = pDNSService->Lookup((mProxyHost && !mProxyTransparent) ? mProxyHost : mHostName, 
+-                                 this, 
+-                                 nsnull, 
++        rv = pDNSService->Lookup(GetSocketHost(), this, nsnull, 
+                                  getter_AddRefs(mDNSRequest));
+         //
+         // Aquire the SocketTransport lock again...
+@@ -672,7 +694,7 @@
+             //
+             // The DNS lookup has finished...  It has either failed or succeeded.
+             //
+-            if (NS_FAILED(mStatus) || !PR_IsNetAddrType(&mNetAddress, PR_IpAddrAny)) {
++            if (NS_FAILED(mStatus) || mNetAddress) {
+                 mDNSRequest = 0;
+                 rv = mStatus;
+             } 
+@@ -687,10 +709,8 @@
+         }
+     }
+ 
+-    LOG(("nsSocketTransport: Leaving doResolveHost() [%s:%d %x].\t"
+-        "rv = %x.\n\n",
++    LOG(("nsSocketTransport: Leaving doResolveHost() [%s:%d %x] rv = %x\n",
+         mHostName, mPort, this, rv));
+-
+     return rv;
+ }
+ 
+@@ -832,7 +852,7 @@
+         //    This is only done the first time doConnection(...) is called.
+         //
+         if (NS_SUCCEEDED(rv)) {
+-            status = PR_Connect(mSocketFD, &mNetAddress, gConnectTimeout);
++            status = PR_Connect(mSocketFD, mNetAddress, gConnectTimeout);
+             if (PR_SUCCESS != status) {
+                 PRErrorCode code = PR_GetError();
+                 //
+@@ -932,14 +952,17 @@
+     //
+     // The hostname has not been resolved yet...
+     //
+-    if (PR_IsNetAddrType(&mNetAddress, PR_IpAddrAny)) {
++    if (mNetAddress == nsnull) {
+         nsIDNSService* pDNSService = mService->GetCachedDNSService();
+         if (!pDNSService) {
+             return NS_ERROR_UNEXPECTED;
+         }
+ 
+         nsXPIDLCString result;
+-        const char *host = (mProxyHost && !mProxyTransparent) ? mProxyHost : mHostName;
++        const char *host = GetSocketHost();
++
++        // XXX DNS service does not provide a synchronous resolver that returns
++        // the entire nsHostEnt struct.
+         rv = pDNSService->Resolve(host, getter_Copies(result));
+         if (NS_FAILED(rv)) return rv;
+ 
+@@ -953,16 +976,18 @@
+             return NS_ERROR_FAILURE;
+         }
+ 
++        mNetAddrList.Init(1);
++        mNetAddress = mNetAddrList.GetNext(nsnull);
++
++        PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, GetSocketPort(), mNetAddress);
++
+         if (addr.raw.family == PR_AF_INET)
+-            PR_ConvertIPv4AddrToIPv6(addr.inet.ip, &mNetAddress.ipv6.ip);
++            PR_ConvertIPv4AddrToIPv6(addr.inet.ip, &mNetAddress->ipv6.ip);
+         else
+-            memcpy(&mNetAddress.ipv6.ip, &addr.ipv6.ip, sizeof(mNetAddress.ipv6.ip));
+-
+-        mNetAddress.ipv6.port
+-            = PR_htons(((mProxyPort != -1 && !mProxyTransparent) ? mProxyPort : mPort));
++            memcpy(&mNetAddress->ipv6.ip, &addr.ipv6.ip, sizeof(mNetAddress->ipv6.ip));
+ 
+         LOG(("address { family=%hu, port=%hu }\n",
+-            mNetAddress.ipv6.family, PR_ntohs(mNetAddress.ipv6.port)));
++            mNetAddress->ipv6.family, PR_ntohs(mNetAddress->ipv6.port)));
+     }
+ 
+     //
+@@ -1036,7 +1061,6 @@
+     if (mReadRequest) {
+         if (mReadRequest->IsCanceled() || (mBytesExpected == 0)) {
+             LOG(("nsSocketTransport: [this=%x] completing read request due to cancelation\n", this));
+-            mSelectFlags &= ~PR_POLL_READ;
+             mReadRequest->GetStatus(&readStatus);
+             CompleteAsyncRead();
+             if (NS_FAILED(readStatus))
+@@ -1078,7 +1102,6 @@
+     if (mWriteRequest) {
+         if (mWriteRequest->IsCanceled()) {
+             LOG(("nsSocketTransport: [this=%x] completing write request due to cancelation\n", this));
+-            mSelectFlags &= ~PR_POLL_WRITE;
+             mWriteRequest->GetStatus(&writeStatus);
+             CompleteAsyncWrite();
+             if (NS_FAILED(writeStatus))
+@@ -1485,23 +1508,44 @@
+     nsAutoMonitor mon(mMonitor);
+     nsresult rv = NS_OK;
+ 
+-    if (aHostEnt->hostEnt.h_addr_list && aHostEnt->hostEnt.h_addr_list[0]) {
+-        if (aHostEnt->hostEnt.h_addrtype == PR_AF_INET6)
+-            memcpy(&mNetAddress.ipv6.ip, aHostEnt->hostEnt.h_addr_list[0], sizeof(mNetAddress.ipv6.ip));
+-        else
+-            PR_ConvertIPv4AddrToIPv6(*(PRUint32*)aHostEnt->hostEnt.h_addr_list[0], &mNetAddress.ipv6.ip);
++    char **addrList = aHostEnt->hostEnt.h_addr_list;
++    
++    if (addrList && addrList[0]) {
++        PRUint32 len = 0;
++
++        LOG(("nsSocketTransport::OnFound [%s:%d %x] lookup succeeded [FQDN=%s]\n",
++            mHostName, mPort, this, aHostEnt->hostEnt.h_name));
++
++        // determine the number of address in the list
++        for (; *addrList; ++addrList)
++            ++len;
++        addrList -= len;
++
++        // allocate space for the addresses
++        mNetAddrList.Init(len);
++
++        // populate the address list
++        PRNetAddr *addr = nsnull;
++        while ((addr = mNetAddrList.GetNext(addr)) != nsnull) {
++            PR_SetNetAddr(PR_IpAddrAny, PR_AF_INET6, GetSocketPort(), addr);
++            if (aHostEnt->hostEnt.h_addrtype == PR_AF_INET6)
++                memcpy(&addr->ipv6.ip, *addrList, sizeof(addr->ipv6.ip));
++            else
++                PR_ConvertIPv4AddrToIPv6(*(PRUint32 *)(*addrList), &addr->ipv6.ip);
++            ++addrList;
+ #if defined(PR_LOGGING)
+-        char addrbuf[50];
+-        PR_NetAddrToString(&mNetAddress, addrbuf, sizeof(addrbuf));
+-        LOG(("nsSocketTransport: OnFound(...) [%s:%d %x]."
+-            "  DNS lookup succeeded => %s (%s)\n",
+-            mHostName, mPort, this,
+-            aHostEnt->hostEnt.h_name,
+-            addrbuf));
++            char buf[50];
++            PR_NetAddrToString(addr, buf, sizeof(buf));
++            LOG(("  => %s\n", buf));
+ #endif
+-    } else {
+-        // XXX: What should happen here?  The GetHostByName(...) succeeded but 
+-        //      there are *no* A records...
++        }
++
++        // start with first address in list
++        mNetAddress = mNetAddrList.GetNext(nsnull);
++    }
++    else {
++        // XXX: What should happen here?  The DNS lookup succeeded, but there
++        //      are no address records...
+         rv = NS_ERROR_FAILURE;
+ 
+         LOG(("nsSocketTransport: OnFound(...) [%s:%d %x]."
+@@ -1531,7 +1575,7 @@
+     // If the lookup failed, set the status...
+     if (NS_FAILED(aStatus))
+         mStatus = aStatus;
+-    else if (PR_IsNetAddrType(&mNetAddress, PR_IpAddrAny))
++    else if (mNetAddress == nsnull)
+         mStatus = NS_ERROR_ABORT;
+ 
+     // Start processing the transport again - if necessary...
+@@ -1852,7 +1896,7 @@
+     *_retval = (char*)nsMemory::Alloc(aLen);
+     if (!*_retval) return NS_ERROR_FAILURE;
+ 
+-    PRStatus status = PR_NetAddrToString(&mNetAddress, *_retval, aLen);
++    PRStatus status = PR_NetAddrToString(mNetAddress, *_retval, aLen);
+ 
+     if (PR_FAILURE == status) {
+         nsMemory::Free(*_retval);
+@@ -1968,6 +2012,37 @@
+     
+     if (--mSocketRef == 0)
+         CloseConnection();
++}
++
++//
++//----------------------------------------------------------------------------
++// nsSocketTransport::nsNetAddrList
++//----------------------------------------------------------------------------
++//
++
++nsresult nsSocketTransport::
++nsNetAddrList::Init(PRUint32 len)
++{
++    NS_ASSERTION(!mList, "already initialized");
++    mList = new PRNetAddr[len];
++    if (!mList)
++        return NS_ERROR_OUT_OF_MEMORY;
++    mLen = len;
++    return NS_OK;
++}
++
++PRNetAddr *nsSocketTransport::
++nsNetAddrList::GetNext(PRNetAddr *addr)
++{
++    if (!addr)
++        return mList;
++
++    PRUint32 offset = addr - mList;
++    NS_ASSERTION(offset < mLen, "invalid address");
++    if (offset + 1 < mLen)
++        return addr + 1;
++
++    return nsnull;
+ }
+ 
+ //
--- /usr/ports.ref/www/mozilla/files/patch-netwerk::base::src::nsSocketTransport.h	Thu Jan  1 02:00:00 1970
+++ www/mozilla/files/patch-netwerk::base::src::nsSocketTransport.h	Thu Feb 14 00:57:25 2002
@@ -0,0 +1,57 @@
+--- netwerk/base/src/nsSocketTransport.h.orig	Fri Feb  8 11:20:24 2002
++++ netwerk/base/src/nsSocketTransport.h	Fri Feb  8 11:20:29 2002
+@@ -176,7 +176,7 @@
+     PRFileDesc* GetSocket(void)      { return mSocketFD;    }
+     PRInt16     GetSelectFlags(void) { return mSelectFlags; }
+     PRCList*    GetListNode(void)    { return &mListLink;   }
+-    
++
+     static nsSocketTransport* GetInstance(PRCList* qp) { return (nsSocketTransport*)((char*)qp - offsetof(nsSocketTransport, mListLink)); }
+     
+     PRBool CanBeReused() { return 
+@@ -237,8 +237,27 @@
+     inline void ClearFlag(nsSocketReadWriteInfo aFlag) {
+         mReadWriteState &= ~aFlag;
+     } 
++
++    PRInt32     GetSocketPort(void)  { return (mProxyPort != -1 && !mProxyTransparent) ? mProxyPort : mPort; }
++    const char *GetSocketHost(void)  { return (mProxyHost && !mProxyTransparent) ? mProxyHost : mHostName; }
+     
+ protected:
++    class nsNetAddrList {
++    public:
++        nsNetAddrList() : mList(nsnull), mLen(0) {}
++       ~nsNetAddrList() { delete[] mList; }
++
++        // allocate space for the address list
++        nsresult Init(PRUint32 len);
++
++        // given a net addr in the list, return the next addr.
++        // if given NULL, then return the first addr in the list.
++        // returns NULL if given addr is the last addr.
++        PRNetAddr *GetNext(PRNetAddr *currentAddr);
++    private:
++        PRNetAddr *mList;
++        PRUint32   mLen;
++    };
+     
+     nsSocketState                   mCurrentState;
+     nsCOMPtr<nsIRequest>            mDNSRequest;
+@@ -249,7 +268,8 @@
+     PRIntervalTime                  mLastActiveTime;
+     PRCList                         mListLink;
+     PRMonitor*                      mMonitor;
+-    PRNetAddr                       mNetAddress;
++    nsNetAddrList                   mNetAddrList;
++    PRNetAddr                      *mNetAddress;
+     nsSocketOperation               mOperation;
+     nsCOMPtr<nsISupports>           mSecurityInfo;
+ 
+@@ -415,6 +435,7 @@
+     PRBool IsInitialized() { return mStartFired; }
+     PRBool IsSuspended() { return mSuspendCount > 0; }
+     PRBool IsCanceled() { return mCanceled; }
++    PRBool HasFailed() { return NS_FAILED(mStatus); }
+ 
+     void SetTransport(nsSocketTransport *);
+     void SetObserver(nsIRequestObserver *obs) { mObserver = obs; }
--- /usr/ports.ref/www/mozilla/files/patch-nsprpub::configure	Thu Jan  1 02:00:00 1970
+++ www/mozilla/files/patch-nsprpub::configure	Thu Feb 14 01:14:06 2002
@@ -0,0 +1,50 @@
+--- nsprpub/configure.orig	Tue Jan 22 23:57:37 2002
++++ nsprpub/configure	Thu Feb 14 01:13:13 2002
+@@ -3288,8 +3288,9 @@
+     else
+         DLL_SUFFIX=so.1.0
+     fi
++    MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+     DSO_CFLAGS=-fPIC
+-    DSO_LDOPTS=-Bshareable
++    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
+     MDCPUCFG_H=_freebsd.cfg
+     PR_MD_CSRCS=freebsd.c
+     ;;
+@@ -5091,8 +5092,15 @@
+    if test $? -eq 0; then
+ 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
+ 	    ac_cv_have_dash_pthread=yes
+-	    CFLAGS="$CFLAGS -pthread"
+-	    CXXFLAGS="$CXXFLAGS -pthread"
++		case "$target_os" in
++	    freebsd*)
++# Freebsd doesn't use -pthread for compiles, it uses them for linking
++            ;;
++	    *)
++            CFLAGS="$CFLAGS -pthread"
++            CXXFLAGS="$CXXFLAGS -pthread"
++            ;;
++        esac
+ 	fi
+     fi
+     rm -f conftest*
+@@ -5123,11 +5131,17 @@
+ 	    ;;
+     *-freebsd*|*-openbsd*|*-bsdi*|*-netbsd*)
+ 	    cat >> confdefs.h <<\EOF
++#define _REENTRANT 1
++EOF
++
++	    cat >> confdefs.h <<\EOF
+ #define _THREAD_SAFE 1
+ EOF
+ 
+ 	    	    if test "$ac_cv_have_dash_pthread" = "yes"; then
+-	        _PTHREAD_LDFLAGS=
++	        _PTHREAD_LDFLAGS="-pthread"
++	    else
++	        _PTHREAD_LDFLAGS="-lc_r"
+ 	    fi
+ 	    ;;
+     *-linux*)
--- /usr/ports.ref/www/mozilla/files/patch-nsprpub::pr::include::md::_freebsd.cfg	Wed Dec 26 12:21:21 2001
+++ www/mozilla/files/patch-nsprpub::pr::include::md::_freebsd.cfg	Wed Feb 13 22:33:15 2002
@@ -1,13 +0,0 @@
---- nsprpub/pr/include/md/_freebsd.cfg.orig	Mon Nov 26 17:07:20 2001
-+++ nsprpub/pr/include/md/_freebsd.cfg	Mon Nov 26 17:15:01 2001
-@@ -93,8 +93,8 @@
- 
- #elif defined(__alpha)
- 
--#define IS_LITTLE_ENDIAN 1
--#undef  IS_BIG_ENDIAN
-+#define	IS_64
-+
- #define	HAVE_LONG_LONG
- #define	HAVE_ALIGNED_DOUBLES
- #define	HAVE_ALIGNED_LONGLONGS
--- /usr/ports.ref/www/mozilla/files/patch-qt	Thu Jan  3 23:01:34 2002
+++ www/mozilla/files/patch-qt	Wed Feb 13 22:39:21 2002
@@ -40,11 +40,3 @@
      QT_LIBS="-L/usr/X11R6/lib -L${QTDIR}/lib -lqt -lXext -lX11"
  
      # Check whether --with-static-qt or --without-static-qt was given.
-@@ -13711,6 +13712,7 @@
-     echo "configure: warning: Recreating autoconf.mk with updated nspr-config output" 1>&2
-     if test ! "$VACPP" && test -z "$_WIN32_MSVC"; then
-         NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$MOZ_BUILD_ROOT/dist --exec-prefix=$MOZ_BUILD_ROOT/dist --libs`
-+	NSPR_LIBS="$NSPR_LIBS $BSD_PTHREAD_LIBS"
-         $PERL -pi.bak -e "s {^NSPR_LIBS\s*=.*} {NSPR_LIBS = $NSPR_LIBS }" config/autoconf.mk
-     fi
-     if test -z "$_WIN32_MSVC"; then
--- /usr/ports.ref/www/mozilla/files/patch-security::coreconf::FreeBSD.mk	Thu Jan  1 02:00:00 1970
+++ www/mozilla/files/patch-security::coreconf::FreeBSD.mk	Thu Feb 14 14:20:47 2002
@@ -0,0 +1,50 @@
+--- security/coreconf/FreeBSD.mk.orig	Tue Sep 19 05:53:08 2000
++++ security/coreconf/FreeBSD.mk	Thu Feb 14 14:19:02 2002
+@@ -35,27 +35,27 @@
+ 
+ include $(CORE_DEPTH)/coreconf/UNIX.mk
+ 
+-DEFAULT_COMPILER	= gcc
+-CC			= gcc
+-CCC			= g++
++CCC			= ${CXX}
+ RANLIB			= ranlib
+ 
+ ifeq ($(OS_TEST),alpha)
+ CPU_ARCH		= alpha
+ else
+-OS_REL_CFLAGS		= -Di386
+ CPU_ARCH		= x86
+ endif
+ 
+-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
++OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
++
++DSO_CFLAGS		= -fPIC
++DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
+ 
+ #
+ # The default implementation strategy for FreeBSD is pthreads.
+ #
+ ifndef CLASSIC_NSPR
+ USE_PTHREADS		= 1
+-DEFINES			+= -D_THREAD_SAFE
+-THREAD_FLAG		= -pthread
++DEFINES			+= -D_THREAD_SAFE -D_REENTRANT
++DSO_LDOPTS	+= -pthread
+ endif
+ 
+ ARCH			= freebsd
+@@ -68,11 +68,7 @@
+ DLL_SUFFIX		= so.1.0
+ endif
+ 
+-DSO_CFLAGS		= -fPIC
+-DSO_LDOPTS		= -Bshareable
+-DSO_LDFLAGS		=
+-
+-MKSHLIB			= $(LD) $(DSO_LDOPTS)
++MKSHLIB			= $(CC) $(DSO_LDOPTS) -o $@
+ 
+ G++INCLUDES		= -I/usr/include/g++
+ 
--- /usr/ports.ref/www/mozilla/files/tar-exclude	Thu Jan  1 02:00:00 1970
+++ www/mozilla/files/tar-exclude	Wed Feb 13 22:33:15 2002
@@ -0,0 +1,6 @@
+*/CVS/*
+*/macbuild/*
+*/package/*
+.cvsignore
+makefile.win
+MANIFEST
--- /usr/ports.ref/www/mozilla/pkg-plist	Mon Feb 11 22:01:57 2002
+++ www/mozilla/pkg-plist	Thu Feb 14 11:07:08 2002
@@ -1,85 +1,12 @@
 bin/mozilla
-lib/mozilla/DumpColors
-lib/mozilla/FilesTest
-lib/mozilla/OutTestData/doctype.xif
-lib/mozilla/OutTestData/entityxif.out
-lib/mozilla/OutTestData/entityxif.xif
-lib/mozilla/OutTestData/htmltable.html
-lib/mozilla/OutTestData/htmltable.out
-lib/mozilla/OutTestData/mailquote.html
-lib/mozilla/OutTestData/mailquote.out
-lib/mozilla/OutTestData/plain.html
-lib/mozilla/OutTestData/plainnowrap.out
-lib/mozilla/OutTestData/plainwrap.out
-lib/mozilla/OutTestData/simple.html
-lib/mozilla/OutTestData/simplecopy.out
-lib/mozilla/OutTestData/simplefmt.out
-lib/mozilla/OutTestData/simplemail.html
-lib/mozilla/OutTestData/simplemail.out
-lib/mozilla/OutTestData/xifdthtml.out
-lib/mozilla/OutTestData/xifdtplain.out
-lib/mozilla/OutTestData/xifstuff.out
-lib/mozilla/OutTestData/xifstuff.xif
-lib/mozilla/PrimitiveTest
-lib/mozilla/PropertiesTest
-lib/mozilla/SimpleTypeLib
-lib/mozilla/StringBundleTest
-lib/mozilla/TestArray
-lib/mozilla/TestAtoms
-lib/mozilla/TestAutoLock
-lib/mozilla/TestCOMPtr
-lib/mozilla/TestCOMPtrEq
-lib/mozilla/TestCRT
-lib/mozilla/TestCSSPropertyLookup
-lib/mozilla/TestCallTemplates
-lib/mozilla/TestCallbacks
-lib/mozilla/TestColorNames
-lib/mozilla/TestCookie
-lib/mozilla/TestDBMAccess
-lib/mozilla/TestFactory
-lib/mozilla/TestFileInput
-lib/mozilla/TestFileInput2
-lib/mozilla/TestFileTransport
 lib/mozilla/TestGtkEmbed
 lib/mozilla/TestGtkEmbedChild
 lib/mozilla/TestGtkEmbedNotebook
 lib/mozilla/TestGtkEmbedSocket
-lib/mozilla/TestHttp
-lib/mozilla/TestID
-lib/mozilla/TestIDN
-lib/mozilla/TestInterfaceInfo
-lib/mozilla/TestLineBreak
-lib/mozilla/TestMCTransport
-lib/mozilla/TestObserverService
-lib/mozilla/TestOutSinks.pl
-lib/mozilla/TestOutput
-lib/mozilla/TestPageLoad
-lib/mozilla/TestPerf
-lib/mozilla/TestPermanentAtoms
-lib/mozilla/TestPipes
-lib/mozilla/TestProtocols
-lib/mozilla/TestRect
-lib/mozilla/TestServMgr
-lib/mozilla/TestSocketIO
-lib/mozilla/TestSocketInput
-lib/mozilla/TestSocketTransport
-lib/mozilla/TestSpaceManager
-lib/mozilla/TestStandardURL
-lib/mozilla/TestStreamConv
-lib/mozilla/TestTXMgr
-lib/mozilla/TestThreads
-lib/mozilla/TestURLParser
-lib/mozilla/TestVoidBTree
-lib/mozilla/TestXMLExtras
-lib/mozilla/TestXPC
-lib/mozilla/TestXPIDLString
-lib/mozilla/TestXPTCInvoke
-lib/mozilla/UnicharSelfTest
 lib/mozilla/bloaturls.txt
 lib/mozilla/chrome/US.jar
 lib/mozilla/chrome/chatzilla.jar
 lib/mozilla/chrome/chrome.rdf
-@unexec rm -f %D/lib/mozilla/chrome/chrome.rdf || true
 lib/mozilla/chrome/chromelist.txt
 lib/mozilla/chrome/classic.jar
 lib/mozilla/chrome/comm.jar
@@ -105,7 +32,6 @@
 lib/mozilla/chrome/toolkit.jar
 lib/mozilla/chrome/venkman.jar
 lib/mozilla/component.reg
-@unexec rm -f %D/lib/mozilla/component.reg || true
 lib/mozilla/components/absync.xpt
 lib/mozilla/components/accessibility.xpt
 lib/mozilla/components/addrbook.xpt
@@ -158,7 +84,6 @@
 lib/mozilla/components/layout_base.xpt
 lib/mozilla/components/layout_xul.xpt
 lib/mozilla/components/layout_xul_outliner.xpt
-lib/mozilla/components/libMyService.so
 lib/mozilla/components/libabsyncsvc.so
 lib/mozilla/components/libaccessibility.so
 lib/mozilla/components/libaddrbook.so
@@ -226,10 +151,8 @@
 lib/mozilla/components/libprofile.so
 lib/mozilla/components/librdf.so
 lib/mozilla/components/libregviewer.so
-lib/mozilla/components/libsample.so
 lib/mozilla/components/libshistory.so
 lib/mozilla/components/libstrres.so
-lib/mozilla/components/libtestdynamic.so
 lib/mozilla/components/libtransformiix.so
 lib/mozilla/components/libtxmgr.so
 lib/mozilla/components/libtxtsvc.so
@@ -251,7 +174,6 @@
 lib/mozilla/components/libwidget_gtk.so
 lib/mozilla/components/libxmlextras.so
 lib/mozilla/components/libxpconnect.so
-lib/mozilla/components/libxpctest.so
 lib/mozilla/components/libxpinstall.so
 lib/mozilla/components/libxremote_client.so
 lib/mozilla/components/libxremoteservice.so
@@ -288,7 +210,6 @@
 lib/mozilla/components/nsHelperAppDlg.js
 lib/mozilla/components/nsLDAPPrefsService.js
 lib/mozilla/components/nsProxyAutoConfig.js
-lib/mozilla/components/nsSample.js
 lib/mozilla/components/nsSidebar.js
 lib/mozilla/components/nsXmlRpcClient.js
 lib/mozilla/components/oji.xpt
@@ -300,11 +221,9 @@
 lib/mozilla/components/prefmigr.xpt
 lib/mozilla/components/profile.xpt
 lib/mozilla/components/proxyObjInst.xpt
-lib/mozilla/components/proxytest.xpt
 lib/mozilla/components/rdf.xpt
 lib/mozilla/components/regviewer.xpt
 lib/mozilla/components/related.xpt
-lib/mozilla/components/sample.xpt
 lib/mozilla/components/search.xpt
 lib/mozilla/components/shistory.xpt
 lib/mozilla/components/sidebar.xpt
@@ -336,10 +255,8 @@
 lib/mozilla/components/xpcom_threads.xpt
 lib/mozilla/components/xpcom_xpti.xpt
 lib/mozilla/components/xpconnect.xpt
-lib/mozilla/components/xpconnect_tests.xpt
 lib/mozilla/components/xpinstall.xpt
 lib/mozilla/components/xpti.dat
-@unexec rm -f %D/lib/mozilla/components/xpti.dat || true
 lib/mozilla/components/xremoteservice.xpt
 lib/mozilla/components/xuldoc.xpt
 lib/mozilla/components/xultmpl.xpt
@@ -378,10 +295,8 @@
 lib/mozilla/dirver
 lib/mozilla/dtd/mathml.dtd
 lib/mozilla/dtd/svg.dtd
-lib/mozilla/htmlrobot
 lib/mozilla/icons/mozicon16.xpm
 lib/mozilla/icons/mozicon50.xpm
-lib/mozilla/libDebugRobot.so
 lib/mozilla/libgkgfx.so
 lib/mozilla/libgtkembedmoz.so
 lib/mozilla/libgtksuperwin.so
@@ -400,20 +315,12 @@
 lib/mozilla/libxlibrgb.so
 lib/mozilla/libxpcom.so
 lib/mozilla/libxpistub.so
-lib/mozilla/lots
 lib/mozilla/mozilla
 lib/mozilla/mozilla-bin
 lib/mozilla/mozilla-config
-lib/mozilla/mozilla-viewer.sh
 lib/mozilla/mozilla-xremote-client
-lib/mozilla/nsIFileEnumerator
-lib/mozilla/nsIFileTest
-lib/mozilla/nsTestSample
 lib/mozilla/nsinstall
 lib/mozilla/plugins/libnullplugin.so
-lib/mozilla/proxytests
-lib/mozilla/rdfcat
-lib/mozilla/rdfpoll
 lib/mozilla/regExport
 lib/mozilla/regchrome
 lib/mozilla/regxpcom
@@ -454,7 +361,6 @@
 lib/mozilla/res/html/gopher-unknown.gif
 lib/mozilla/res/inspector/search-registry.rdf
 lib/mozilla/res/inspector/viewer-registry.rdf
-lib/mozilla/res/jarlist.dat
 lib/mozilla/res/langGroups.properties
 lib/mozilla/res/language.properties
 lib/mozilla/res/loading-image.gif
@@ -489,7 +395,6 @@
 lib/mozilla/res/samples/dexopenchrome.xul
 lib/mozilla/res/samples/dexparamdialog.html
 lib/mozilla/res/samples/dexparamdialog.xul
-lib/mozilla/res/samples/embed-test.html
 lib/mozilla/res/samples/find.html
 lib/mozilla/res/samples/gear1.gif
 lib/mozilla/res/samples/hidetoolicon.css
@@ -544,15 +449,8 @@
 lib/mozilla/res/samples/treeTest1.css
 lib/mozilla/res/samples/treeTest1.xul
 lib/mozilla/res/samples/widgets.xul
-lib/mozilla/res/samples/xpconnect-sample.html
 lib/mozilla/res/samples/xpmenu.xul
 lib/mozilla/res/samples/xulTest.css
-lib/mozilla/res/strres-test.dtd
-lib/mozilla/res/strres-test.html
-lib/mozilla/res/strres-test.js
-lib/mozilla/res/strres-test.xul
-lib/mozilla/res/strres.properties
-lib/mozilla/res/test.properties
 lib/mozilla/res/throbber/anim.gif
 lib/mozilla/res/throbber/anims00.gif
 lib/mozilla/res/throbber/anims01.gif
@@ -586,8 +484,6 @@
 lib/mozilla/res/throbber/anims29.gif
 lib/mozilla/res/ua.css
 lib/mozilla/res/unixcharset.properties
-lib/mozilla/res/urlparse.dat
-lib/mozilla/res/urlparse_unx.dat
 lib/mozilla/res/viewer.properties
 lib/mozilla/res/viewsource.css
 lib/mozilla/run-mozilla.sh
@@ -603,16 +499,14 @@
 lib/mozilla/searchplugins/lxrmozilla.src
 lib/mozilla/searchplugins/mozilla.gif
 lib/mozilla/searchplugins/mozilla.src
-lib/mozilla/testart
-lib/mozilla/testuta
-lib/mozilla/urltest
-lib/mozilla/viewer
-lib/mozilla/viewer_gtk
 lib/mozilla/xpcshell
 lib/mozilla/xpicleanup
 lib/mozilla/xpidl
 lib/mozilla/xpt_dump
 lib/mozilla/xpt_link
+@unexec rm -f %D/lib/mozilla/chrome/chrome.rdf || true
+@unexec rm -f %D/lib/mozilla/component.reg || true
+@unexec rm -f %D/lib/mozilla/components/xpti.dat || true
 @dirrm lib/mozilla/searchplugins
 @dirrm lib/mozilla/res/throbber
 @dirrm lib/mozilla/res/samples/sampleimages
@@ -649,5 +543,4 @@
 @dirrm lib/mozilla/chrome/overlayinfo/communicator
 @dirrm lib/mozilla/chrome/overlayinfo
 @dirrm lib/mozilla/chrome
-@dirrm lib/mozilla/OutTestData
 @dirrm lib/mozilla

#!/bin/sh

cvs co ports/www/mozilla
cd ports
patch -EIp0 < ../www.mozilla.patch
find * -name '*.orig' -delete
cd ..
cd ports/www/mozilla
for f in  files/patch-netwerk::base::src::nsSocketTransport.cpp files/patch-netwerk::base::src::nsSocketTransport.h files/patch-nsprpub::configure files/patch-security::coreconf::FreeBSD.mk files/tar-exclude; do
 if [ -d $f ]; then
  cvs add $f
  for p in $(ls  files/patch-netwerk::base::src::nsSocketTransport.cpp files/patch-netwerk::base::src::nsSocketTransport.h files/patch-nsprpub::configure files/patch-security::coreconf::FreeBSD.mk files/tar-exclude); do
   cvs add $f/$p
  done;
 else
  cvs add $f
 fi
done;
for f in  files/patch-mi files/patch-nsprpub::pr::include::md::_freebsd.cfg; do
 cvs remove $f
done;
cd ../../..


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-gnome" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020214181917.A64409>