From 81652fc8ad76f82284e6c685aeeb1a5a0b6aed99 Mon Sep 17 00:00:00 2001 From: "wtc%google.com" Date: Fri, 9 May 2008 23:56:02 +0000 Subject: [PATCH] Bug 367664: added RISC OS support. The patch is contributed by Peter Naulls . r=wtc. Modified Files: coreconf/config.mk coreconf/rules.mk coreconf/nsinstall/nsinstall.c nss/lib/freebl/unix_rand.c Added Files: coreconf/RISCOS.mk --- security/coreconf/RISCOS.mk | 48 +++++++++++++++++++++++++ security/coreconf/config.mk | 2 +- security/coreconf/nsinstall/nsinstall.c | 2 +- security/coreconf/rules.mk | 4 +++ security/nss/lib/freebl/unix_rand.c | 3 +- 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 security/coreconf/RISCOS.mk diff --git a/security/coreconf/RISCOS.mk b/security/coreconf/RISCOS.mk new file mode 100644 index 00000000000..94c2679ce32 --- /dev/null +++ b/security/coreconf/RISCOS.mk @@ -0,0 +1,48 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Netscape security libraries. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +include $(CORE_DEPTH)/coreconf/UNIX.mk + +DLL_SUFFIX = a +MKSHLIB = $(GCCSDK_INSTALL_CROSSBIN)/arm-unknown-riscos-ar cr + +OS_RELEASE = +OS_TARGET = RISCOS + +ifdef BUILD_OPT + OPTIMIZER = -O2 -mpoke-function-name +endif diff --git a/security/coreconf/config.mk b/security/coreconf/config.mk index 962bff33088..3f9c81bd1d3 100644 --- a/security/coreconf/config.mk +++ b/security/coreconf/config.mk @@ -63,7 +63,7 @@ endif ####################################################################### TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \ - OpenVMS AIX + OpenVMS AIX RISCOS ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET))) include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk diff --git a/security/coreconf/nsinstall/nsinstall.c b/security/coreconf/nsinstall/nsinstall.c index 9a04cef6905..cf309ece8fa 100644 --- a/security/coreconf/nsinstall/nsinstall.c +++ b/security/coreconf/nsinstall/nsinstall.c @@ -58,7 +58,7 @@ typedef unsigned int mode_t; #define HAVE_LCHOWN -#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(VMS) || defined(NTO) || defined(DARWIN) || defined(BEOS) +#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(VMS) || defined(NTO) || defined(DARWIN) || defined(BEOS) || defined(__riscos__) #undef HAVE_LCHOWN #endif diff --git a/security/coreconf/rules.mk b/security/coreconf/rules.mk index 424bccedf25..f160e44e3fb 100644 --- a/security/coreconf/rules.mk +++ b/security/coreconf/rules.mk @@ -337,8 +337,12 @@ ifdef MT fi endif # MSVC with manifest tool endif +else +ifeq ($(OS_TARGET),RISCOS) + $(MKSHLIB) $@ $(OBJS) $(SUB_SHLOBJS) else $(MKSHLIB) -o $@ $(OBJS) $(SUB_SHLOBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) +endif chmod +x $@ ifeq ($(OS_TARGET),Darwin) ifdef MAPFILE diff --git a/security/nss/lib/freebl/unix_rand.c b/security/nss/lib/freebl/unix_rand.c index b9664583c7f..aec738c090a 100644 --- a/security/nss/lib/freebl/unix_rand.c +++ b/security/nss/lib/freebl/unix_rand.c @@ -185,7 +185,8 @@ static SECStatus RNG_kstat(PRUint32* fed) #endif #if defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(FREEBSD) \ - || defined(NETBSD) || defined(NTO) || defined(DARWIN) || defined(OPENBSD) + || defined(NETBSD) || defined(DARWIN) || defined(OPENBSD) \ + || defined(NTO) || defined(__riscos__) #include #define getdtablesize() sysconf(_SC_OPEN_MAX)