Package: xulrunner
Severity: important
Version: 1.8.0.5-4.2
Tags: patch

Hi,

the current version fails to build on GNU/kFreeBSD.
Please find attached patch to fix that.

It adds
 * 18_kbsd_nsprpub.dpatch - port of nsprpub for kfreebsd-i386,
   already merged upstream
 * 88_kbsd.dpatch - port of xulrunner for kfreebsd-i386,
   mainly changes selected "defined(LINUX)" into
   "defined(LINUX) || defined(__GLIBC__)"

and list them in 00list, updates 99_configure.dpatch.

It would be nice if it could be included in the next upload.

Thanks

                Petr
diff -urN r/xulrunner-1.8.0.5/debian/patches/00list 
xulrunner-1.8.0.5/debian/patches/00list
--- r/xulrunner-1.8.0.5/debian/patches/00list   2006-09-20 14:16:10.000000000 
+0200
+++ xulrunner-1.8.0.5/debian/patches/00list     2006-09-20 14:11:41.000000000 
+0200
@@ -25,6 +25,7 @@
 15_passwdmgr
 15_pyxpcom_deadcode
 18_arm_xpcom_unused_attribute
+18_kbsd_nsprpub
 18_m68k_xpcom
 20_about:plugins
 20_broken_perl
@@ -77,4 +78,5 @@
 85_sidebar
 85_useragent
 85_xpcomglue
+88_kbsd
 99_configure
diff -urN r/xulrunner-1.8.0.5/debian/patches/18_kbsd_nsprpub.dpatch 
xulrunner-1.8.0.5/debian/patches/18_kbsd_nsprpub.dpatch
--- r/xulrunner-1.8.0.5/debian/patches/18_kbsd_nsprpub.dpatch   1970-01-01 
01:00:00.000000000 +0100
+++ xulrunner-1.8.0.5/debian/patches/18_kbsd_nsprpub.dpatch     2006-09-20 
14:11:28.000000000 +0200
@@ -0,0 +1,400 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 18_kbsd_nsprpub.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: port nsprpub for kfreebsd-i386. bz#261649
+## DP: taken from 
https://bugzilla.mozilla.org/attachment.cgi?id=206765&action=view
+
[EMAIL PROTECTED]@
+
+Index: a/nsprpub/configure.in
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/configure.in,v
+retrieving revision 1.83.2.123
+retrieving revision 1.210
+diff -u -r1.83.2.123 -r1.210
+--- a/nsprpub/configure.in     22 Dec 2005 22:45:32 -0000      1.83.2.123
++++ a/nsprpub/configure.in     24 Dec 2005 08:25:22 -0000      1.210
+@@ -1336,7 +1336,7 @@
+       esac
+     ;;
+ 
+-*-linux*)
++*-linux*|*-gnu*|*-k*bsd*-gnu)
+     if test -z "$USE_NSPR_THREADS"; then
+         USE_PTHREADS=1
+         IMPL_STRATEGY=_PTH
+@@ -1347,7 +1347,11 @@
+     AC_DEFINE(_SVID_SOURCE)
+     AC_DEFINE(_LARGEFILE64_SOURCE)
+     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
+-    AC_DEFINE(LINUX)
++    case "${target_os}" in
++    linux*)
++        AC_DEFINE(LINUX)
++        ;;
++    esac
+     CFLAGS="$CFLAGS -ansi -Wall"
+     CXXFLAGS="$CXXFLAGS -ansi -Wall"
+     MDCPUCFG_H=_linux.cfg
+@@ -2442,7 +2446,7 @@
+             _PTHREAD_LDFLAGS=-pthread
+         fi
+         ;;
+-    *-linux*)
++    *-linux*|*-gnu*|*-k*bsd*-gnu)
+         AC_DEFINE(_REENTRANT)
+         ;;
+     esac
+@@ -2526,7 +2530,7 @@
+         fi
+     fi
+     ;;
+-*-linux*)
++*-linux*|*-gnu*|*-k*bsd*-gnu)
+     if test -n "$USE_NSPR_THREADS"; then
+         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
+     fi
+Index: a/nsprpub/config/nsinstall.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/config/nsinstall.c,v
+retrieving revision 3.17.2.3
+retrieving revision 3.21
+diff -u -r3.17.2.3 -r3.21
+--- a/nsprpub/config/nsinstall.c       28 Apr 2004 00:33:11 -0000      3.17.2.3
++++ a/nsprpub/config/nsinstall.c       24 Dec 2005 15:03:29 -0000      3.21
+@@ -98,7 +98,7 @@
+ }
+ #endif /* NEXTSTEP */
+ 
+-#ifdef LINUX
++#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
+ #include <getopt.h>
+ #endif
+ 
+Index: a/nsprpub/pr/include/md/_linux.cfg
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/include/md/_linux.cfg,v
+retrieving revision 3.12.4.8
+retrieving revision 3.19
+diff -u -r3.12.4.8 -r3.19
+--- a/nsprpub/pr/include/md/_linux.cfg 15 Aug 2005 17:53:33 -0000      3.12.4.8
++++ a/nsprpub/pr/include/md/_linux.cfg 24 Dec 2005 08:25:22 -0000      3.19
+@@ -35,6 +35,11 @@
+  *
+  * ***** END LICENSE BLOCK ***** */
+ 
++/*
++ * This file is used by not only Linux but also other glibc systems
++ * such as GNU/Hurd and GNU/k*BSD.
++ */
++
+ #ifndef nspr_cpucfg___
+ #define nspr_cpucfg___
+ 
+@@ -42,7 +47,7 @@
+ #define XP_UNIX
+ #endif
+ 
+-#ifndef LINUX
++#if !defined(LINUX) && defined(__linux__)
+ #define LINUX
+ #endif
+ 
+Index: a/nsprpub/pr/include/md/_pth.h
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/include/md/_pth.h,v
+retrieving revision 3.19.2.13
+retrieving revision 3.32
+diff -u -r3.19.2.13 -r3.32
+--- a/nsprpub/pr/include/md/_pth.h     15 Aug 2005 17:53:33 -0000      
3.19.2.13
++++ a/nsprpub/pr/include/md/_pth.h     24 Dec 2005 15:03:30 -0000      3.32
+@@ -143,10 +143,15 @@
+       (!memcmp(&(t), &pt_zero_tid, sizeof(pthread_t)))
+ #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
+ #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
+-      || defined(HPUX) || defined(LINUX) || defined(FREEBSD) \
++      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
++      || defined(HPUX) || defined(FREEBSD) \
+       || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
+       || defined(VMS) || defined(NTO) || defined(DARWIN) \
+       || defined(UNIXWARE) || defined(RISCOS)
++#ifdef __GNU__
++/* Hurd pthreads don't have an invalid value for pthread_t. -- rmh */
++#error Using Hurd pthreads
++#endif
+ #define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = 0
+ #define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t)  (t) == 0
+ #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
+@@ -195,7 +200,8 @@
+ /*
+  * These platforms don't have sigtimedwait()
+  */
+-#if (defined(AIX) && !defined(AIX4_3_PLUS)) || defined(LINUX) \
++#if (defined(AIX) && !defined(AIX4_3_PLUS)) \
++      || defined(LINUX) || defined(__GNU__)|| defined(__GLIBC__) \
+       || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
+       || defined(BSDI) || defined(VMS) || defined(UNIXWARE) \
+       || defined(DARWIN)
+@@ -235,7 +241,8 @@
+ #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
+ #endif /* defined(_PR_DCETHREADS) */
+ 
+-#elif defined(LINUX) || defined(FREEBSD)
++#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
++      || defined(FREEBSD)
+ #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
+ #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
+ #elif defined(NTO)
+@@ -291,7 +298,8 @@
+               onemillisec.tv_nsec = 1000000L;                 \
+         nanosleep(&onemillisec,NULL);                 \
+     PR_END_MACRO
+-#elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
++#elif defined(HPUX) || defined(SOLARIS) \
++      || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
+       || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
+       || defined(BSDI) || defined(NTO) || defined(DARWIN) \
+       || defined(UNIXWARE) || defined(RISCOS)
+Index: a/nsprpub/pr/include/md/_unixos.h
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/include/md/_unixos.h,v
+retrieving revision 3.31.4.4
+retrieving revision 3.36
+diff -u -r3.31.4.4 -r3.36
+--- a/nsprpub/pr/include/md/_unixos.h  17 Jan 2005 22:13:36 -0000      3.31.4.4
++++ a/nsprpub/pr/include/md/_unixos.h  24 Dec 2005 08:25:23 -0000      3.36
+@@ -46,7 +46,8 @@
+  * Linux: FD_SETSIZE is defined in /usr/include/sys/select.h and should
+  * not be redefined.
+  */
+-#if !defined(LINUX) && !defined(DARWIN) && !defined(NEXTSTEP)
++#if !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__) \
++    && !defined(DARWIN) && !defined(NEXTSTEP)
+ #ifndef FD_SETSIZE
+ #define FD_SETSIZE  4096
+ #endif
+Index: a/nsprpub/pr/include/md/prosdep.h
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/include/md/prosdep.h,v
+retrieving revision 3.13.4.3
+retrieving revision 3.17
+diff -u -r3.13.4.3 -r3.17
+--- a/nsprpub/pr/include/md/prosdep.h  15 Aug 2005 17:53:33 -0000      3.13.4.3
++++ a/nsprpub/pr/include/md/prosdep.h  24 Dec 2005 08:25:23 -0000      3.17
+@@ -90,7 +90,7 @@
+ #elif defined(IRIX)
+ #include "md/_irix.h"
+ 
+-#elif defined(LINUX)
++#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)
+ #include "md/_linux.h"
+ 
+ #elif defined(OSF1)
+Index: a/nsprpub/pr/src/linking/Makefile.in
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/linking/Makefile.in,v
+retrieving revision 1.10.2.5
+retrieving revision 1.17
+diff -u -r1.10.2.5 -r1.17
+--- a/nsprpub/pr/src/linking/Makefile.in       26 Oct 2005 19:05:10 -0000      
1.10.2.5
++++ a/nsprpub/pr/src/linking/Makefile.in       24 Dec 2005 15:03:30 -0000      
1.17
+@@ -63,7 +63,7 @@
+ INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include 
-I$(topsrcdir)/pr/include/private
+ 
+ # For Dl_info and dladdr.
+-ifeq ($(OS_TARGET),Linux)
++ifeq (,$(filter-out Linux GNU GNU_%,$(OS_TARGET)))
+ DEFINES    += -D_GNU_SOURCE
+ endif
+ 
+Index: a/nsprpub/pr/src/linking/prlink.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/linking/prlink.c,v
+retrieving revision 3.51.2.28
+retrieving revision 3.84
+diff -u -r3.51.2.28 -r3.84
+--- a/nsprpub/pr/src/linking/prlink.c  7 Nov 2005 22:07:32 -0000       
3.51.2.28
++++ a/nsprpub/pr/src/linking/prlink.c  24 Dec 2005 15:03:30 -0000      3.84
+@@ -1388,7 +1388,8 @@
+ PR_IMPLEMENT(char *)
+ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
+ {
+-#if defined(SOLARIS) || defined(LINUX) || defined(FREEBSD)
++#if defined(SOLARIS) || defined(FREEBSD) \
++        || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)
+     Dl_info dli;
+     char *result;
+ 
+Index: a/nsprpub/pr/src/md/prosdep.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/prosdep.c,v
+retrieving revision 3.9.4.2
+retrieving revision 3.12
+diff -u -r3.9.4.2 -r3.12
+--- a/nsprpub/pr/src/md/prosdep.c      28 Apr 2004 00:33:56 -0000      3.9.4.2
++++ a/nsprpub/pr/src/md/prosdep.c      24 Dec 2005 08:25:29 -0000      3.12
+@@ -63,7 +63,8 @@
+ 
+     /* Get page size */
+ #ifdef XP_UNIX
+-#if defined SUNOS4 || defined LINUX || defined BSDI || defined AIX \
++#if defined SUNOS4 || defined BSDI || defined AIX \
++        || defined LINUX || defined __GNU__ || defined __GLIBC__ \
+         || defined FREEBSD || defined NETBSD || defined OPENBSD \
+         || defined DARWIN || defined NEXTSTEP
+     _pr_pageSize = getpagesize();
+Index: a/nsprpub/pr/src/md/unix/unix.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/unix.c,v
+retrieving revision 3.43.2.8
+retrieving revision 3.52
+diff -u -r3.43.2.8 -r3.52
+--- a/nsprpub/pr/src/md/unix/unix.c    15 Aug 2005 17:53:43 -0000      3.43.2.8
++++ a/nsprpub/pr/src/md/unix/unix.c    24 Dec 2005 08:25:29 -0000      3.52
+@@ -65,7 +65,7 @@
+  * PRInt32* pointer to a _PRSockLen_t* pointer.
+  */
+ #if defined(HAVE_SOCKLEN_T) \
+-    || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
++    || (defined(__GLIBC__) && __GLIBC__ >= 2)
+ #define _PRSockLen_t socklen_t
+ #elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \
+     || defined(AIX4_1) || defined(LINUX) || defined(SONY) \
+Index: a/nsprpub/pr/src/md/unix/uxproces.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/uxproces.c,v
+retrieving revision 3.14.2.5
+retrieving revision 3.20
+diff -u -r3.14.2.5 -r3.20
+--- a/nsprpub/pr/src/md/unix/uxproces.c        15 Dec 2004 05:52:40 -0000      
3.14.2.5
++++ a/nsprpub/pr/src/md/unix/uxproces.c        24 Dec 2005 08:25:29 -0000      
3.20
+@@ -92,7 +92,8 @@
+  * that can share the virtual address space and file descriptors.
+  */
+ #if (defined(IRIX) && !defined(_PR_PTHREADS)) \
+-        || (defined(LINUX) && defined(_PR_PTHREADS))
++        || ((defined(LINUX) || defined(__GNU__) || defined(__GLIBC__)) \
++        && defined(_PR_PTHREADS))
+ #define _PR_SHARE_CLONES
+ #endif
+ 
+@@ -106,7 +107,8 @@
+  */
+ 
+ #if defined(_PR_GLOBAL_THREADS_ONLY) \
+-      || (defined(_PR_PTHREADS) && !defined(LINUX))
++      || (defined(_PR_PTHREADS) \
++      && !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__))
+ #define _PR_NATIVE_THREADS
+ #endif
+ 
+Index: a/nsprpub/pr/src/md/unix/uxrng.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/uxrng.c,v
+retrieving revision 1.11.4.5
+retrieving revision 1.19
+diff -u -r1.11.4.5 -r1.19
+--- a/nsprpub/pr/src/md/unix/uxrng.c   15 Aug 2005 17:53:43 -0000      1.11.4.5
++++ a/nsprpub/pr/src/md/unix/uxrng.c   24 Dec 2005 08:25:29 -0000      1.19
+@@ -138,7 +138,8 @@
+     return 0;
+ }
+ 
+-#elif (defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || 
defined(OPENBSD))
++#elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
++    || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD))
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+Index: a/nsprpub/pr/src/misc/prnetdb.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v
+retrieving revision 3.21.2.26
+retrieving revision 3.48
+diff -u -r3.21.2.26 -r3.48
+--- a/nsprpub/pr/src/misc/prnetdb.c    15 Aug 2005 17:53:52 -0000      
3.21.2.26
++++ a/nsprpub/pr/src/misc/prnetdb.c    24 Dec 2005 08:25:30 -0000      3.48
+@@ -108,7 +108,7 @@
+ #define _PR_HAVE_GETPROTO_R_INT
+ #endif
+ 
+-#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
++#if (defined(__GLIBC__) && __GLIBC__ >= 2)
+ #define _PR_HAVE_GETPROTO_R
+ #define _PR_HAVE_5_ARG_GETPROTO_R
+ #endif
+Index: a/nsprpub/pr/src/pthreads/ptio.c
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c,v
+retrieving revision 3.71.2.23
+retrieving revision 3.103
+diff -u -r3.71.2.23 -r3.103
+--- a/nsprpub/pr/src/pthreads/ptio.c   7 Nov 2005 22:23:25 -0000       
3.71.2.23
++++ a/nsprpub/pr/src/pthreads/ptio.c   24 Dec 2005 08:25:30 -0000      3.103
+@@ -205,7 +205,8 @@
+ #define _PRSelectFdSetArg_t void *
+ #elif defined(IRIX) || (defined(AIX) && !defined(AIX4_1)) \
+     || defined(OSF1) || defined(SOLARIS) \
+-    || defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
++    || defined(HPUX10_30) || defined(HPUX11) \
++    || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
+     || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
+     || defined(BSDI) || defined(VMS) || defined(NTO) || defined(DARWIN) \
+     || defined(UNIXWARE) || defined(RISCOS)
+@@ -289,7 +290,7 @@
+  * most current systems.
+  */
+ #if defined(HAVE_SOCKLEN_T) \
+-    || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
++    || (defined(__GLIBC__) && __GLIBC__ >= 2)
+ typedef socklen_t pt_SockLen;
+ #elif (defined(AIX) && !defined(AIX4_1)) \
+     || defined(VMS)
+@@ -3230,7 +3231,8 @@
+ };
+ 
+ #if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
+-    || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
++    || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
++    || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
+     || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO) \
+     || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS)
+ #define _PR_FCNTL_FLAGS O_NONBLOCK
+@@ -4727,7 +4729,8 @@
+ 
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX)
++#if !defined(SUNOS4) && !defined(HPUX) \
++    && !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__)
+ #include <sys/select.h>
+ #endif
+ 
+Index: a/nsprpub/pr/tests/Makefile.in
+===================================================================
+RCS file: /cvsroot/mozilla/nsprpub/pr/tests/Makefile.in,v
+retrieving revision 1.34.2.13
+retrieving revision 1.49
+diff -u -r1.34.2.13 -r1.49
+--- a/nsprpub/pr/tests/Makefile.in     28 Apr 2004 00:34:16 -0000      
1.34.2.13
++++ a/nsprpub/pr/tests/Makefile.in     24 Dec 2005 15:03:31 -0000      1.49
+@@ -376,14 +376,10 @@
+     EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
+ endif
+ 
+-ifeq ($(OS_ARCH), Linux)
+-    ifeq ($(OS_RELEASE), 1.2)
+-        EXTRA_LIBS = -ldl
+-    else
+-        LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
+-        ifeq ($(USE_PTHREADS),1)
+-            EXTRA_LIBS = -lpthread
+-        endif
++ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
++    LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
++    ifeq ($(USE_PTHREADS),1)
++        EXTRA_LIBS = -lpthread
+     endif
+ endif
+ 
diff -urN r/xulrunner-1.8.0.5/debian/patches/88_kbsd.dpatch 
xulrunner-1.8.0.5/debian/patches/88_kbsd.dpatch
--- r/xulrunner-1.8.0.5/debian/patches/88_kbsd.dpatch   1970-01-01 
01:00:00.000000000 +0100
+++ xulrunner-1.8.0.5/debian/patches/88_kbsd.dpatch     2006-09-20 
14:11:29.000000000 +0200
@@ -0,0 +1,336 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 88_kbsd.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: port xulrunner for kfreebsd-i386
+## DP: it builds fine, but it needs more testing 
+
+
[EMAIL PROTECTED]@
+
+diff -ur mozilla.old/directory/c-sdk/ldap/include/portable.h 
mozilla/directory/c-sdk/ldap/include/portable.h
+--- mozilla.old/directory/c-sdk/ldap/include/portable.h        2003-09-17 
05:18:10.000000000 +0200
++++ mozilla/directory/c-sdk/ldap/include/portable.h    2005-12-24 
19:14:23.000000000 +0100
+@@ -116,7 +116,7 @@
+  * some systems don't have the BSD re_comp and re_exec routines
+  */
+ #ifndef NEED_BSDREGEX
+-#if ( defined( SYSV ) || defined( NETBSD ) || defined( freebsd ) || defined( 
linux ) || defined( DARWIN )) && !defined(sgi)
++#if ( defined( SYSV ) || defined( NETBSD ) || defined( freebsd ) || defined( 
linux ) || defined(__GNU__) || defined(__GLIBC__) || defined( DARWIN )) && 
!defined(sgi)
+ #define NEED_BSDREGEX
+ #endif
+ #endif
+@@ -145,7 +145,7 @@
+  * Is snprintf() part of the standard C runtime library?
+  */
+ #if !defined(HAVE_SNPRINTF)
+-#if defined(SOLARIS) || defined(LINUX) || defined(HPUX)
++#if defined(SOLARIS) || defined(LINUX) || defined(__GNU__) || 
defined(__GLIBC__) || defined(HPUX)
+ #define HAVE_SNPRINTF
+ #endif
+ #endif
+@@ -165,7 +165,7 @@
+  * for select()
+  */
+ #if !defined(WINSOCK) && !defined(_WINDOWS) && !defined(macintosh) && 
!defined(XP_OS2)
+-#if defined(hpux) || defined(LINUX) || defined(SUNOS4) || defined(XP_BEOS)
++#if defined(hpux) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
|| defined(SUNOS4) || defined(XP_BEOS)
+ #include <sys/time.h>
+ #else
+ #include <sys/select.h>
+@@ -252,15 +252,14 @@
+ #define HAVE_GETGRNAM_R
+ #endif
+ 
+-#if defined(SNI) || defined(LINUX1_2)
++#if defined(SNI) || defined(LINUX1_2) || defined(__GNU__) || 
defined(__GLIBC__)
+ int strcasecmp(const char *, const char *);
+ #ifdef SNI
+ int strncasecmp(const char *, const char *, int);
+-#endif /* SNI */
+-#ifdef LINUX1_2
++#else /* SNI */
+ int strncasecmp(const char *, const char *, size_t);
+-#endif /* LINUX1_2 */
+-#endif /* SNI || LINUX1_2 */
++#endif
++#endif /* SNI || LINUX1_2 || __GNU__ || __GLIBC__ */
+ 
+ #if defined(_WINDOWS) || defined(macintosh) || defined(XP_OS2) || 
defined(DARWIN)
+ #define GETHOSTBYNAME( n, r, b, l, e )  gethostbyname( n )
+@@ -276,7 +275,7 @@
+     defined(UNIXWARE) || defined(SUNOS4) || defined(SNI) || defined(BSDI) || \
+     defined(NCR) || defined(OSF1) || defined(NEC) || defined(VMS) || \
+     ( defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
+-    defined(UnixWare) || defined(LINUX) || defined(NETBSD) || \
++    defined(UnixWare) || defined(LINUX) || defined(__GNU__) || 
defined(__GLIBC__) || defined(NETBSD) || \
+     defined(FREEBSD) || defined(OPENBSD) || \
+     (defined(AIX) && !defined(USE_REENTRANT_LIBC))
+ #define GETHOSTBYNAME( n, r, b, l, e )  gethostbyname( n )
+@@ -300,7 +299,7 @@
+ #define GETHOSTBYNAME( n, r, b, l, e )  gethostbyname_r( n, r, b, l, e )
+ #endif
+ #if defined(HPUX9) || defined(LINUX1_2) || defined(LINUX2_0) || \
+-    defined(LINUX2_1) || defined(SUNOS4) || defined(SNI) || \
++    defined(LINUX2_1) || defined(__GNU__) || defined(__GLIBC__) || 
defined(SUNOS4) || defined(SNI) || \
+     defined(SCOOS) || defined(BSDI) || defined(NCR) || \
+     defined(NEC) || ( defined(HPUX10) && !defined(_REENTRANT)) || \
+     (defined(AIX) && !defined(USE_REENTRANT_LIBC))
+@@ -320,7 +319,7 @@
+ #endif
+ #if defined(hpux9) || defined(LINUX1_2) || defined(SUNOS4) || defined(SNI) || 
\
+     defined(SCOOS) || defined(BSDI) || defined(NCR) || defined(VMS) || \
+-    defined(NEC) || defined(LINUX) || (defined(AIX) && 
!defined(USE_REENTRANT_LIBC))
++    defined(NEC) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
|| (defined(AIX) && !defined(USE_REENTRANT_LIBC))
+ #define STRTOK( s1, s2, l )           strtok( s1, s2 )
+ #else
+ #define HAVE_STRTOK_R
+diff -ur mozilla.old/directory/c-sdk/ldap/libraries/libldap/Makefile.in 
mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in
+--- mozilla.old/directory/c-sdk/ldap/libraries/libldap/Makefile.in     
2005-06-02 06:00:33.000000000 +0200
++++ mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2005-12-24 
19:14:23.000000000 +0100
+@@ -168,7 +168,7 @@
+ EXTRA_LIBS = -L$(dist_libdir) -l$(LBER_LIBNAME) $(OS_LIBS) -lc
+ endif
+ 
+-ifeq ($(OS_ARCH), Linux)
++ifneq (,$(filter Linux GNU GNU_%, $(OS_ARCH)))
+ EXTRA_LIBS = -L$(dist_libdir) -l$(LBER_LIBNAME)
+ endif
+ 
+@@ -286,7 +286,7 @@
+ ifdef SO_FILES_TO_REMOVE
+       -$(RM) $(SO_FILES_TO_REMOVE)
+ endif
+-ifneq (,$(filter AIX Linux HP-UX Darwin BeOS QNX NetBSD OSF1 OpenBSD, 
$(OS_ARCH)))
++ifneq (,$(filter AIX Linux GNU GNU_% HP-UX Darwin BeOS QNX NetBSD OSF1 
OpenBSD, $(OS_ARCH)))
+       $(LINK_LIB) ../liblber/$(OBJDIR_NAME)/*.a
+ else
+ ifeq ($(OS_ARCH),OS2)
+diff -ur mozilla.old/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.c 
mozilla/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.c
+--- mozilla.old/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.c        
2003-03-25 14:57:38.000000000 +0100
++++ mozilla/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.c    
2005-12-24 19:14:23.000000000 +0100
+@@ -218,7 +218,7 @@
+ 
+ #if defined(__hpux) || defined(_AIX) || defined(OSF1) || defined(DARWIN) || \
+   defined(BEOS) || defined(FREEBSD) || defined(BSDI) || defined(VMS) || \
+-  defined(OPENBSD) || defined(NETBSD)
++  defined(OPENBSD) || defined(NETBSD) || defined(__FreeBSD_kernel__)
+ #define EDEADLOCK       -1
+ #endif
+ 
+diff -ur mozilla.old/security/coreconf/Linux.mk 
mozilla/security/coreconf/Linux.mk
+--- mozilla.old/security/coreconf/Linux.mk     2005-02-02 00:39:18.000000000 
+0100
++++ mozilla/security/coreconf/Linux.mk 2005-12-25 10:06:13.000000000 +0100
+@@ -52,80 +52,42 @@
+ 
+ DEFAULT_COMPILER = gcc
+ 
+-ifeq ($(OS_TEST),m68k)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = m68k
+-else          
+-ifeq ($(OS_TEST),ppc64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = ppc64
+-else
+-ifeq ($(OS_TEST),ppc)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = ppc
++CPU_ARCH      = $(OS_TEST)
++
++ifeq ($(KERNEL),linux)
++      OS_REL_CFLAGS   = -D_XOPEN_SOURCE -DLINUX1_2
++      ARCH            = linux
+ else
++      OS_REL_CFLAGS   = -D_XOPEN_SOURCE
++      ARCH            = gnu
++
++endif
++
++
+ ifeq ($(OS_TEST),alpha)
+-        OS_REL_CFLAGS   = -D_ALPHA_ -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = alpha
+-else
+-ifeq ($(OS_TEST),ia64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = ia64
+-else
+-ifeq ($(OS_TEST),x86_64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = x86_64
+-else
+-ifeq ($(OS_TEST),sparc)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = sparc
++        OS_REL_CFLAGS   += -D_ALPHA_
+ else
+ ifeq ($(OS_TEST),sparc64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = sparc
+ else
+ ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = arm
+ else
+ ifeq ($(OS_TEST),parisc)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = hppa
+ else
+ ifeq ($(OS_TEST),parisc64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = hppa
+ else
+-ifeq ($(OS_TEST),s390)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = s390
+-else
+ ifeq ($(OS_TEST),s390x)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = s390x
+ else
+ ifeq ($(OS_TEST),mips64)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = mips
+-else
+-ifeq ($(OS_TEST),mips)
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+       CPU_ARCH        = mips
+ else
+ ifeq (,$(filter-out i686 i586 i486 i386,$(OS_TEST)))
+-      OS_REL_CFLAGS   = -DLINUX1_2 -Di386 -D_XOPEN_SOURCE
++      OS_REL_CFLAGS   += -Di386
+       CPU_ARCH        = x86
+-else
+-      OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
+-      CPU_ARCH        = $(OS_TEST)
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+-endif
+ endif
+ endif
+ endif
+@@ -138,7 +100,7 @@
+ 
+ LIBC_TAG              = _glibc
+ 
+-ifeq ($(OS_RELEASE),2.0)
++ifeq ($(KERNEL)-$(OS_RELEASE),linux-2.0)
+       OS_REL_CFLAGS   += -DLINUX2_0
+       MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(SONAME)
+       ifdef BUILD_OPT
+@@ -155,20 +117,22 @@
+ OS_PTHREAD = -lpthread 
+ endif
+ 
+-OS_CFLAGS             = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe 
-DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
++OS_CFLAGS             = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe 
-D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
++ifeq ($(KERNEL),linux)
++OS_CFLAGS += -DLINUX -Dlinux
++endif
+ OS_LIBS                       = $(OS_PTHREAD) -ldl -lc
+ 
+ ifdef USE_PTHREADS
+       DEFINES         += -D_REENTRANT
+ endif
+ 
+-ARCH                  = linux
+ 
+ DSO_CFLAGS            = -fPIC
+ DSO_LDOPTS            = -shared
+ DSO_LDFLAGS           =
+ 
+-# INCLUDES += -I/usr/include -Y/usr/include/linux
++# INCLUDES += -I/usr/include
+ G++INCLUDES           = -I/usr/include/g++
+ 
+ #
+diff -ur mozilla.old/security/coreconf/Linux2.6.mk 
mozilla/security/coreconf/Linux2.6.mk
+--- mozilla.old/security/coreconf/Linux2.6.mk  2004-04-25 17:02:17.000000000 
+0200
++++ mozilla/security/coreconf/Linux2.6.mk      2005-12-25 10:01:45.000000000 
+0100
+@@ -37,7 +37,10 @@
+ 
+ include $(CORE_DEPTH)/coreconf/Linux.mk
+ 
+-OS_REL_CFLAGS   += -DLINUX2_1
++ifeq ($(KERNEL), linux)
++      OS_REL_CFLAGS   += -DLINUX2_1
++endif
++
+ MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(SONAME)
+ ifdef BUILD_OPT
+             OPTIMIZER       = -O2
+diff -ur mozilla.old/security/coreconf/arch.mk 
mozilla/security/coreconf/arch.mk
+--- mozilla.old/security/coreconf/arch.mk      2005-05-17 23:26:14.000000000 
+0200
++++ mozilla/security/coreconf/arch.mk  2005-12-25 09:55:32.000000000 +0100
+@@ -154,6 +154,14 @@
+     ifneq ($(words $(OS_RELEASE)),1)
+       OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE))
+     endif
++    KERNEL = linux
++endif
++
++# This check must be last.  Since all uses of OS_ARCH that follow affect only
++# userland, we can merge other Glibc systems with Linux here.
++ifneq (, $(filter GNU GNU_%, $(OS_ARCH)))
++OS_ARCH = Linux
++OS_RELEASE = 2.6
+ endif
+ 
+ #
+diff -ur mozilla.old/security/coreconf/config.mk 
mozilla/security/coreconf/config.mk
+--- mozilla.old/security/coreconf/config.mk    2004-04-25 17:02:17.000000000 
+0200
++++ mozilla/security/coreconf/config.mk        2005-12-24 19:14:23.000000000 
+0100
+@@ -63,7 +63,7 @@
+ #######################################################################
+ 
+ TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
+-              OpenVMS AIX
++              OpenVMS AIX GNU GNU_%
+ 
+ ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
+ include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
+diff -ur mozilla.old/security/nss/lib/freebl/unix_rand.c 
mozilla/security/nss/lib/freebl/unix_rand.c
+--- mozilla.old/security/nss/lib/freebl/unix_rand.c    2005-05-10 
23:14:51.000000000 +0200
++++ mozilla/security/nss/lib/freebl/unix_rand.c        2005-12-26 
07:11:30.000000000 +0100
+@@ -81,7 +81,8 @@
+ }
+ 
+ #if defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(FREEBSD) \
+-    || defined(NETBSD) || defined(NTO) || defined(DARWIN) || defined(OPENBSD)
++    || defined(NETBSD) || defined(NTO) || defined(DARWIN) || defined(OPENBSD) 
\
++    || defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)
+ #include <sys/times.h>
+ 
+ #define getdtablesize() sysconf(_SC_OPEN_MAX)
+only in patch2:
+unchanged:
+--- xulrunner-1.8.0.5.orig/security/nss/lib/ssl/sslmutex.c
++++ xulrunner-1.8.0.5/security/nss/lib/ssl/sslmutex.c
+@@ -89,7 +89,7 @@
+     return SECSuccess;
+ }
+ 
+-#if defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) || 
defined(BSDI) || defined(NETBSD) || defined(OPENBSD)
++#if defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) || 
defined(BSDI) || defined(NETBSD) || defined(OPENBSD) || defined(__GLIBC__)
+ 
+ #include <unistd.h>
+ #include <fcntl.h>
+only in patch2:
+unchanged:
+--- xulrunner-1.8.0.5.orig/security/nss/lib/ssl/sslmutex.h
++++ xulrunner-1.8.0.5/security/nss/lib/ssl/sslmutex.h
+@@ -79,7 +79,7 @@
+ 
+ typedef int    sslPID;
+ 
+-#elif defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) || 
defined(BSDI) || defined(NETBSD) || defined(OPENBSD)
++#elif defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) || 
defined(BSDI) || defined(NETBSD) || defined(OPENBSD) || defined(__GLIBC__)
+ 
+ #include <sys/types.h>
+ #include "prtypes.h"
diff -urN r/xulrunner-1.8.0.5/debian/patches/99_configure.dpatch 
xulrunner-1.8.0.5/debian/patches/99_configure.dpatch
--- r/xulrunner-1.8.0.5/debian/patches/99_configure.dpatch      2006-09-20 
14:16:10.000000000 +0200
+++ xulrunner-1.8.0.5/debian/patches/99_configure.dpatch        2006-09-20 
14:23:35.000000000 +0200
@@ -37,6 +37,31 @@
      PR_MD_CSRCS=hpux.c
      if test "$OS_TEST" != "ia64"; then
          PR_MD_ASFILES=os_HPUX.s
+@@ -3820,7 +3820,7 @@
+       esac
+     ;;
+ 
+-*-linux*)
++*-linux*|*-gnu*|*-k*bsd*-gnu)
+     if test -z "$USE_NSPR_THREADS"; then
+         USE_PTHREADS=1
+         IMPL_STRATEGY=_PTH
+@@ -3849,10 +3849,14 @@
+ #define HAVE_FCNTL_FILE_LOCKING 1
+ EOF
+ 
+-    cat >> confdefs.h <<\EOF
++    case "${target_os}" in
++    linux*)
++        cat >> confdefs.h <<\EOF
+ #define LINUX 1
+ EOF
+ 
++        ;;
++    esac
+     CFLAGS="$CFLAGS -ansi -Wall"
+     CXXFLAGS="$CXXFLAGS -ansi -Wall"
+     MDCPUCFG_H=_linux.cfg
 @@ -3859,7 +3859,7 @@
      PR_MD_CSRCS=linux.c
      MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -95,6 +120,24 @@
      fi
      if test -n "$GNU_CC"; then
          CFLAGS="$CFLAGS -Wall"
+@@ -5496,7 +5500,7 @@
+             _PTHREAD_LDFLAGS=-pthread
+         fi
+         ;;
+-    *-linux*)
++    *-linux*|*-gnu*|*-k*bsd*-gnu)
+         cat >> confdefs.h <<\EOF
+ #define _REENTRANT 1
+ EOF
+@@ -5633,7 +5637,7 @@
+         fi
+     fi
+     ;;
+-*-linux*)
++*-linux*|*-gnu*|*-k*bsd*-gnu)
+     if test -n "$USE_NSPR_THREADS"; then
+         cat >> confdefs.h <<\EOF
+ #define _PR_LOCAL_THREADS_ONLY 1
 @@ -5910,6 +5910,8 @@
      MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
  fi

Reply via email to