Hi,
here is an updated version of the patch for current unstable.
updating config.{sub,guess} would still be nice for kFreeBSD I guess,
this is the debian/rules snippet from the old patch for that:
cheers,
Michael
diff -Nur mozilla.old/directory/c-sdk/config/nsinstall.c
mozilla/directory/c-sdk/config/nsinstall.c
--- mozilla.old/directory/c-sdk/config/nsinstall.c 2002-03-27
11:06:18.000000000 +0100
+++ mozilla/directory/c-sdk/config/nsinstall.c 2005-01-16 06:17:22.000000000
+0100
@@ -64,7 +64,7 @@
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) \
|| defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) \
|| defined(RHAPSODY) || defined(NEXTSTEP) || defined(QNX) \
- || defined(BEOS) || defined(VMS) || defined(DARWIN)
+ || defined(BEOS) || defined(VMS) || defined(DARWIN) || defined(GLIBC)
#undef HAVE_LCHOWN
#endif
@@ -106,7 +106,7 @@
}
#endif /* NEXTSTEP */
-#ifdef LINUX
+#if defined(LINUX) || defined(GLIBC)
#include <getopt.h>
#endif
diff -Nur mozilla.old/directory/c-sdk/configure.in
mozilla/directory/c-sdk/configure.in
--- mozilla.old/directory/c-sdk/configure.in 2004-03-30 21:38:43.000000000
+0200
+++ mozilla/directory/c-sdk/configure.in 2005-01-16 06:17:22.000000000
+0100
@@ -1123,7 +1123,7 @@
esac
;;
-*-linux*)
+*-linux* | *-k*bsd*-gnu | *-gnu*)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
IMPL_STRATEGY=_PTH
diff -Nur 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-01-16
06:17:21.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 -Nur mozilla.old/directory/c-sdk/ldap/libraries/libldap/request.c
mozilla/directory/c-sdk/ldap/libraries/libldap/request.c
--- mozilla.old/directory/c-sdk/ldap/libraries/libldap/request.c
2002-03-26 22:53:46.000000000 +0100
+++ mozilla/directory/c-sdk/ldap/libraries/libldap/request.c 2005-01-16
06:17:22.000000000 +0100
@@ -627,7 +627,7 @@
LDAPConn *lc;
char msg[256];
/* CTIME for this platform doesn't use this. */
-#if !defined(SUNOS4) && !defined(_WIN32) && !defined(LINUX) &&
!defined(macintosh)
+#if !defined(SUNOS4) && !defined(_WIN32) && !defined(GLIBC) &&
!defined(macintosh)
char buf[26];
#endif
diff -Nur mozilla.old/directory/c-sdk/ldap/libraries/libldap/tmplout.c
mozilla/directory/c-sdk/ldap/libraries/libldap/tmplout.c
--- mozilla.old/directory/c-sdk/ldap/libraries/libldap/tmplout.c
2002-03-26 22:53:52.000000000 +0100
+++ mozilla/directory/c-sdk/ldap/libraries/libldap/tmplout.c 2005-01-16
06:17:22.000000000 +0100
@@ -903,7 +903,8 @@
time_t gmttime;
/* CTIME for this platform doesn't use this. */
#if !defined(SUNOS4) && !defined(BSDI) && !defined(LINUX1_2) && \
- !defined(SNI) && !defined(_WIN32) && !defined(macintosh) && !defined(LINUX)
+ !defined(SNI) && !defined(_WIN32) && !defined(macintosh) && !defined(GLIBC)
+
char buf[26];
#endif
diff -Nur mozilla.old/nsprpub/config/nsinstall.c
mozilla/nsprpub/config/nsinstall.c
--- mozilla.old/nsprpub/config/nsinstall.c 2002-12-12 01:29:08.000000000
+0100
+++ mozilla/nsprpub/config/nsinstall.c 2005-01-16 06:17:22.000000000 +0100
@@ -95,7 +95,7 @@
}
#endif /* NEXTSTEP */
-#ifdef LINUX
+#if defined(LINUX) || defined(GLIBC)
#include <getopt.h>
#endif
diff -Nur mozilla.old/nsprpub/configure.in mozilla/nsprpub/configure.in
--- mozilla.old/nsprpub/configure.in 2004-04-17 00:28:02.000000000 +0200
+++ mozilla/nsprpub/configure.in 2005-01-16 06:17:21.000000000 +0100
@@ -511,9 +511,12 @@
OS_RELEASE=
OS_TEST="${target_cpu}"
case "${target_os}" in
- linux*) OS_ARCH=Linux ;;
- solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
- mingw*) OS_ARCH=WINNT ;;
+ linux*) OS_ARCH=Linux ;;
+ solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
+ mingw*) OS_ARCH=WINNT ;;
+ kfreebsd*-gnu) OS_ARCH=GNU/kFreeBSD ;;
+ knetbsd*-gnu) OS_ARCH=GNU/kNetBSD ;;
+ gnu*) OS_ARCH=GNU ;;
esac
else
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
@@ -919,6 +922,7 @@
fi
AC_DEFINE(XP_UNIX)
AC_DEFINE(FREEBSD)
+ AC_DEFINE(KFREEBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
@@ -1174,7 +1178,7 @@
esac
;;
-*-linux*)
+*-linux* | *-gnu* | *-k*bsd*-gnu)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
IMPL_STRATEGY=_PTH
@@ -1185,7 +1189,13 @@
AC_DEFINE(_SVID_SOURCE)
AC_DEFINE(_LARGEFILE64_SOURCE)
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
- AC_DEFINE(LINUX)
+ AC_DEFINE(GLIBC)
+ case "$target" in
+ *-linux*) AC_DEFINE(LINUX) ;;
+ *-kfreebsd*-gnu) AC_DEFINE(KFREEBSD) ;;
+ *-knetbsd*-gnu) AC_DEFINE(KNETBSD) ;;
+ *-gnu*) AC_DEFINE(HURD) ;;
+ esac
CFLAGS="$CFLAGS -ansi -Wall"
CXXFLAGS="$CXXFLAGS -ansi -Wall"
MDCPUCFG_H=_linux.cfg
@@ -1408,6 +1418,7 @@
*-netbsd*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(NETBSD)
+ AC_DEFINE(KNETBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
USE_NSPR_THREADS=1
MDCPUCFG_H=_netbsd.cfg
@@ -2207,7 +2218,7 @@
_PTHREAD_LDFLAGS=-pthread
fi
;;
- *-linux*)
+ *-linux* | *-gnu* | *-k*bsd*-gnu)
AC_DEFINE(_REENTRANT)
;;
esac
@@ -2291,7 +2302,7 @@
fi
fi
;;
-*-linux*)
+*-linux* | *-gnu* | *-k*bsd*-gnu)
if test -n "$USE_NSPR_THREADS"; then
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
fi
diff -Nur mozilla.old/nsprpub/pr/include/md/_linux.cfg
mozilla/nsprpub/pr/include/md/_linux.cfg
--- mozilla.old/nsprpub/pr/include/md/_linux.cfg 2005-01-16
06:01:22.000000000 +0100
+++ mozilla/nsprpub/pr/include/md/_linux.cfg 2005-01-16 06:17:22.000000000
+0100
@@ -39,7 +39,7 @@
#define XP_UNIX
#endif
-#ifndef LINUX
+#if !defined(LINUX) && defined(__linux__)
#define LINUX
#endif
diff -Nur mozilla.old/nsprpub/pr/include/md/_pth.h
mozilla/nsprpub/pr/include/md/_pth.h
--- mozilla.old/nsprpub/pr/include/md/_pth.h 2003-09-16 22:44:04.000000000
+0200
+++ mozilla/nsprpub/pr/include/md/_pth.h 2005-01-16 06:17:22.000000000
+0100
@@ -136,7 +136,7 @@
(!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(HPUX) || defined(GLIBC) || defined(FREEBSD) \
|| defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
|| defined(VMS) || defined(NTO) || defined(DARWIN) \
|| defined(UNIXWARE)
@@ -188,7 +188,7 @@
/*
* These platforms don't have sigtimedwait()
*/
-#if (defined(AIX) && !defined(AIX4_3_PLUS)) || defined(LINUX) \
+#if (defined(AIX) && !defined(AIX4_3_PLUS)) || defined(GLIBC) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
|| defined(BSDI) || defined(VMS) || defined(UNIXWARE) \
|| defined(DARWIN)
@@ -228,7 +228,7 @@
#define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
#endif /* defined(_PR_DCETHREADS) */
-#elif defined(LINUX) || defined(FREEBSD)
+#elif 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)
@@ -283,7 +283,7 @@
onemillisec.tv_nsec = 1000000L; \
nanosleep(&onemillisec,NULL); \
PR_END_MACRO
-#elif defined(HPUX) || defined(LINUX) || defined(SOLARIS) \
+#elif defined(HPUX) || defined(GLIBC) || defined(SOLARIS) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
|| defined(BSDI) || defined(NTO) || defined(DARWIN) \
|| defined(UNIXWARE)
diff -Nur mozilla.old/nsprpub/pr/include/md/prosdep.h
mozilla/nsprpub/pr/include/md/prosdep.h
--- mozilla.old/nsprpub/pr/include/md/prosdep.h 2001-10-26 06:54:01.000000000
+0200
+++ mozilla/nsprpub/pr/include/md/prosdep.h 2005-01-16 06:17:22.000000000
+0100
@@ -87,7 +87,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)
diff -Nur mozilla.old/nsprpub/pr/src/md/unix/unix.c
mozilla/nsprpub/pr/src/md/unix/unix.c
--- mozilla.old/nsprpub/pr/src/md/unix/unix.c 2002-12-12 01:19:57.000000000
+0100
+++ mozilla/nsprpub/pr/src/md/unix/unix.c 2005-01-16 06:17:22.000000000
+0100
@@ -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) \
diff -Nur mozilla.old/nsprpub/pr/src/md/unix/uxproces.c
mozilla/nsprpub/pr/src/md/unix/uxproces.c
--- mozilla.old/nsprpub/pr/src/md/unix/uxproces.c 2002-03-15
00:20:54.000000000 +0100
+++ mozilla/nsprpub/pr/src/md/unix/uxproces.c 2005-01-16 06:17:22.000000000
+0100
@@ -89,7 +89,8 @@
* that can share the virtual address space and file descriptors.
*/
#if (defined(IRIX) && !defined(_PR_PTHREADS)) \
- || (defined(LINUX) && defined(_PR_PTHREADS))
+ || (defined(GLIBC) && defined(_PR_PTHREADS))
+
#define _PR_SHARE_CLONES
#endif
@@ -103,7 +104,7 @@
*/
#if defined(_PR_GLOBAL_THREADS_ONLY) \
- || (defined(_PR_PTHREADS) && !defined(LINUX))
+ || (defined(_PR_PTHREADS) && !defined(GLIBC))
#define _PR_NATIVE_THREADS
#endif
diff -Nur mozilla.old/nsprpub/pr/src/misc/prnetdb.c
mozilla/nsprpub/pr/src/misc/prnetdb.c
--- mozilla.old/nsprpub/pr/src/misc/prnetdb.c 2004-01-22 23:22:37.000000000
+0100
+++ mozilla/nsprpub/pr/src/misc/prnetdb.c 2005-01-16 06:17:22.000000000
+0100
@@ -105,7 +105,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
diff -Nur mozilla.old/nsprpub/pr/src/pthreads/ptio.c
mozilla/nsprpub/pr/src/pthreads/ptio.c
--- mozilla.old/nsprpub/pr/src/pthreads/ptio.c 2004-02-04 02:31:33.000000000
+0100
+++ mozilla/nsprpub/pr/src/pthreads/ptio.c 2005-01-16 06:17:22.000000000
+0100
@@ -203,7 +203,7 @@
#if defined(SOLARIS)
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
- || defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \
+ || defined(LINUX) || defined(GLIBC) || defined(FREEBSD) || defined(BSDI)
|| defined(VMS) \
|| defined(NTO) || defined(OPENBSD) || defined(DARWIN) \
|| defined(UNIXWARE) || defined(NETBSD)
#define _PRSockOptVal_t void *
@@ -217,7 +217,7 @@
#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(GLIBC) \
|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
|| defined(BSDI) || defined(VMS) || defined(NTO) || defined(DARWIN) \
|| defined(UNIXWARE)
@@ -301,7 +301,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)
@@ -357,14 +357,14 @@
int nbytes_to_send; /* size of header and file */
#endif /* SOLARIS */
-#ifdef LINUX
+#if defined(LINUX) || defined(GLIBC)
/*
* For sendfile()
*/
int in_fd; /* descriptor of file to send */
off_t offset;
size_t count;
-#endif /* LINUX */
+#endif /* LINUX || GLIBC */
PRIntervalTime timeout; /* client (relative) timeout */
@@ -1109,7 +1109,7 @@
}
#endif /* SOLARIS */
-#ifdef LINUX
+#if defined(LINUX)
static PRBool pt_linux_sendfile_cont(pt_Continuation *op, PRInt16 revents)
{
ssize_t rv;
@@ -2544,7 +2544,7 @@
#endif /* SOLARIS */
-#ifdef LINUX
+#if defined(LINUX)
/*
* pt_LinuxSendFile
*
@@ -2983,7 +2983,7 @@
rv = setsockopt(
fd->secret->md.osfd, level, name,
(char*)&value, sizeof(PRIntn));
-#ifdef LINUX
+#if defined(LINUX)
/* for pt_LinuxSendFile */
if (name == TCP_NODELAY && rv == 0) {
fd->secret->md.tcp_nodelay = value;
@@ -3255,7 +3255,7 @@
};
#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
- || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
+ || defined(AIX) || defined(LINUX) || defined(GLIBC) || defined(FREEBSD) ||
defined(NETBSD) \
|| defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO) \
|| defined(DARWIN) || defined(UNIXWARE)
#define _PR_FCNTL_FLAGS O_NONBLOCK
@@ -4747,7 +4747,7 @@
#include <sys/types.h>
#include <sys/time.h>
-#if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX)
+#if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX) && !defined(GLIBC)
#include <sys/select.h>
#endif
diff -Nur mozilla.old/security/coreconf/GNU.mk mozilla/security/coreconf/GNU.mk
--- mozilla.old/security/coreconf/GNU.mk 1970-01-01 01:00:00.000000000
+0100
+++ mozilla/security/coreconf/GNU.mk 2005-01-16 06:17:22.000000000 +0100
@@ -0,0 +1,37 @@
+#
+# 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 Netscape security libraries.
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1994-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+# Config stuff for GNU
+#
+
+KERNEL=gnumach
+include $(CORE_DEPTH)/coreconf/Linux.mk
diff -Nur mozilla.old/security/coreconf/GNU_kFreeBSD.mk
mozilla/security/coreconf/GNU_kFreeBSD.mk
--- mozilla.old/security/coreconf/GNU_kFreeBSD.mk 1970-01-01
01:00:00.000000000 +0100
+++ mozilla/security/coreconf/GNU_kFreeBSD.mk 2005-01-16 06:17:22.000000000
+0100
@@ -0,0 +1,37 @@
+#
+# 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 Netscape security libraries.
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1994-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+# Config stuff for GNU/kFreeBSD
+#
+
+KERNEL=kfreebsd
+include $(CORE_DEPTH)/coreconf/Linux.mk
diff -Nur mozilla.old/security/coreconf/config.mk
mozilla/security/coreconf/config.mk
--- mozilla.old/security/coreconf/config.mk 2004-01-28 01:01:56.000000000
+0100
+++ mozilla/security/coreconf/config.mk 2005-01-16 06:17:22.000000000 +0100
@@ -59,7 +59,7 @@
#######################################################################
TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
- OpenVMS AIX
+ OpenVMS AIX GNU GNU_kFreeBSD GNU_kNetBSD
ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
diff -Nur mozilla.old/security/nss/cmd/platlibs.mk
mozilla/security/nss/cmd/platlibs.mk
--- mozilla.old/security/nss/cmd/platlibs.mk 2003-04-20 06:23:14.000000000
+0200
+++ mozilla/security/nss/cmd/platlibs.mk 2005-01-16 06:17:23.000000000
+0100
@@ -182,7 +182,7 @@
# If GNU ld is used, we must use the -rpath-link option to tell
# the linker where to find libsoftokn3.so, an implicit dependency
# of libnss3.so.
-ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD, $(OS_ARCH)))
+ifeq (,$(filter-out BSD_OS FreeBSD Linux GNU GNU_kFreeBSD GNU_kNetBSD NetBSD,
$(OS_ARCH)))
EXTRA_SHARED_LIBS += -Wl,-rpath-link,$(DIST)/lib
endif
diff -Nur mozilla.old/security/nss/lib/freebl/ecl/Makefile
mozilla/security/nss/lib/freebl/ecl/Makefile
--- mozilla.old/security/nss/lib/freebl/ecl/Makefile 2003-10-17
15:45:34.000000000 +0200
+++ mozilla/security/nss/lib/freebl/ecl/Makefile 2005-01-16
06:17:22.000000000 +0100
@@ -65,7 +65,7 @@
ifeq ($(TARGET),v8SOLARIS)
ECL_USE_FP=1
else
-ifeq ($(TARGET),x86LINUX)
+ifeq (,)
ECL_USE_FP=1
endif
endif
diff -Nur mozilla.old/security/nss/lib/freebl/mpi/target.mk
mozilla/security/nss/lib/freebl/mpi/target.mk
--- mozilla.old/security/nss/lib/freebl/mpi/target.mk 2003-10-17
15:45:36.000000000 +0200
+++ mozilla/security/nss/lib/freebl/mpi/target.mk 2005-01-16
06:17:22.000000000 +0100
@@ -203,13 +203,13 @@
export OBJECT_MODE
endif
-ifeq ($(TARGET),x86LINUX)
+ifeq (,)
#Linux
AS_OBJS = mpi_x86.o
MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D
MPICMN += -DMP_MONT_USE_MP_MUL
-CFLAGS= -O2 -fPIC -DLINUX1_2 -Di386 -D_XOPEN_SOURCE -DLINUX2_1 -ansi -Wall \
- -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR \
+CFLAGS= -O2 -fPIC -Di386 -D_XOPEN_SOURCE -ansi -Wall \
+ -pipe -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR \
-DXP_UNIX -UDEBUG -DNDEBUG -D_REENTRANT $(MPICMN)
#CFLAGS= -g -fPIC -DLINUX1_2 -Di386 -D_XOPEN_SOURCE -DLINUX2_1 -ansi -Wall \
-pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR \
diff -Nur 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 2003-05-31
01:31:19.000000000 +0200
+++ mozilla/security/nss/lib/freebl/unix_rand.c 2005-01-16 06:17:23.000000000
+0100
@@ -78,7 +78,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(__linux__) || defined(__GNU__) || defined(__GLIBC__)
#include <sys/times.h>
#define getdtablesize() sysconf(_SC_OPEN_MAX)
@@ -273,7 +274,7 @@
}
#endif /* IBM R2 */
-#if defined(LINUX)
+#if defined(LINUX) && !defined(GLIBC)
#include <linux/kernel.h>
static size_t
@@ -804,7 +805,7 @@
#ifdef DO_PS
For now it is considered that it is too expensive to run the ps command
for the small amount of entropy it provides.
-#if defined(__sun) && (!defined(__svr4) && !defined(SVR4)) || defined(bsdi) ||
defined(LINUX)
+#if defined(__sun) && (!defined(__svr4) && !defined(SVR4)) || defined(bsdi) ||
defined(LINUX) || defined(__FreeBSD_kernel__)
static char ps_cmd[] = "ps aux";
#else
static char ps_cmd[] = "ps -el";
diff -Nur mozilla.old/security/nss/lib/ssl/sslmutex.c
mozilla/security/nss/lib/ssl/sslmutex.c
--- mozilla.old/security/nss/lib/ssl/sslmutex.c 2003-08-29 00:23:59.000000000
+0200
+++ mozilla/security/nss/lib/ssl/sslmutex.c 2005-01-16 06:17:23.000000000
+0100
@@ -87,7 +87,7 @@
return SECSuccess;
}
-#if defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) ||
defined(BSDI) || defined(NETBSD) || defined(OPENBSD)
+#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX)
|| defined(VMS) || defined(BEOS) || defined(BSDI) || defined(NETBSD) ||
defined(OPENBSD)
#include <unistd.h>
#include <fcntl.h>
diff -Nur mozilla.old/security/nss/lib/ssl/sslmutex.h
mozilla/security/nss/lib/ssl/sslmutex.h
--- mozilla.old/security/nss/lib/ssl/sslmutex.h 2002-05-18 05:24:17.000000000
+0200
+++ mozilla/security/nss/lib/ssl/sslmutex.h 2005-01-16 06:17:23.000000000
+0100
@@ -77,7 +77,7 @@
typedef int sslPID;
-#elif defined(LINUX) || defined(AIX) || defined(VMS) || defined(BEOS) ||
defined(BSDI) || defined(NETBSD) || defined(OPENBSD)
+#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX)
|| defined(VMS) || defined(BEOS) || defined(BSDI) || defined(NETBSD) ||
defined(OPENBSD)
#include <sys/types.h>
#include "prtypes.h"
--- mozilla/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.corg
2005-01-18 18:07:24.000000000 -0500
+++ mozilla/directory/c-sdk/ldap/libraries/libprldap/ldappr-error.c
2005-01-18 18:08:09.000000000 -0500
@@ -218,7 +218,8 @@ struct prldap_errormap_entry {
#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__) || \
+ defined(__GNU__)
#define EDEADLOCK -1
#endif
--- mozilla/dbm/src/ndbm.corg 2005-01-18 18:29:13.000000000 -0500
+++ mozilla/dbm/src/ndbm.c 2005-01-20 12:34:01.000000000 -0500
@@ -58,6 +58,10 @@ static char sccsid[] = "@(#)ndbm.c 8.4 (
#include "ndbm.h"
#include "hash.h"
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
/*
* Returns:
* *DBM on success
--- mozilla/gfx/src/gtk/nsDeviceContextSpecG.horg 2005-01-19
05:23:55.000000000 -0500
+++ mozilla/gfx/src/gtk/nsDeviceContextSpecG.h 2005-01-20 12:52:00.000000000
-0500
@@ -37,6 +37,11 @@
*
* ***** END LICENSE BLOCK ***** */
+/* Temp hack for GNU/Hurd */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
#ifndef nsDeviceContextSpecGTK_h___
#define nsDeviceContextSpecGTK_h___
--- mozilla/xpcom/io/nsDirectoryService.cpporg 2005-01-18 19:24:27.000000000
-0500
+++ mozilla/xpcom/io/nsDirectoryService.cpp 2005-01-20 12:50:18.000000000
-0500
@@ -82,6 +82,14 @@
#include "prenv.h"
#endif
+#ifndef MAX_PATH
+#define MAX_PATH 4096
+#endif
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
#include "SpecialSystemDirectory.h"
#include "nsAppFileLocationProvider.h"
--- mozilla/xpcom/io/nsLocalFileUnix.cpporg 2005-01-18 20:04:10.000000000
-0500
+++ mozilla/xpcom/io/nsLocalFileUnix.cpp 2005-01-20 12:50:42.000000000
-0500
@@ -77,6 +77,10 @@
#define FILE_STRNCMP strncmp
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
#define VALIDATE_STAT_CACHE() \
PR_BEGIN_MACRO \
if (!mHaveCachedStat) { \
--- mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpporg 2005-01-18
20:21:48.000000000 -0500
+++ mozilla/xpcom/obsolete/nsSpecialSystemDirectory.cpp 2005-01-20
12:51:21.000000000 -0500
@@ -68,6 +68,15 @@
#include <unixlib.h>
#endif
+/* Temp fix for GNU/Hurd for PATH_MAX and MAXPATHLEN */
+#ifndef MAX_PATH
+#define MAX_PATH 4096
+#endif
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
#include "plstr.h"
#include "nsHashtable.h"
--- mozilla/modules/libjar/nsZipArchive.cpporg 2005-01-18 20:49:23.000000000
-0500
+++ mozilla/modules/libjar/nsZipArchive.cpp 2005-01-20 12:49:00.000000000
-0500
@@ -110,6 +110,10 @@ char * strdup(const char *src)
# endif
#endif /* XP_UNIX */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
#include "zipfile.h"
#include "zipstruct.h"
#include "nsZipArchive.h"
--- mozilla/nsprpub/pr/src/md/unix/uxrng.corg 2005-01-18 17:36:07.000000000
-0500
+++ mozilla/nsprpub/pr/src/md/unix/uxrng.c 2005-01-18 17:36:36.000000000
-0500
@@ -135,7 +135,8 @@ GetHighResClock(void *buf, size_t maxbyt
return 0;
}
-#elif (defined(LINUX) || defined(FREEBSD) || defined(NETBSD) ||
defined(OPENBSD))
+#elif (defined(LINUX) || defined(KFREEBSD) || defined(KNETBSD) || \
+ defined(OPENBSD) || defined(__GNU__))
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
--- mozilla/security/coreconf/Linux.mk.orig 2005-06-14 19:11:17.595996440
+0200
+++ mozilla/security/coreconf/Linux.mk 2005-06-14 19:13:09.009059080 +0200
@@ -30,7 +30,7 @@
# may use your version of this file under either the MPL or the
# GPL.
#
-# Config stuff for Linux
+# Config stuff for GNU and variants
#
include $(CORE_DEPTH)/coreconf/UNIX.mk
@@ -51,59 +51,59 @@
DEFAULT_COMPILER = gcc
ifeq ($(OS_TEST),m68k)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = m68k
else
ifeq ($(OS_TEST),ppc)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = ppc
else
ifeq ($(OS_TEST),alpha)
- OS_REL_CFLAGS = -D_ALPHA_ -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_ALPHA_ -D_XOPEN_SOURCE
CPU_ARCH = alpha
else
ifeq ($(OS_TEST),ia64)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = ia64
else
ifeq ($(OS_TEST),x86_64)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = x86_64
else
ifeq ($(OS_TEST),sparc)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = sparc
else
ifeq ($(OS_TEST),sparc64)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = sparc
else
ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = arm
else
ifeq ($(OS_TEST),parisc)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = hppa
else
ifeq ($(OS_TEST),parisc64)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = hppa
else
ifeq ($(OS_TEST),s390)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = s390
else
ifeq ($(OS_TEST),s390x)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = s390x
else
ifeq ($(OS_TEST),mips)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = mips
else
ifeq ($(OS_TEST),parisc)
- OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
+ OS_REL_CFLAGS = -D_XOPEN_SOURCE
CPU_ARCH = hppa
else
OS_REL_CFLAGS = -DLINUX1_2 -Di386 -D_XOPEN_SOURCE
@@ -133,11 +133,20 @@
endif
endif
+isgnu = nope
+ifeq ($(KERNEL),linux)
+OS_REL_CFLAGS = -DLINUX1_2
+ifeq ($(OS_RELEASE),2.0)
+ OS_REL_CFLAGS += -DLINUX2_0
+ isgnu = yes
+endif
+else
+isgnu = yes
+endif
LIBC_TAG = _glibc
-ifeq ($(OS_RELEASE),2.0)
- OS_REL_CFLAGS += -DLINUX2_0
+ifeq ($(isgnu), yes)
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
ifdef BUILD_OPT
OPTIMIZER = -O2
@@ -153,20 +162,27 @@
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
OS_LIBS = -L/lib $(OS_PTHREAD) -ldl -lc
+ifeq ($(KERNEL),linux)
+OS_CFLAGS += -DLINUX -Dlinux
+endif
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif
+ifeq ($(KERNEL),linux)
ARCH = linux
+else
+ARCH = gnu
+endif
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++
#
--- mozilla/security/nss/cmd/shlibsign/shlibsign.c.orig 2005-06-15
17:48:41.000000000 +0200
+++ mozilla/security/nss/cmd/shlibsign/shlibsign.c 2005-06-15
17:51:22.000000000 +0200
@@ -41,6 +41,10 @@
#define USES_LINKS 1
#endif
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
#include "nspr.h"
#include <stdio.h>
#include "nss.h"