From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- src/libs/xpcom18a4/nsprpub/config/.cvsignore | 11 + src/libs/xpcom18a4/nsprpub/config/Makefile.in | 149 ++++++ src/libs/xpcom18a4/nsprpub/config/autoconf.mk.in | 113 +++++ src/libs/xpcom18a4/nsprpub/config/config.mk | 164 ++++++ src/libs/xpcom18a4/nsprpub/config/libc_r.h | 158 ++++++ src/libs/xpcom18a4/nsprpub/config/nfspwd.pl | 50 ++ src/libs/xpcom18a4/nsprpub/config/now.c | 142 ++++++ src/libs/xpcom18a4/nsprpub/config/nsinstall.c | 602 +++++++++++++++++++++++ src/libs/xpcom18a4/nsprpub/config/nspr-config.in | 116 +++++ src/libs/xpcom18a4/nsprpub/config/nspr.m4 | 67 +++ src/libs/xpcom18a4/nsprpub/config/nsprincl.mk.in | 5 + src/libs/xpcom18a4/nsprpub/config/nsprincl.sh.in | 5 + src/libs/xpcom18a4/nsprpub/config/pathsub.h | 78 +++ src/libs/xpcom18a4/nsprpub/config/prdepend.h | 44 ++ src/libs/xpcom18a4/nsprpub/config/prmkdir.bat | 38 ++ src/libs/xpcom18a4/nsprpub/config/rules.mk | 514 +++++++++++++++++++ 16 files changed, 2256 insertions(+) create mode 100644 src/libs/xpcom18a4/nsprpub/config/.cvsignore create mode 100755 src/libs/xpcom18a4/nsprpub/config/Makefile.in create mode 100644 src/libs/xpcom18a4/nsprpub/config/autoconf.mk.in create mode 100644 src/libs/xpcom18a4/nsprpub/config/config.mk create mode 100644 src/libs/xpcom18a4/nsprpub/config/libc_r.h create mode 100755 src/libs/xpcom18a4/nsprpub/config/nfspwd.pl create mode 100644 src/libs/xpcom18a4/nsprpub/config/now.c create mode 100644 src/libs/xpcom18a4/nsprpub/config/nsinstall.c create mode 100755 src/libs/xpcom18a4/nsprpub/config/nspr-config.in create mode 100644 src/libs/xpcom18a4/nsprpub/config/nspr.m4 create mode 100644 src/libs/xpcom18a4/nsprpub/config/nsprincl.mk.in create mode 100644 src/libs/xpcom18a4/nsprpub/config/nsprincl.sh.in create mode 100644 src/libs/xpcom18a4/nsprpub/config/pathsub.h create mode 100644 src/libs/xpcom18a4/nsprpub/config/prdepend.h create mode 100644 src/libs/xpcom18a4/nsprpub/config/prmkdir.bat create mode 100644 src/libs/xpcom18a4/nsprpub/config/rules.mk (limited to 'src/libs/xpcom18a4/nsprpub/config') diff --git a/src/libs/xpcom18a4/nsprpub/config/.cvsignore b/src/libs/xpcom18a4/nsprpub/config/.cvsignore new file mode 100644 index 00000000..bb3ee4bc --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/.cvsignore @@ -0,0 +1,11 @@ +nfspwd +revdepth +my_config.mk +my_overrides.mk +autoconf.mk +nsprincl.mk +nsprincl.sh +now +Makefile +nsinstall +nspr-config diff --git a/src/libs/xpcom18a4/nsprpub/config/Makefile.in b/src/libs/xpcom18a4/nsprpub/config/Makefile.in new file mode 100755 index 00000000..1b83ffa5 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/Makefile.in @@ -0,0 +1,149 @@ +#! gmake +# +# ***** 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 Portable Runtime (NSPR). +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998-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 ***** + +MOD_DEPTH = .. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(MOD_DEPTH)/config/autoconf.mk + +# Indicate that this directory builds build tools. +INTERNAL_TOOLS = 1 + +# autoconf.mk must be deleted last (from the top-level directory) +# because it is included by every makefile. +DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config + +RELEASE_BINS = nspr-config + +include $(topsrcdir)/config/config.mk + +CSRCS = now.c + +# This version hasn't been ported for us; the one in mozilla/config has +ifneq ($(OS_ARCH),OS2) +CSRCS += nsinstall.c + +PLSRCS = nfspwd.pl +endif + +ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH))) +PROG_SUFFIX = .exe +else +PROG_SUFFIX = +endif + +# Temporary workaround to disable the generation of +# library build time because now.c uses the 'long long' +# data type that's not available on some platforms. +ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH))) +DEFINES += -DOMIT_LIB_BUILD_TIME +endif + +ifeq ($(OS_ARCH), IRIX) + ifeq ($(basename $(OS_RELEASE)),6) + ifndef NS_USE_GCC + ifeq ($(USE_N32),1) + XLDOPTS += -n32 -Wl,-woff,85 + else + ifeq ($(USE_64),1) + XLDOPTS += -64 + else + XLDOPTS += -32 + endif + endif + endif + endif +endif + +ifeq ($(OS_ARCH), HP-UX) + ifeq ($(USE_64),1) + XLDOPTS += +DD64 + endif +endif + +ifeq ($(MOZ_OS2_TOOLS),EMX) +XCFLAGS = $(OS_CFLAGS) +ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF) +XLDOPTS = -Zlinker /PM:VIO +endif +endif + +ifeq ($(MOZ_OS2_TOOLS),PGCC) +XCFLAGS = $(OS_CFLAGS) +XLDOPTS = -Zlinker /PM:VIO +endif + +include $(topsrcdir)/config/rules.mk + +PROGS = $(OBJDIR)/now$(PROG_SUFFIX) + +ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH))) +TARGETS = $(PROGS) +else +PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX) +TARGETS = $(PROGS) $(PLSRCS:.pl=) +endif + +OUTOPTION = -o # end of the line +ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET))) +ifndef NS_USE_GCC +OUTOPTION = /Fe +endif +endif + +# Redefine MAKE_OBJDIR for just this directory +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi +endef + +export:: $(TARGETS) + rm -f $(dist_bindir)/nspr-config + +$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) + @$(MAKE_OBJDIR) +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(LD) $(EXEFLAGS) $< +else + $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ +endif + +real_install:: nspr.m4 + $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal + $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal diff --git a/src/libs/xpcom18a4/nsprpub/config/autoconf.mk.in b/src/libs/xpcom18a4/nsprpub/config/autoconf.mk.in new file mode 100644 index 00000000..92800154 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/autoconf.mk.in @@ -0,0 +1,113 @@ +# -*- Mode: Makefile -*- + +INCLUDED_AUTOCONF_MK = 1 +USE_AUTOCONF = 1 +@SHELL_OVERRIDE@ +MOZILLA_CLIENT = @MOZILLA_CLIENT@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +includedir = @includedir@ +libdir = @libdir@ +datadir = @datadir@ + +dist_prefix = @dist_prefix@ +dist_bindir = @dist_bindir@ +dist_includedir = @dist_includedir@ +dist_libdir = @dist_libdir@ + +DIST = $(dist_prefix) + +RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@ +OBJDIR_NAME = @OBJDIR_NAME@ +OBJDIR = @OBJDIR@ +OBJ_SUFFIX = @OBJ_SUFFIX@ +LIB_SUFFIX = @LIB_SUFFIX@ +DLL_SUFFIX = @DLL_SUFFIX@ +ASM_SUFFIX = @ASM_SUFFIX@ +MOD_NAME = @NSPR_MODNAME@ + +MOD_MAJOR_VERSION = @MOD_MAJOR_VERSION@ +MOD_MINOR_VERSION = @MOD_MINOR_VERSION@ +MOD_PATCH_VERSION = @MOD_PATCH_VERSION@ + +LIBNSPR = @LIBNSPR@ +LIBPLC = @LIBPLC@ + +CROSS_COMPILE = @CROSS_COMPILE@ +BUILD_OPT = @MOZ_OPTIMIZE@ + +USE_CPLUS = @USE_CPLUS@ +USE_IPV6 = @USE_IPV6@ +USE_N32 = @USE_N32@ +USE_64 = @USE_64@ +GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@ +ENABLE_STRIP = @ENABLE_STRIP@ + +USE_PTHREADS = @USE_PTHREADS@ +USE_BTHREADS = @USE_BTHREADS@ +PTHREADS_USER = @USE_USER_PTHREADS@ +CLASSIC_NSPR = @USE_NSPR_THREADS@ + +AS = @AS@ +ASFLAGS = @ASFLAGS@ +CC = @CC@ +CCC = @CXX@ +NS_USE_GCC = @GNU_CC@ +GCC_USE_GNU_LD = @GCC_USE_GNU_LD@ +MSC_VER = @MSC_VER@ +AR = @AR@ +AR_FLAGS = @AR_FLAGS@ +LD = @LD@ +RANLIB = @RANLIB@ +PERL = @PERL@ +RC = @RC@ +RCFLAGS = @RCFLAGS@ +STRIP = @STRIP@ +NSINSTALL = @NSINSTALL@ +FILTER = @FILTER@ +IMPLIB = @IMPLIB@ +CYGWIN_WRAPPER = @CYGWIN_WRAPPER@ + +OS_CPPFLAGS = @CPPFLAGS@ +OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ $(DSO_CFLAGS) +OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ $(DSO_CFLAGS) +OS_LIBS = @OS_LIBS@ +OS_LDFLAGS = @LDFLAGS@ +OS_DLLFLAGS = @OS_DLLFLAGS@ +DLLFLAGS = @DLLFLAGS@ +EXEFLAGS = @EXEFLAGS@ +OPTIMIZER = @OPTIMIZER@ + +MKSHLIB = @MKSHLIB@ +DSO_CFLAGS = @DSO_CFLAGS@ +DSO_LDOPTS = @DSO_LDOPTS@ + +RESOLVE_LINK_SYMBOLS = @RESOLVE_LINK_SYMBOLS@ + +HOST_CC = @HOST_CC@ +HOST_CFLAGS = @HOST_CFLAGS@ + +DEFINES = @DEFINES@ @DEFS@ + +MDCPUCFG_H = @MDCPUCFG_H@ +PR_MD_CSRCS = @PR_MD_CSRCS@ +PR_MD_ASFILES = @PR_MD_ASFILES@ +PR_MD_ARCH_DIR = @PR_MD_ARCH_DIR@ +CPU_ARCH = @CPU_ARCH@ + +OS_TARGET = @OS_TARGET@ +OS_ARCH = @OS_ARCH@ +OS_RELEASE = @OS_RELEASE@ +OS_TEST = @OS_TEST@ + +NOSUCHFILE = @NOSUCHFILE@ +AIX_LINK_OPTS = @AIX_LINK_OPTS@ +MOZ_OBJFORMAT = @MOZ_OBJFORMAT@ +ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@ + +OBJECT_MODE = @OBJECT_MODE@ +ifdef OBJECT_MODE +export OBJECT_MODE +endif diff --git a/src/libs/xpcom18a4/nsprpub/config/config.mk b/src/libs/xpcom18a4/nsprpub/config/config.mk new file mode 100644 index 00000000..697a6015 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/config.mk @@ -0,0 +1,164 @@ +#! gmake +# +# ***** 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 Portable Runtime (NSPR). +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998-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 ***** + +# Configuration information for building in the NSPR source module + +# Define an include-at-most-once-flag +NSPR_CONFIG_MK = 1 + +# +# The variable definitions in this file are inputs to NSPR's +# build system. This file, if present, is included at the +# beginning of config.mk. +# +# For example: +# +# BUILD_OPT=1 +# USE_PTHREADS=1 +# NS_USE_GCC= +# +ifndef topsrcdir +topsrcdir=$(MOD_DEPTH) +endif + +ifndef srcdir +srcdir=. +endif + +NFSPWD = $(MOD_DEPTH)/config/nfspwd + +CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\ + $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS) +CCCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\ + $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS) +# For purify +NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\ + $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS) +NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\ + $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS) + +LDFLAGS = $(OS_LDFLAGS) + +define MAKE_OBJDIR +if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi +endef + +LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) + +ifeq ($(OS_ARCH),Darwin) +PWD := $(shell pwd) +endif + +ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH))) +INSTALL = $(NSINSTALL) +else +ifeq ($(NSDISTMODE),copy) +# copy files, but preserve source mtime +INSTALL = $(NSINSTALL) -t +else +ifeq ($(NSDISTMODE),absolute_symlink) +# install using absolute symbolic links +ifeq ($(OS_ARCH),Darwin) +INSTALL = $(NSINSTALL) -L $(PWD) +else +INSTALL = $(NSINSTALL) -L `$(NFSPWD)` +endif +else +# install using relative symbolic links +INSTALL = $(NSINSTALL) -R +endif +endif +endif # (WINNT || OS2) && !CROSS_COMPILE + +DEPENDENCIES = $(OBJDIR)/.md + +ifdef BUILD_DEBUG_GC +DEFINES += -DDEBUG_GC +endif + +GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*) + +DIST_GARBAGE += Makefile + +#################################################################### +# +# The NSPR-specific configuration +# +#################################################################### + +DEFINES += -DFORCE_PR_LOG + +ifeq ($(_PR_NO_CLOCK_TIMER),1) +DEFINES += -D_PR_NO_CLOCK_TIMER +endif + +ifeq ($(USE_PTHREADS), 1) +DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM +endif + +ifeq ($(PTHREADS_USER), 1) +DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM +endif + +ifeq ($(USE_IPV6),1) +DEFINES += -D_PR_INET6 +endif + +ifeq ($(MOZ_UNICODE),1) +DEFINES += -DMOZ_UNICODE +endif + +#################################################################### +# +# Configuration for the release process +# +#################################################################### + +MDIST = /m/dist +ifeq ($(OS_ARCH),WINNT) +MDIST = //helium/dist +MDIST_DOS = $(subst /,\\,$(MDIST)) +endif + +# RELEASE_DIR is ns/dist/ + +RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME) + +RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include +RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin +RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib diff --git a/src/libs/xpcom18a4/nsprpub/config/libc_r.h b/src/libs/xpcom18a4/nsprpub/config/libc_r.h new file mode 100644 index 00000000..0f66d127 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/libc_r.h @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** 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 Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-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 ***** */ + +/* libc_r.h -- macros, defines, etc. to make using reentrant libc calls */ +/* a bit easier. This was initially done for AIX pthreads, */ +/* but should be usable for anyone... */ + +/* Most of these use locally defined space instead of static library space. */ +/* Because of this, we use the _INIT_R to declare/allocate space (stack), */ +/* and the plain routines to actually do it..._WARNING_: avoid allocating */ +/* memory wherever possible. Memory allocation is fairly expensive, at */ +/* least on AIX...use arrays instead (which allocate from the stack.) */ +/* I know the names are a bit strange, but I wanted to be fairly certain */ +/* that we didn't have any namespace corruption...in general, the inits are */ +/* R__INIT_R(), and the actual calls are R__R(). */ + +#ifndef _LIBC_R_H +#define _LIBC_R_H + +/************/ +/* strtok */ +/************/ +#define R_STRTOK_INIT_R() \ + char *r_strtok_r=NULL + +#define R_STRTOK_R(return,source,delim) \ + return=strtok_r(source,delim,&r_strtok_r) + +#define R_STRTOK_NORET_R(source,delim) \ + strtok_r(source,delim,&r_strtok_r) + +/**************/ +/* strerror */ +/**************/ +#define R_MAX_STRERROR_LEN_R 8192 /* Straight from limits.h */ + +#define R_STRERROR_INIT_R() \ + char r_strerror_r[R_MAX_STRERROR_LEN_R] + +#define R_STRERROR_R(val) \ + strerror_r(val,r_strerror_r,R_MAX_STRERROR_LEN_R) + +/*****************/ +/* time things */ +/*****************/ +#define R_ASCTIME_INIT_R() \ + char r_asctime_r[26] + +#define R_ASCTIME_R(val) \ + asctime_r(val,r_asctime_r) + +#define R_CTIME_INIT_R() \ + char r_ctime_r[26] + +#define R_CTIME_R(val) \ + ctime_r(val,r_ctime_r) + +#define R_GMTIME_INIT_R() \ + struct tm r_gmtime_r + +#define R_GMTIME_R(time) \ + gmtime_r(time,&r_gmtime_r) + +#define R_LOCALTIME_INIT_R() \ + struct tm r_localtime_r + +#define R_LOCALTIME_R(val) \ + localtime_r(val,&r_localtime_r) + +/***********/ +/* crypt */ +/***********/ +#include +#define R_CRYPT_INIT_R() \ + CRYPTD r_cryptd_r; \ + bzero(&r_cryptd_r,sizeof(CRYPTD)) + +#define R_CRYPT_R(pass,salt) \ + crypt_r(pass,salt,&r_cryptd_r) + +/**************/ +/* pw stuff */ +/**************/ +#define R_MAX_PW_LEN_R 1024 +/* The following must be after the last declaration, but */ +/* before the first bit of code... */ +#define R_GETPWNAM_INIT_R(pw_ptr) \ + struct passwd r_getpwnam_pw_r; \ + char r_getpwnam_line_r[R_MAX_PW_LEN_R]; \ + pw_ptr = &r_getpwnam_pw_r + +#define R_GETPWNAM_R(name) \ + getpwnam_r(name,&r_getpwnam_pw_r,r_getpwnam_line_r,R_MAX_PW_LEN_R) + +/*******************/ +/* gethost stuff */ +/*******************/ +#define R_GETHOSTBYADDR_INIT_R() \ + struct hostent r_gethostbyaddr_r; \ + struct hostent_data r_gethostbyaddr_data_r + +#define R_GETHOSTBYADDR_R(addr,len,type,xptr_ent) \ + bzero(&r_gethostbyaddr_r,sizeof(struct hostent)); \ + bzero(&r_gethostbyaddr_data_r,sizeof(struct hostent_data)); \ + xptr_ent = &r_gethostbyaddr_r; \ + if (gethostbyaddr_r(addr,len,type, \ + &r_gethostbyaddr_r,&r_gethostbyaddr_data_r) == -1) { \ + xptr_ent = NULL; \ + } + +#define R_GETHOSTBYNAME_INIT_R() \ + struct hostent r_gethostbyname_r; \ + struct hostent_data r_gethostbyname_data_r + +#define R_GETHOSTBYNAME_R(name,xptr_ent) \ + bzero(&r_gethostbyname_r,sizeof(struct hostent)); \ + bzero(&r_gethostbyname_data_r,sizeof(struct hostent_data)); \ + xptr_ent = &r_gethostbyname_r; \ + if (gethostbyname_r(name, \ + &r_gethostbyname_r,&r_gethostbyname_data_r) == -1) { \ + xptr_ent = NULL; \ + } + +#endif /* _LIBC_R_H */ diff --git a/src/libs/xpcom18a4/nsprpub/config/nfspwd.pl b/src/libs/xpcom18a4/nsprpub/config/nfspwd.pl new file mode 100755 index 00000000..947b822a --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nfspwd.pl @@ -0,0 +1,50 @@ +#! perl +# +# ***** 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 Portable Runtime (NSPR). +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998-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 ***** + +require "fastcwd.pl"; + +$_ = &fastcwd; +if (m@^/[uh]/@o || s@^/tmp_mnt/@/@o) { + print("$_\n"); +} elsif ((($user, $rest) = m@^/usr/people/(\w+)/(.*)@o) + && readlink("/u/$user") eq "/usr/people/$user") { + print("/u/$user/$rest\n"); +} else { + chop($host = `hostname`); + print("/h/$host$_\n"); +} diff --git a/src/libs/xpcom18a4/nsprpub/config/now.c b/src/libs/xpcom18a4/nsprpub/config/now.c new file mode 100644 index 00000000..f797ef84 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/now.c @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** 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 Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-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 +#include + +#if defined(VMS) +#include +#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS) +#include +#elif defined(WIN32) +#include +#elif defined(XP_OS2_VACPP) +#include +#else +#error "Architecture not supported" +#endif + + +int main(int argc, char **argv) +{ +#if defined(OMIT_LIB_BUILD_TIME) + /* + * Some platforms don't have any 64-bit integer type + * such as 'long long'. Because we can't use NSPR's + * PR_snprintf in this program, it is difficult to + * print a static initializer for PRInt64 (a struct). + * So we print nothing. The makefiles that build the + * shared libraries will detect the empty output string + * of this program and omit the library build time + * in PRVersionDescription. + */ +#elif defined(VMS) + long long now; + struct timeb b; + ftime(&b); + now = b.time; + now *= 1000000; + now += (1000 * b.millitm); + fprintf(stdout, "%Ld", now); +#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS) + long long now; + struct timeval tv; +#ifdef HAVE_SVID_GETTOD + gettimeofday(&tv); +#else + gettimeofday(&tv, NULL); +#endif + now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec; +#if defined(OSF1) + fprintf(stdout, "%ld", now); +#elif defined(BEOS) && defined(__POWERPC__) + fprintf(stdout, "%Ld", now); /* Metroworks on BeOS PPC */ +#else + fprintf(stdout, "%lld", now); +#endif + +#elif defined(WIN32) + __int64 now; + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + CopyMemory(&now, &ft, sizeof(now)); + /* + * 116444736000000000 is the number of 100-nanosecond intervals + * between Jan. 1, 1601 and Jan. 1, 1970. + */ +#ifdef __GNUC__ + now = (now - 116444736000000000LL) / 10LL; + fprintf(stdout, "%lld", now); +#else + now = (now - 116444736000000000i64) / 10i64; + fprintf(stdout, "%I64d", now); +#endif + +#elif defined(XP_OS2_VACPP) +/* no long long or i64 so we use a string */ +#include + char buf[24]; + char tbuf[7]; + time_t now; + long mtime; + int i; + + struct timeb b; + ftime(&b); + now = b.time; + _ltoa(now, buf, 10); + + mtime = b.millitm * 1000; + if (mtime == 0){ + ++now; + strcat(buf, "000000"); + } else { + _ltoa(mtime, tbuf, 10); + for (i = strlen(tbuf); i < 6; ++i) + strcat(buf, "0"); + strcat(buf, tbuf); + } + fprintf(stdout, "%s", buf); + +#else +#error "Architecture not supported" +#endif + + return 0; +} /* main */ + +/* now.c */ diff --git a/src/libs/xpcom18a4/nsprpub/config/nsinstall.c b/src/libs/xpcom18a4/nsprpub/config/nsinstall.c new file mode 100644 index 00000000..319a9594 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nsinstall.c @@ -0,0 +1,602 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** 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 Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-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 ***** */ + +/* +** Netscape portable install command. +** +** Brendan Eich, 7/20/95 +*/ +#include /* OSF/1 requires this before grp.h, so put it first */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USE_REENTRANT_LIBC +#include "libc_r.h" +#endif /* USE_REENTRANT_LIBC */ + +#include "pathsub.h" + +#define HAVE_FCHMOD + +#if defined(BEOS) +#undef HAVE_FCHMOD +#endif + +/* + * Does getcwd() take NULL as the first argument and malloc + * the result buffer? + */ +#if !defined(DARWIN) && !defined(NEXTSTEP) && !defined(VMS) +#define GETCWD_CAN_MALLOC +#endif + +#ifdef NEXTSTEP +#include + +/* +** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0), +** when called on a mounted fs. Did anyone notice this? Here's an ugly +** workaround ... +*/ +#define getcwd(b,s) my_getcwd(b,s) + +static char * +my_getcwd (char *buf, size_t size) +{ + FILE *pwd = popen("pwd", "r"); + char *result = fgets(buf, size, pwd); + + if (result) { + buf[strlen(buf)-1] = '\0'; + } + pclose (pwd); + return buf; +} +#endif /* NEXTSTEP */ + +#ifdef LINUX +#include +#endif + +#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) || defined(NEXTSTEP) +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +#endif +#endif + +#if defined(SNI) +extern int fchmod(int fildes, mode_t mode); +#endif + +#ifdef QNX +#define d_ino d_stat.st_ino +#endif + +static void +usage(void) +{ + fprintf(stderr, + "usage: %s [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]\n" + " %*s [-DdltR] file [file ...] directory\n", + program, (int)strlen(program), ""); + exit(2); +} + +static int +mkdirs(char *path, mode_t mode) +{ + char *cp; + struct stat sb; + int res; + + while (*path == '/' && path[1] == '/') + path++; + while ((cp = strrchr(path, '/')) && cp[1] == '\0') + *cp = '\0'; + if (cp && cp != path) { + *cp = '\0'; + if ((stat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(path, mode) < 0) { + return -1; + } + *cp = '/'; + } + res = mkdir(path, mode); + if ((res != 0) && (errno == EEXIST)) + return 0; + else + return res; +} + +static uid_t +touid(char *owner) +{ + struct passwd *pw; + uid_t uid; + char *cp; + + pw = getpwnam(owner); + if (pw) + return pw->pw_uid; + uid = strtol(owner, &cp, 0); + if (uid == 0 && cp == owner) + fail("cannot find uid for %s", owner); + return uid; +} + +static gid_t +togid(char *group) +{ + struct group *gr; + gid_t gid; + char *cp; + + gr = getgrnam(group); + if (gr) + return gr->gr_gid; + gid = strtol(group, &cp, 0); + if (gid == 0 && cp == group) + fail("cannot find gid for %s", group); + return gid; +} + +int +main(int argc, char **argv) +{ + int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists, fromfd, tofd, cc, wc; + mode_t mode = 0755; + char *linkprefix, *owner, *group, *cp, *cwd, *todir, *toname, *name, *base, *linkname, *bp, buf[BUFSIZ]; + uid_t uid; + gid_t gid; + struct stat sb, tosb; + struct utimbuf utb; + + program = argv[0]; + cwd = linkname = linkprefix = owner = group = 0; + onlydir = dodir = dolink = dorelsymlink = dotimes = lplen = 0; + + while ((opt = getopt(argc, argv, "C:DdlL:Rm:o:g:t")) != EOF) { + switch (opt) { + case 'C': + cwd = optarg; + break; + case 'D': + onlydir = 1; + break; + case 'd': + dodir = 1; + break; + case 'l': + dolink = 1; + break; + case 'L': + linkprefix = optarg; + lplen = strlen(linkprefix); + dolink = 1; + break; + case 'R': + dolink = dorelsymlink = 1; + break; + case 'm': + mode = strtoul(optarg, &cp, 8); + if (mode == 0 && cp == optarg) + usage(); + break; + case 'o': + owner = optarg; + break; + case 'g': + group = optarg; + break; + case 't': + dotimes = 1; + break; + default: + usage(); + } + } + + argc -= optind; + argv += optind; + if (argc < 2 - onlydir) + usage(); + + todir = argv[argc-1]; + if ((stat(todir, &sb) < 0 || !S_ISDIR(sb.st_mode)) && + mkdirs(todir, 0777) < 0) { + fail("cannot make directory %s", todir); + } + if (onlydir) + return 0; + + if (!cwd) { +#ifdef GETCWD_CAN_MALLOC + cwd = getcwd(0, PATH_MAX); +#else + cwd = malloc(PATH_MAX + 1); + cwd = getcwd(cwd, PATH_MAX); +#endif + } + xchdir(todir); +#ifdef GETCWD_CAN_MALLOC + todir = getcwd(0, PATH_MAX); +#else + todir = malloc(PATH_MAX + 1); + todir = getcwd(todir, PATH_MAX); +#endif + tdlen = strlen(todir); + xchdir(cwd); + tdlen = strlen(todir); + + uid = owner ? touid(owner) : -1; + gid = group ? togid(group) : -1; + + while (--argc > 0) { + name = *argv++; + len = strlen(name); + base = xbasename(name); + bnlen = strlen(base); + toname = (char*)xmalloc(tdlen + 1 + bnlen + 1); + sprintf(toname, "%s/%s", todir, base); + exists = (lstat(toname, &tosb) == 0); + + if (dodir) { + /* -d means create a directory, always */ + if (exists && !S_ISDIR(tosb.st_mode)) { + (void) unlink(toname); + exists = 0; + } + if (!exists && mkdir(toname, mode) < 0) + fail("cannot make directory %s", toname); + if ((owner || group) && chown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); + } else if (dolink) { + if (*name == '/') { + /* source is absolute pathname, link to it directly */ + linkname = 0; + } else { + if (linkprefix) { + /* -L implies -l and prefixes names with a $cwd arg. */ + len += lplen + 1; + linkname = (char*)xmalloc(len + 1); + sprintf(linkname, "%s/%s", linkprefix, name); + } else if (dorelsymlink) { + /* Symlink the relative path from todir to source name. */ + linkname = (char*)xmalloc(PATH_MAX); + + if (*todir == '/') { + /* todir is absolute: skip over common prefix. */ + lplen = relatepaths(todir, cwd, linkname); + strcpy(linkname + lplen, name); + } else { + /* todir is named by a relative path: reverse it. */ + reversepath(todir, name, len, linkname); + xchdir(cwd); + } + + len = strlen(linkname); + } + name = linkname; + } + + /* Check for a pre-existing symlink with identical content. */ + if (exists && + (!S_ISLNK(tosb.st_mode) || + readlink(toname, buf, sizeof buf) != len || + strncmp(buf, name, len) != 0)) { + (void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + exists = 0; + } + if (!exists && symlink(name, toname) < 0) + fail("cannot make symbolic link %s", toname); +#ifdef HAVE_LCHOWN + if ((owner || group) && lchown(toname, uid, gid) < 0) + fail("cannot change owner of %s", toname); +#endif + + if (linkname) { + free(linkname); + linkname = 0; + } + } else { + /* Copy from name to toname, which might be the same file. */ + fromfd = open(name, O_RDONLY); + if (fromfd < 0 || fstat(fromfd, &sb) < 0) + fail("cannot access %s", name); + if (exists && (!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0)) + (void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + tofd = open(toname, O_CREAT | O_WRONLY, 0666); + if (tofd < 0) + fail("cannot create %s", toname); + + bp = buf; + while ((cc = read(fromfd, bp, sizeof buf)) > 0) { + while ((wc = write(tofd, bp, cc)) > 0) { + if ((cc -= wc) == 0) + break; + bp += wc; + } + if (wc < 0) + fail("cannot write to %s", toname); + } + if (cc < 0) + fail("cannot read from %s", name); + + if (ftruncate(tofd, sb.st_size) < 0) + fail("cannot truncate %s", toname); + /* + ** On OpenVMS we can't chmod() until the file is closed, and we + ** have to utime() last since fchown/chmod alter the timestamps. + */ +#ifndef VMS + if (dotimes) { + utb.actime = sb.st_atime; + utb.modtime = sb.st_mtime; + if (utime(toname, &utb) < 0) + fail("cannot set times of %s", toname); + } +#ifdef HAVE_FCHMOD + if (fchmod(tofd, mode) < 0) +#else + if (chmod(toname, mode) < 0) +#endif + fail("cannot change mode of %s", toname); +#endif + if ((owner || group) && fchown(tofd, uid, gid) < 0) + fail("cannot change owner of %s", toname); + + /* Must check for delayed (NFS) write errors on close. */ + if (close(tofd) < 0) + fail("cannot write to %s", toname); + close(fromfd); +#ifdef VMS + if (chmod(toname, mode) < 0) + fail("cannot change mode of %s", toname); + if (dotimes) { + utb.actime = sb.st_atime; + utb.modtime = sb.st_mtime; + if (utime(toname, &utb) < 0) + fail("cannot set times of %s", toname); + } +#endif + } + + free(toname); + } + + free(cwd); + free(todir); + return 0; +} + +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ + +char *program; + +void +fail(char *format, ...) +{ + int error; + va_list ap; + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_INIT_R(); +#endif + + error = errno; + fprintf(stderr, "%s: ", program); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (error) + +#ifdef USE_REENTRANT_LIBC + R_STRERROR_R(errno); + fprintf(stderr, ": %s", r_strerror_r); +#else + fprintf(stderr, ": %s", strerror(errno)); +#endif + + putc('\n', stderr); + exit(1); +} + +char * +getcomponent(char *path, char *name) +{ + if (*path == '\0') + return 0; + if (*path == '/') { + *name++ = '/'; + } else { + do { + *name++ = *path++; + } while (*path != '/' && *path != '\0'); + } + *name = '\0'; + while (*path == '/') + path++; + return path; +} + +#ifdef UNIXWARE_READDIR_BUFFER_TOO_SMALL +/* Sigh. The static buffer in Unixware's readdir is too small. */ +struct dirent * readdir(DIR *d) +{ + static struct dirent *buf = NULL; +#define MAX_PATH_LEN 1024 + + + if(buf == NULL) + buf = (struct dirent *) malloc(sizeof(struct dirent) + MAX_PATH_LEN) +; + return(readdir_r(d, buf)); +} +#endif + +char * +ino2name(ino_t ino, char *dir) +{ + DIR *dp; + struct dirent *ep; + char *name; + + dp = opendir(".."); + if (!dp) + fail("cannot read parent directory"); + for (;;) { + if (!(ep = readdir(dp))) + fail("cannot find current directory"); + if (ep->d_ino == ino) + break; + } + name = xstrdup(ep->d_name); + closedir(dp); + return name; +} + +void * +xmalloc(size_t size) +{ + void *p = malloc(size); + if (!p) + fail("cannot allocate %u bytes", size); + return p; +} + +char * +xstrdup(char *s) +{ + return strcpy((char*)xmalloc(strlen(s) + 1), s); +} + +char * +xbasename(char *path) +{ + char *cp; + + while ((cp = strrchr(path, '/')) && cp[1] == '\0') + *cp = '\0'; + if (!cp) return path; + return cp + 1; +} + +void +xchdir(char *dir) +{ + if (chdir(dir) < 0) + fail("cannot change directory to %s", dir); +} + +int +relatepaths(char *from, char *to, char *outpath) +{ + char *cp, *cp2; + int len; + char buf[NAME_MAX]; + + assert(*from == '/' && *to == '/'); + for (cp = to, cp2 = from; *cp == *cp2; cp++, cp2++) + if (*cp == '\0') + break; + while (cp[-1] != '/') + cp--, cp2--; + if (cp - 1 == to) { + /* closest common ancestor is /, so use full pathname */ + len = strlen(strcpy(outpath, to)); + if (outpath[len] != '/') { + outpath[len++] = '/'; + outpath[len] = '\0'; + } + } else { + len = 0; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + strcpy(outpath + len, "../"); + len += 3; + } + while ((cp = getcomponent(cp, buf)) != 0) { + sprintf(outpath + len, "%s/", buf); + len += strlen(outpath + len); + } + } + return len; +} + +void +reversepath(char *inpath, char *name, int len, char *outpath) +{ + char *cp, *cp2; + char buf[NAME_MAX]; + struct stat sb; + + cp = strcpy(outpath + PATH_MAX - (len + 1), name); + cp2 = inpath; + while ((cp2 = getcomponent(cp2, buf)) != 0) { + if (strcmp(buf, ".") == 0) + continue; + if (strcmp(buf, "..") == 0) { + if (stat(".", &sb) < 0) + fail("cannot stat current directory"); + name = ino2name(sb.st_ino, ".."); + len = strlen(name); + cp -= len + 1; + strcpy(cp, name); + cp[len] = '/'; + free(name); + xchdir(".."); + } else { + cp -= 3; + strncpy(cp, "../", 3); + xchdir(buf); + } + } + strcpy(outpath, cp); +} diff --git a/src/libs/xpcom18a4/nsprpub/config/nspr-config.in b/src/libs/xpcom18a4/nsprpub/config/nspr-config.in new file mode 100755 index 00000000..e9e18679 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nspr-config.in @@ -0,0 +1,116 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set=no + +major_version=@MOD_MAJOR_VERSION@ +minor_version=@MOD_MINOR_VERSION@ +patch_version=@MOD_PATCH_VERSION@ + +usage() +{ + cat <&2 +fi + +lib_nspr=yes +lib_plc=yes +lib_plds=yes + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --version) + echo ${major_version}.${minor_version}.${patch_version} + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + nspr) + lib_nspr=yes + ;; + plc) + lib_plc=yes + ;; + plds) + lib_plds=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes"; then + echo $exec_prefix +fi + +if test "$echo_cflags" = "yes"; then + echo -I${prefix}/include/nspr +fi + +if test "$echo_libs" = "yes"; then + libdirs=-L${exec_prefix}/lib + if test -n "$lib_plds"; then + libdirs="$libdirs -lplds${major_version}" + fi + if test -n "$lib_plc"; then + libdirs="$libdirs -lplc${major_version}" + fi + if test -n "$lib_nspr"; then + libdirs="$libdirs -lnspr${major_version}" + fi + os_ldflags="@LDFLAGS@" + for i in $os_ldflags ; do + if echo $i | grep \^-L >/dev/null; then + libdirs="$libdirs $i" + fi + done + echo $libdirs @OS_LIBS@ +fi + diff --git a/src/libs/xpcom18a4/nsprpub/config/nspr.m4 b/src/libs/xpcom18a4/nsprpub/config/nspr.m4 new file mode 100644 index 00000000..8174bea9 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nspr.m4 @@ -0,0 +1,67 @@ +# -*- tab-width: 4; -*- +# Configure paths for NSPR +# Public domain - Chris Seawood 2001-04-05 +# Based upon gtk.m4 (also PD) by Owen Taylor + +dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS +AC_DEFUN(AM_PATH_NSPR, +[dnl + +AC_ARG_WITH(nspr-prefix, + [ --with-nspr-prefix=PFX Prefix where NSPR is installed], + nspr_config_prefix="$withval", + nspr_config_prefix="") + +AC_ARG_WITH(nspr-exec-prefix, + [ --with-nspr-exec-prefix=PFX + Exec prefix where NSPR is installed], + nspr_config_exec_prefix="$withval", + nspr_config_exec_prefix="") + + if test -n "$nspr_config_exec_prefix"; then + nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix" + if test -z "$NSPR_CONFIG"; then + NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config + fi + fi + if test -n "$nspr_config_prefix"; then + nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix" + if test -z "$NSPR_CONFIG"; then + NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config + fi + fi + + unset ac_cv_path_NSPR_CONFIG + AC_PATH_PROG(NSPR_CONFIG, nspr-config, no) + min_nspr_version=ifelse([$1], ,4.0.0,$1) + AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version (skipping)) + + no_nspr="" + if test "$NSPR_CONFIG" = "no"; then + no_nspr="yes" + else + NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags` + NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs` + + dnl Skip version check for now + nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + fi + + if test -z "$no_nspr"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + fi + + + AC_SUBST(NSPR_CFLAGS) + AC_SUBST(NSPR_LIBS) + +]) diff --git a/src/libs/xpcom18a4/nsprpub/config/nsprincl.mk.in b/src/libs/xpcom18a4/nsprpub/config/nsprincl.mk.in new file mode 100644 index 00000000..d56cc024 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nsprincl.mk.in @@ -0,0 +1,5 @@ +# Include in Makefiles to define NSPR variables + +NSPR_VERSION = @NSPR_VERSION@ +NSPR_LIB = -lnspr@NSPR_VERSION@ +NSPR_EXTRA_LIBS = @EXTRA_LIBS@ diff --git a/src/libs/xpcom18a4/nsprpub/config/nsprincl.sh.in b/src/libs/xpcom18a4/nsprpub/config/nsprincl.sh.in new file mode 100644 index 00000000..be4e1450 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/nsprincl.sh.in @@ -0,0 +1,5 @@ +# Include in shell scripts to define NSPR variables + +NSPR_VERSION=@NSPR_VERSION@ +NSPR_LIB=-lnspr$NSPR_VERSION +NSPR_EXTRA_LIBS="@EXTRA_LIBS@" diff --git a/src/libs/xpcom18a4/nsprpub/config/pathsub.h b/src/libs/xpcom18a4/nsprpub/config/pathsub.h new file mode 100644 index 00000000..bf3fca31 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/pathsub.h @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** 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 Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998-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 ***** */ + +#ifndef pathsub_h___ +#define pathsub_h___ +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ +#include +#include + +#if SUNOS4 +#include "../pr/include/md/sunos4.h" +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +/* + * Just prevent stupidity + */ +#undef NAME_MAX +#define NAME_MAX 256 + +extern char *program; + +extern void fail(char *format, ...); +extern char *getcomponent(char *path, char *name); +extern char *ino2name(ino_t ino, char *dir); +extern void *xmalloc(size_t size); +extern char *xstrdup(char *s); +extern char *xbasename(char *path); +extern void xchdir(char *dir); + +/* Relate absolute pathnames from and to returning the result in outpath. */ +extern int relatepaths(char *from, char *to, char *outpath); + +/* XXX changes current working directory -- caveat emptor */ +extern void reversepath(char *inpath, char *name, int len, char *outpath); + +#endif /* pathsub_h___ */ diff --git a/src/libs/xpcom18a4/nsprpub/config/prdepend.h b/src/libs/xpcom18a4/nsprpub/config/prdepend.h new file mode 100644 index 00000000..df72c568 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/prdepend.h @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** 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 Portable Runtime (NSPR). + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 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 ***** */ + +/* + * A dummy header file that is a dependency for all the object files. + * Used to force a full recompilation of NSPR in Mozilla's Tinderbox + * depend builds. See comments in rules.mk. + */ + +#error "Do not include this header file." diff --git a/src/libs/xpcom18a4/nsprpub/config/prmkdir.bat b/src/libs/xpcom18a4/nsprpub/config/prmkdir.bat new file mode 100644 index 00000000..9bea8553 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/prmkdir.bat @@ -0,0 +1,38 @@ +REM +REM ***** BEGIN LICENSE BLOCK ***** +REM Version: MPL 1.1/GPL 2.0/LGPL 2.1 +REM +REM The contents of this file are subject to the Mozilla Public License Version +REM 1.1 (the "License"); you may not use this file except in compliance with +REM the License. You may obtain a copy of the License at +REM http://www.mozilla.org/MPL/ +REM +REM Software distributed under the License is distributed on an "AS IS" basis, +REM WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +REM for the specific language governing rights and limitations under the +REM License. +REM +REM The Original Code is the Netscape Portable Runtime (NSPR). +REM +REM The Initial Developer of the Original Code is +REM Netscape Communications Corporation. +REM Portions created by the Initial Developer are Copyright (C) 1998-2000 +REM the Initial Developer. All Rights Reserved. +REM +REM Contributor(s): +REM +REM Alternatively, the contents of this file may be used under the terms of +REM either the GNU General Public License Version 2 or later (the "GPL"), or +REM the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +REM in which case the provisions of the GPL or the LGPL are applicable instead +REM of those above. If you wish to allow use of your version of this file only +REM under the terms of either the GPL or the LGPL, and not to allow others to +REM use your version of this file under the terms of the MPL, indicate your +REM decision by deleting the provisions above and replace them with the notice +REM and other provisions required by the GPL or the LGPL. If you do not delete +REM the provisions above, a recipient may use your version of this file under +REM the terms of any one of the MPL, the GPL or the LGPL. +REM +REM ***** END LICENSE BLOCK ***** + +mkdir %1 diff --git a/src/libs/xpcom18a4/nsprpub/config/rules.mk b/src/libs/xpcom18a4/nsprpub/config/rules.mk new file mode 100644 index 00000000..bba50ee7 --- /dev/null +++ b/src/libs/xpcom18a4/nsprpub/config/rules.mk @@ -0,0 +1,514 @@ +#! gmake +# +# ***** 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 Portable Runtime (NSPR). +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998-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 ***** + +################################################################################ +# We have a 4 pass build process: +# +# Pass 1. export - Create generated headers and stubs. Publish public headers to +# dist//include. +# +# Pass 2. libs - Create libraries. Publish libraries to dist//lib. +# +# Pass 3. all - Create programs. +# +# Pass 4. install - Publish programs to dist//bin. +# +# Parameters to this makefile (set these before including): +# +# a) +# TARGETS -- the target to create +# (defaults to $LIBRARY $PROGRAM) +# b) +# DIRS -- subdirectories for make to recurse on +# (the 'all' rule builds $TARGETS $DIRS) +# c) +# CSRCS -- .c files to compile +# (used to define $OBJS) +# d) +# PROGRAM -- the target program name to create from $OBJS +# ($OBJDIR automatically prepended to it) +# e) +# LIBRARY -- the target library name to create from $OBJS +# ($OBJDIR automatically prepended to it) +# +################################################################################ + +ifndef topsrcdir +topsrcdir=$(MOD_DEPTH) +endif + +ifndef srcdir +srcdir=. +endif + +ifndef NSPR_CONFIG_MK +include $(topsrcdir)/config/config.mk +endif + +ifdef USE_AUTOCONF +ifdef CROSS_COMPILE +ifdef INTERNAL_TOOLS +CC=$(HOST_CC) +CCC=$(HOST_CXX) +CFLAGS=$(HOST_CFLAGS) +CXXFLAGS=$(HOST_CXXFLAGS) +endif +endif +endif + +# +# This makefile contains rules for building the following kinds of +# libraries: +# - LIBRARY: a static (archival) library +# - SHARED_LIBRARY: a shared (dynamic link) library +# - IMPORT_LIBRARY: an import library, used only on Windows and OS/2 +# +# The names of these libraries can be generated by simply specifying +# LIBRARY_NAME and LIBRARY_VERSION. +# + +ifdef LIBRARY_NAME +ifeq (,$(filter-out WINNT OS2,$(OS_ARCH))) + +# +# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule. +# other platforms do not. +# +ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET))) +LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) +SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) +IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb +else +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) +IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb +endif + +else + +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a +else +ifdef MKSHLIB +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) +endif +endif + +endif +endif + +ifndef TARGETS +ifeq (,$(filter-out WINNT OS2,$(OS_ARCH))) +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) +ifndef BUILD_OPT +ifdef MSC_VER +ifneq ($(MSC_VER),1200) +TARGETS += $(SHARED_LIB_PDB) +endif +endif +endif +else +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) +endif +endif + +# +# OBJS is the list of object files. It can be constructed by +# specifying CSRCS (list of C source files) and ASFILES (list +# of assembly language source files). +# + +ifndef OBJS +OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \ + $(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX))) +endif + +ifeq ($(MOZ_OS2_TOOLS),VACPP) +EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS)) +endif + +ALL_TRASH = $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \ + $(NOSUCHFILE) \ + so_locations + +ifeq ($(OS_ARCH),OpenVMS) +ALL_TRASH += $(wildcard *.c*_defines) +ifdef SHARED_LIBRARY +VMS_SYMVEC_FILE = $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt) +VMS_SYMVEC_FILE_MODULE = $(srcdir)/$(LIBRARY_NAME)_symvec.opt +ALL_TRASH += $(VMS_SYMVEC_FILE) +endif +endif + +ifndef RELEASE_LIBS_DEST +RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR) +endif + +ifdef DIRS +LOOP_OVER_DIRS = \ + @for d in $(DIRS); do \ + if test -d $$d; then \ + set -e; \ + echo "cd $$d; $(MAKE) $@"; \ + $(MAKE) -C $$d $@; \ + set +e; \ + else \ + echo "Skipping non-directory $$d..."; \ + fi; \ + done +endif + +################################################################################ + +all:: export + +export:: + +$(LOOP_OVER_DIRS) + +libs:: export + +install:: export + +clean:: + rm -rf $(OBJS) so_locations $(NOSUCHFILE) $(GARBAGE) + +$(LOOP_OVER_DIRS) + +clobber:: + rm -rf $(OBJS) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE) + +$(LOOP_OVER_DIRS) + +realclean clobber_all:: + rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) + +$(LOOP_OVER_DIRS) + +distclean:: + rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE) + +$(LOOP_OVER_DIRS) + +real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS) +ifdef RELEASE_BINS + $(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir) +endif +ifdef RELEASE_HEADERS + $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir) +endif +ifdef RELEASE_LIBS + $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir) +endif + +$(LOOP_OVER_DIRS) + +release:: export +ifdef RELEASE_BINS + @echo "Copying executable programs and scripts to release directory" + @if test -z "$(BUILD_NUMBER)"; then \ + echo "BUILD_NUMBER must be defined"; \ + false; \ + else \ + true; \ + fi + @if test ! -d $(RELEASE_BIN_DIR); then \ + rm -rf $(RELEASE_BIN_DIR); \ + $(NSINSTALL) -D $(RELEASE_BIN_DIR);\ + else \ + true; \ + fi + cp $(RELEASE_BINS) $(RELEASE_BIN_DIR) +endif +ifdef RELEASE_LIBS + @echo "Copying libraries to release directory" + @if test -z "$(BUILD_NUMBER)"; then \ + echo "BUILD_NUMBER must be defined"; \ + false; \ + else \ + true; \ + fi + @if test ! -d $(RELEASE_LIBS_DEST); then \ + rm -rf $(RELEASE_LIBS_DEST); \ + $(NSINSTALL) -D $(RELEASE_LIBS_DEST);\ + else \ + true; \ + fi + cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST) +endif +ifdef RELEASE_HEADERS + @echo "Copying header files to release directory" + @if test -z "$(BUILD_NUMBER)"; then \ + echo "BUILD_NUMBER must be defined"; \ + false; \ + else \ + true; \ + fi + @if test ! -d $(RELEASE_HEADERS_DEST); then \ + rm -rf $(RELEASE_HEADERS_DEST); \ + $(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\ + else \ + true; \ + fi + cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST) +endif + +$(LOOP_OVER_DIRS) + +alltags: + rm -f TAGS tags + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a + +$(NFSPWD): + cd $(@D); $(MAKE) $(@F) + +$(PROGRAM): $(OBJS) + @$(MAKE_OBJDIR) +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) + $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) +else +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) +else + $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) +endif +endif +ifdef ENABLE_STRIP + $(STRIP) $@ +endif + +$(LIBRARY): $(OBJS) + @$(MAKE_OBJDIR) + rm -f $@ +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS) +else + $(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS) +endif + $(RANLIB) $@ + +ifeq ($(OS_TARGET), OS2) +$(IMPORT_LIBRARY): $(MAPFILE) + rm -f $@ + $(IMPLIB) $@ $(MAPFILE) +endif + +$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE) + @$(MAKE_OBJDIR) + rm -f $@ +ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) + echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms + nm -B -C -g $(OBJS) \ + | awk '/ [T,D] / {print $$3}' \ + | sed -e 's/^\.//' \ + | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms + $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \ + -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) +else # AIX 4.1 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) + $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES) +else +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE) +else # !os2 vacpp +ifeq ($(OS_TARGET), OpenVMS) + @if test ! -f $(VMS_SYMVEC_FILE); then \ + if test -f $(VMS_SYMVEC_FILE_MODULE); then \ + echo Creating component options file $(VMS_SYMVEC_FILE); \ + cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \ + fi; \ + fi +endif # OpenVMS + $(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS) +endif # OS2 vacpp +endif # WINNT +endif # AIX 4.1 +ifdef ENABLE_STRIP + $(STRIP) $@ +endif + +ifeq ($(OS_ARCH),WINNT) +$(RES): $(RESNAME) + @$(MAKE_OBJDIR) +# The resource compiler does not understand the -U option. +ifdef NS_USE_GCC + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $< +else + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $< +endif # GCC + @echo $(RES) finished +endif + +$(MAPFILE): $(LIBRARY_NAME).def + @$(MAKE_OBJDIR) +ifeq ($(OS_ARCH),SunOS) + grep -v ';-' $< | \ + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ +endif +ifeq ($(OS_ARCH),OS2) + echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@ + echo PROTMODE >> $@ + echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@ + echo EXPORTS >> $@ +ifeq ($(MOZ_OS2_TOOLS),VACPP) + grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@ +else + grep -v ';+' $< | grep -v ';-' | \ + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \ + awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@ + $(ADD_TO_DEF_FILE) +endif +endif + +# +# Translate source filenames to absolute paths. This is required for +# debuggers under Windows and OS/2 to find source files automatically. +# + +ifeq ($(OS_ARCH),OS2) +NEED_ABSOLUTE_PATH = 1 +endif + +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) +NEED_ABSOLUTE_PATH = 1 +endif + +ifdef NEED_ABSOLUTE_PATH +PWD := $(shell pwd) +abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1))) +endif + +$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp + @$(MAKE_OBJDIR) +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) + $(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<) +else +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<) +else + $(CCC) -o $@ -c $(CCCFLAGS) $< +endif +endif +endif + +WCCFLAGS1 = $(subst /,\\,$(CFLAGS)) +WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1)) +WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2)) +$(OBJDIR)/%.$(OBJ_SUFFIX): %.c + @$(MAKE_OBJDIR) +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) + $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<) +else +ifeq ($(MOZ_OS2_TOOLS),VACPP) + $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<) +else +ifdef NEED_ABSOLUTE_PATH + $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<) +else + $(CC) -o $@ -c $(CFLAGS) $< +endif +endif +endif + + +$(OBJDIR)/%.$(OBJ_SUFFIX): %.s + @$(MAKE_OBJDIR) + $(AS) -o $@ $(ASFLAGS) -c $< + +ifeq ($(MOZ_OS2_TOOLS),VACPP) +$(OBJDIR)/%.$(OBJ_SUFFIX): %.asm + @$(MAKE_OBJDIR) + $(AS) -Fdo:./$(OBJDIR) $(ASFLAGS) $< +endif + +%.i: %.c + $(CC) -C -E $(CFLAGS) $< > $*.i + +%: %.pl + rm -f $@; cp $< $@; chmod +x $@ + +# +# HACK ALERT +# +# The only purpose of this rule is to pass Mozilla's Tinderbox depend +# builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's +# Tinderbox builds NSPR continuously as part of the Mozilla client. +# Because NSPR's make depend is not implemented, whenever we change +# an NSPR header file, the depend build does not recompile the NSPR +# files that depend on the header. +# +# This rule makes all the objects depend on a dummy header file. +# Touch this dummy header file to force the depend build to recompile +# everything. +# +# This rule should be removed when make depend is implemented. +# + +DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h + +$(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H) + +# END OF HACK + +################################################################################ +# Special gmake rules. +################################################################################ + +# +# Re-define the list of default suffixes, so gmake won't have to churn through +# hundreds of built-in suffix rules for stuff we don't need. +# +.SUFFIXES: +.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl + +# +# Fake targets. Always run these rules, even if a file/directory with that +# name already exists. +# +.PHONY: all alltags clean export install libs realclean release + +# +# List the target pattern of an implicit rule as a dependency of the +# special target .PRECIOUS to preserve intermediate files made by +# implicit rules whose target patterns match that file's name. +# (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4, +# p. 107.) +# +.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX) -- cgit v1.2.3