diff --git a/mozilla/client.mk b/mozilla/client.mk deleted file mode 100644 index adef03c5088..00000000000 --- a/mozilla/client.mk +++ /dev/null @@ -1,486 +0,0 @@ -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): Stephen Lamm - -# Build the Mozilla client. -# -# This needs CVSROOT set to work, e.g., -# setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot -# or -# setenv CVSROOT :pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot -# -# To checkout and build a tree, -# 1. cvs co mozilla/client.mk -# 2. cd mozilla -# 3. gmake -f client.mk -# -# Other targets (gmake -f client.mk [targets...]), -# checkout -# build -# clean (realclean is now the same as clean) -# distclean -# -# See http://www.mozilla.org/build/unix.html for more information. -# -# Options: -# MOZ_OBJDIR - Destination object directory -# MOZ_CO_DATE - Date tag to use for checkout (default: none) -# MOZ_CO_MODULE - Module to checkout (default: SeaMonkeyAll) -# MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3) -# MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P) -# MOZ_MAKE_FLAGS - Flags to pass to $(MAKE) -# MOZ_CO_BRANCH - Branch tag (Depricated. Use MOZ_CO_TAG below.) -# - -####################################################################### -# Checkout Tags -# -# For branches, uncomment the MOZ_CO_TAG line with the proper tag, -# and commit this file on that tag. -#MOZ_CO_TAG = -NSPR_CO_TAG = NSPRPUB_CLIENT_BRANCH -PSM_CO_TAG = #We will now build PSM from the tip instead of a branch. -NSS_CO_TAG = NSS_CLIENT_TAG -LDAPCSDK_CO_TAG = LDAPCSDK_40_BRANCH -GFX2_CO_TAG = -IMGLIB2_CO_TAG = -BUILD_MODULES = all - -####################################################################### -# Defines -# -CWD := $(shell pwd) - -ifeq "$(CWD)" "/" -CWD := /. -endif - -ifneq (, $(wildcard client.mk)) -# Ran from mozilla directory -ROOTDIR := $(shell dirname $(CWD)) -TOPSRCDIR := $(CWD) -else -# Ran from mozilla/.. directory (?) -ROOTDIR := $(CWD) -TOPSRCDIR := $(CWD)/mozilla -endif - -# on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't -# work; replace first instance with one forward slash -TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%') - -# if ROOTDIR equals only drive letter (i.e. "C:"), set to "/" -DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://') -ifeq ($(DIRNAME),) -ROOTDIR := /. -endif - -AUTOCONF := autoconf -MKDIR := mkdir -SH := /bin/sh -ifndef MAKE -MAKE := gmake -endif - -CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess) -ifdef CONFIG_GUESS_SCRIPT - CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT)) -else - _IS_FIRST_CHECKOUT := 1 -endif - -#################################### -# CVS - -# Add the CVS root to CVS_FLAGS if needed -CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null) -ifneq ($(CVS_ROOT_IN_TREE),) -ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT)) - CVS_FLAGS := -d $(CVS_ROOT_IN_TREE) -endif -endif - -CVSCO = $(strip cvs $(CVS_FLAGS) co $(CVS_CO_FLAGS)) -CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log -CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%) - -ifdef MOZ_CO_TAG - CVS_CO_FLAGS := -r $(MOZ_CO_TAG) -endif - -#################################### -# Load mozconfig Options - -# See build pages, http://www.mozilla.org/build/unix.html, -# for how to set up mozconfig. -MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk -MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find -MOZCONFIG_MODULES := mozilla/build/unix/modules.mk -run_for_side_effects := \ - $(shell cd $(ROOTDIR); \ - if test "$(_IS_FIRST_CHECKOUT)"; then \ - $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \ - else true; \ - fi; \ - $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out) -include $(TOPSRCDIR)/.mozconfig.mk -include $(TOPSRCDIR)/build/unix/modules.mk - -#################################### -# Options that may come from mozconfig - -# Change CVS flags if anonymous root is requested -ifdef MOZ_CO_USE_MIRROR - CVS_FLAGS := -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot -endif - -# MOZ_CVS_FLAGS - Basic CVS flags -ifeq "$(origin MOZ_CVS_FLAGS)" "undefined" - CVS_FLAGS := $(CVS_FLAGS) -q -z 3 -else - CVS_FLAGS := $(MOZ_CVS_FLAGS) -endif - -# This option is depricated. The best way to have client.mk pull a tag -# is to set MOZ_CO_TAG (see above) and commit that change on the tag. -ifdef MOZ_CO_BRANCH - CVS_CO_FLAGS := -r $(MOZ_CO_BRANCH) -endif - -# MOZ_CO_FLAGS - Anything that we should use on all checkouts -ifeq "$(origin MOZ_CO_FLAGS)" "undefined" - CVS_CO_FLAGS := $(CVS_CO_FLAGS) -P -else - CVS_CO_FLAGS := $(CVS_CO_FLAGS) $(MOZ_CO_FLAGS) -endif - -ifdef MOZ_CO_DATE - CVS_CO_DATE_FLAGS := -D "$(MOZ_CO_DATE)" -endif - -ifeq "$(origin MOZ_MAKE_FLAGS)" "undefined" - MOZ_MAKE_ENV := -else - MOZ_MAKE_ENV := MAKE="$(MAKE) $(MOZ_MAKE_FLAGS)" -endif - -ifdef MOZ_OBJDIR - OBJDIR := $(MOZ_OBJDIR) - MOZ_MAKE := $(MOZ_MAKE_ENV) $(MAKE) -C $(OBJDIR) -else - OBJDIR := $(TOPSRCDIR) - MOZ_MAKE := $(MOZ_MAKE_ENV) $(MAKE) -endif - -#################################### -# CVS defines for PSM -# -PSM_CO_MODULE= mozilla/security/psm mozilla/security/manager mozilla/security/Makefile.in -PSM_CO_FLAGS := -P -A -ifdef PSM_CO_TAG - PSM_CO_FLAGS := $(PSM_CO_FLAGS) -r $(PSM_CO_TAG) -endif -CVSCO_PSM = cvs $(CVS_FLAGS) co $(PSM_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(PSM_CO_MODULE) - -#################################### -# CVS defines for NSS -# -NSS_CO_MODULE= mozilla/security/nss mozilla/security/coreconf -NSS_CO_FLAGS := -P -ifdef NSS_CO_TAG - NSS_CO_FLAGS := $(NSS_CO_FLAGS) -r $(NSS_CO_TAG) -endif -CVSCO_NSS = cvs $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE) - -#################################### -# CVS defines for NSPR -# -NSPR_CO_MODULE = mozilla/nsprpub -NSPR_CO_FLAGS := -P -ifdef NSPR_CO_TAG - NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) -r $(NSPR_CO_TAG) -endif -CVSCO_NSPR = cvs $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE) - -#################################### -# CVS defines for the C LDAP SDK -# -LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk -LDAPCSDK_CO_FLAGS := -P -ifdef LDAPCSDK_CO_TAG - LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) -r $(LDAPCSDK_CO_TAG) -endif -CVSCO_LDAPCSDK = cvs $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE) - -#################################### -# CVS defines for gfx2 -# -GFX2_CO_MODULE = mozilla/gfx2 -GFX2_CO_FLAGS := -P -ifdef GFX2_CO_TAG - GFX2_CO_FLAGS := $(GFX2_CO_FLAGS) -r $(GFX2_CO_TAG) -endif -CVSCO_GFX2 = cvs $(CVS_FLAGS) co $(GFX2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(GFX2_CO_MODULE) - -#################################### -# CVS defines for new image library -# -IMGLIB2_CO_MODULE = mozilla/modules/libpr0n -IMGLIB2_CO_FLAGS := -P -ifdef IMGLIB2_CO_TAG - IMGLIB2_CO_FLAGS := $(IMGLIB2_CO_FLAGS) -r $(IMGLIB2_CO_TAG) -endif -CVSCO_IMGLIB2 = cvs $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IMGLIB2_CO_MODULE) - -#################################### -# CVS defines for standalone modules -# -ifneq ($(BUILD_MODULES),all) - MOZ_CO_MODULE := $(filter-out $(NSPRPUB_DIR) security directory/c-sdk, $(BUILD_MODULE_CVS)) - MOZ_CO_MODULE += allmakefiles.sh client.mk aclocal.m4 configure configure.in - MOZ_CO_MODULE += Makefile.in - MOZ_CO_MODULE := $(addprefix mozilla/, $(MOZ_CO_MODULE)) - - NOSUBDIRS_MODULE := $(addprefix mozilla/, $(BUILD_MODULE_CVS_NS)) -ifneq ($(NOSUBDIRS_MODULE),) - CVSCO_NOSUBDIRS := $(CVSCO) -l $(CVS_CO_DATE_FLAGS) $(NOSUBDIRS_MODULE) -endif - -ifeq (,$(filter $(NSPRPUB_DIR), $(BUILD_MODULE_CVS))) - CVSCO_NSPR := -endif -ifeq (,$(filter security security/manager, $(BUILD_MODULE_CVS))) - CVSCO_PSM := - CVSCO_NSS := -endif -ifeq (,$(filter directory/c-sdk, $(BUILD_MODULE_CVS))) - CVSCO_LDAPCSDK := -endif -ifeq (,$(filter gfx2, $(BUILD_MODULE_CVS))) - CVSCO_GFX2 := -endif -ifeq (,$(filter modules/libpr0n, $(BUILD_MODULE_CVS))) - CVSCO_IMGLIB2 := -endif -else - # Do not pull PSM/NSS by default - CVSCO_PSM := - CVSCO_NSS := -endif - -#################################### -# CVS defines for SeaMonkey -# -ifeq ($(MOZ_CO_MODULE),) - MOZ_CO_MODULE := SeaMonkeyAll -endif -CVSCO_SEAMONKEY := $(CVSCO) $(CVS_CO_DATE_FLAGS) $(MOZ_CO_MODULE) - -####################################################################### -# Rules -# - -# Print out any options loaded from mozconfig. -all build checkout clean depend distclean export install realclean:: - @if test -f .mozconfig.out; then \ - cat .mozconfig.out; \ - rm -f .mozconfig.out; \ - else true; \ - fi - -ifdef _IS_FIRST_CHECKOUT -all:: checkout build -else -all:: checkout depend build -endif - -# Windows equivalents -pull_all: checkout -build_all: build -clobber clobber_all: clean -pull_and_build_all: checkout depend build - -# Do everything from scratch -everything: checkout clean build - -#################################### -# CVS checkout -# -checkout:: -# @: Backup the last checkout log. - @if test -f $(CVSCO_LOGFILE) ; then \ - mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \ - else true; \ - fi - @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE) - @echo '$(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk'; \ - cd $(ROOTDIR); \ - $(CVSCO) mozilla/client.mk mozilla/build/unix/modules.mk && \ - $(MAKE) -f mozilla/client.mk real_checkout - -real_checkout: -# @: Start the checkout. Split the output to the tty and a log file. \ -# : If it fails, touch an error file because "tee" hides the error. - @failed=.cvs-failed.tmp; rm -f $$failed*; \ - cvs_co() { echo "$$@" ; \ - ("$$@" || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \ - if test -f $$failed; then false; else true; fi; }; \ - cvs_co $(CVSCO_NSPR) && \ - cvs_co $(CVSCO_PSM) && \ - cvs_co $(CVSCO_NSS) && \ - cvs_co $(CVSCO_LDAPCSDK) && \ - cvs_co $(CVSCO_GFX2) && \ - cvs_co $(CVSCO_IMGLIB2) && \ - cvs_co $(CVSCO_SEAMONKEY) && \ - cvs_co $(CVSCO_NOSUBDIRS) - @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE) -# @: Check the log for conflicts. ; - @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\ - if test "$$conflicts" ; then \ - echo "$(MAKE): *** Conflicts during checkout." ;\ - echo "$$conflicts" ;\ - echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\ - false; \ - else true; \ - fi - - -#################################### -# Web configure - -WEBCONFIG_FILE := $(HOME)/.mozconfig - -MOZCONFIG2CONFIGURATOR := build/autoconf/mozconfig2configurator -webconfig: - @cd $(TOPSRCDIR); \ - url=`$(MOZCONFIG2CONFIGURATOR) $(TOPSRCDIR)`; \ - echo Running netscape with the following url: ;\ - echo ;\ - echo $$url ;\ - netscape -remote "openURL($$url)" || netscape $$url ;\ - echo ;\ - echo 1. Fill out the form on the browser. ;\ - echo 2. Save the results to $(WEBCONFIG_FILE) - -##################################################### -# First Checkout - -ifdef _IS_FIRST_CHECKOUT -# First time, do build target in a new process to pick up new files. -build:: - $(MAKE) -f $(TOPSRCDIR)/client.mk -else - -##################################################### -# After First Checkout - - -#################################### -# Configure - -CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status) -CONFIG_CACHE := $(wildcard $(OBJDIR)/config.cache) - -ifdef RUN_AUTOCONF_LOCALLY -EXTRA_CONFIG_DEPS := \ - $(TOPSRCDIR)/aclocal.m4 \ - $(TOPSRCDIR)/build/autoconf/gtk.m4 \ - $(TOPSRCDIR)/build/autoconf/altoptions.m4 \ - $(NULL) - -$(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS) - @echo Generating $@ using autoconf - cd $(TOPSRCDIR); $(AUTOCONF) -endif - -CONFIG_STATUS_DEPS_L10N := $(wildcard $(TOPSRCDIR)/l10n/makefiles.all) - -CONFIG_STATUS_DEPS := \ - $(TOPSRCDIR)/configure \ - $(TOPSRCDIR)/allmakefiles.sh \ - $(TOPSRCDIR)/.mozconfig.mk \ - $(wildcard $(TOPSRCDIR)/nsprpub/configure) \ - $(wildcard $(TOPSRCDIR)/directory/c-sdk/ldap/configure) \ - $(wildcard $(TOPSRCDIR)/mailnews/makefiles) \ - $(CONFIG_STATUS_DEPS_L10N) \ - $(wildcard $(TOPSRCDIR)/themes/makefiles) \ - $(NULL) - -# configure uses the program name to determine @srcdir@. Calling it without -# $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full -# path of $(TOPSRCDIR). -ifeq ($(TOPSRCDIR),$(OBJDIR)) - CONFIGURE := ./configure -else - CONFIGURE := $(TOPSRCDIR)/configure -endif - -$(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS) - @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi - @echo cd $(OBJDIR); - @echo $(CONFIGURE) - @cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) \ - || ( echo "*** Fix above errors and then restart with\ - \"$(MAKE) -f client.mk build\"" && exit 1 ) - @touch $(OBJDIR)/Makefile - -ifdef CONFIG_STATUS -$(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in - cd $(OBJDIR); \ - CONFIG_FILES=config/autoconf.mk ./config.status -endif - - -#################################### -# Depend - -depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status - $(MOZ_MAKE) $@; - -#################################### -# Build it - -build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status - $(MOZ_MAKE) export && $(MOZ_MAKE) install - -#################################### -# Other targets - -# Pass these target onto the real build system -install export clean realclean distclean:: $(OBJDIR)/Makefile $(OBJDIR)/config.status - $(MOZ_MAKE) $@ - -cleansrcdir: - @cd $(TOPSRCDIR); \ - if [ -f webshell/embed/gtk/Makefile ]; then \ - $(MAKE) -C webshell/embed/gtk distclean; \ - fi; \ - if [ -f Makefile ]; then \ - $(MAKE) distclean ; \ - else \ - echo "Removing object files from srcdir..."; \ - rm -fr `find . -type d \( -name .deps -print -o -name CVS \ - -o -exec test ! -d {}/CVS \; \) -prune \ - -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \ - build/autoconf/clean-config.sh; \ - fi; - -# (! IS_FIRST_CHECKOUT) -endif - -.PHONY: checkout real_checkout depend build export install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything diff --git a/mozilla/nsprpub/Makefile.in b/mozilla/nsprpub/Makefile.in index 33d70470c77..392374fa548 100644 --- a/mozilla/nsprpub/Makefile.in +++ b/mozilla/nsprpub/Makefile.in @@ -1,5 +1,4 @@ #! gmake - # # The contents of this file are subject to the Netscape Public License # Version 1.1 (the "NPL"); you may not use this file except in diff --git a/mozilla/nsprpub/config/Makefile.in b/mozilla/nsprpub/config/Makefile.in index 6cfe14dfb71..c2a4fa496ce 100644 --- a/mozilla/nsprpub/config/Makefile.in +++ b/mozilla/nsprpub/config/Makefile.in @@ -79,14 +79,14 @@ ifeq ($(OS_ARCH), HP-UX) endif ifeq ($(MOZ_OS2_TOOLS),EMX) -XCFLAGS = $(OS_EXE_CFLAGS) +XCFLAGS = $(OS_CFLAGS) ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF) XLDOPTS = -Zlinker /PM:VIO endif endif ifeq ($(MOZ_OS2_TOOLS),PGCC) -XCFLAGS = $(OS_EXE_CFLAGS) +XCFLAGS = $(OS_CFLAGS) XLDOPTS = -Zlinker /PM:VIO endif diff --git a/mozilla/nsprpub/config/NetBSD.mk b/mozilla/nsprpub/config/NetBSD.mk index cb2211ad8a1..2eca2afbfdd 100644 --- a/mozilla/nsprpub/config/NetBSD.mk +++ b/mozilla/nsprpub/config/NetBSD.mk @@ -52,16 +52,23 @@ ifeq ($(OBJECT_FMT),ELF) DLL_SUFFIX = so else DLL_SUFFIX = so.1.0 +# XXX work around a bug in the a.out ld(1). +OS_LIBS = endif DSO_CFLAGS = -fPIC -DPIC DSO_LDFLAGS = -DSO_LDOPTS = -x -shared - -ifdef LIBRUNPATH -DSO_LDOPTS += -R$(LIBRUNPATH) +DSO_LDOPTS = -shared +ifeq ($(OBJECT_FMT),ELF) +DSO_LDOPTS +=-Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) endif -MKSHLIB = $(LD) $(DSO_LDOPTS) +ifdef LIBRUNPATH +#DSO_LDOPTS += -R$(LIBRUNPATH) +DSO_LDOPTS += -Wl,-R$(LIBRUNPATH) +endif + +#MKSHLIB = $(LD) $(DSO_LDOPTS) +MKSHLIB = $(CC) $(DSO_LDOPTS) G++INCLUDES = -I/usr/include/g++ diff --git a/mozilla/nsprpub/config/autoconf.mk.in b/mozilla/nsprpub/config/autoconf.mk.in index 9e33b8a0e69..72e0ba143d1 100644 --- a/mozilla/nsprpub/config/autoconf.mk.in +++ b/mozilla/nsprpub/config/autoconf.mk.in @@ -48,8 +48,9 @@ NSINSTALL = @NSINSTALL@ FILTER = @FILTER@ IMPLIB = @IMPLIB@ -OS_CFLAGS = @CFLAGS@ $(DSO_CFLAGS) -OS_CXXFLAGS = @CXXFLAGS@ $(DSO_CFLAGS) +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@ diff --git a/mozilla/nsprpub/configure b/mozilla/nsprpub/configure index 9adab341e5d..94f3d455cba 100755 --- a/mozilla/nsprpub/configure +++ b/mozilla/nsprpub/configure @@ -3106,6 +3106,7 @@ EOF PR_MD_ASFILES=os_Irix.s MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@' #DSO_LDOPTS='-elf -shared -all' + STRIP="$STRIP -f" if test -n "$USE_64"; then MDCPUCFG_H=_irix64.cfg else @@ -3238,6 +3239,7 @@ EOF MKSHLIB='$(LD) $(DSO_LDOPTS) -soname $(notdir $@) -o $@' DSO_CFLAGS=-fPIC DSO_LDOPTS=-shared + OS_LIBS="$OS_LIBS -lc" case "${target_cpu}" in alpha) cat >> confdefs.h <<\EOF @@ -3635,6 +3637,8 @@ EOF CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" DLL_SUFFIX=so.1.0 DSO_CFLAGS=-fPIC + MDCPUCFG_H=_openbsd.cfg + PR_MD_CSRCS=openbsd.c case "$OS_TEST" in alpha|mips|pmax) DSO_LDOPTS=-shared ;; @@ -4077,14 +4081,17 @@ EOF LD='$(CC)' IMPLIB='emximp -o' FILTER='emxexp' + OS_DLLFLAGS='$(DSO_LDOPTS) -o $@' _OPTIMIZE_FLAGS=-O3 _DEBUG_FLAGS=-g if test -n "$MOZ_DEBUG"; then DLLFLAGS='-g' EXEFLAGS='-g $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@' + DSO_LDOPTS='-g -Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO' else DLLFLAGS= EXEFLAGS='-Zmtd -o $@' + DSO_LDOPTS='-Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO' fi ;; *-os2_vacpp) @@ -4147,12 +4154,12 @@ fi if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4151: checking for dlopen" >&5 +echo "configure:4158: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4194,7 +4201,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4198: checking for dlopen in -ldl" >&5 +echo "configure:4205: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4202,7 +4209,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4240,7 +4247,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:4244: checking how to run the C preprocessor" >&5 +echo "configure:4251: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -4255,13 +4262,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -4272,13 +4279,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -4289,13 +4296,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -4321,13 +4328,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:4325: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4332: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -4345,7 +4352,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -4369,12 +4376,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4373: checking for $ac_func" >&5 +echo "configure:4380: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4428,7 +4435,7 @@ done echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4432: checking for pthread_create in -lpthreads" >&5 +echo "configure:4439: checking for pthread_create in -lpthreads" >&5 echo " #include void *foo(void *v) { int a = 1; } @@ -4450,7 +4457,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4454: checking for pthread_create in -lpthread" >&5 +echo "configure:4461: checking for pthread_create in -lpthread" >&5 echo " #include void *foo(void *v) { int a = 1; } @@ -4472,7 +4479,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:4476: checking for pthread_create in -lc_r" >&5 +echo "configure:4483: checking for pthread_create in -lc_r" >&5 echo " #include void *foo(void *v) { int a = 1; } @@ -4494,7 +4501,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:4498: checking for pthread_create in -lc" >&5 +echo "configure:4505: checking for pthread_create in -lc" >&5 echo " #include void *foo(void *v) { int a = 1; } @@ -4644,7 +4651,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:4648: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:4655: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -4660,7 +4667,7 @@ echo "configure:4648: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:4664: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:4671: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -4910,6 +4917,7 @@ fi + MAKEFILES=" diff --git a/mozilla/nsprpub/configure.in b/mozilla/nsprpub/configure.in index b4bb700780a..a1aafaf84d1 100644 --- a/mozilla/nsprpub/configure.in +++ b/mozilla/nsprpub/configure.in @@ -789,6 +789,7 @@ case "$target" in PR_MD_ASFILES=os_Irix.s MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@' #DSO_LDOPTS='-elf -shared -all' + STRIP="$STRIP -f" if test -n "$USE_64"; then MDCPUCFG_H=_irix64.cfg else @@ -885,6 +886,7 @@ case "$target" in MKSHLIB='$(LD) $(DSO_LDOPTS) -soname $(notdir $@) -o $@' DSO_CFLAGS=-fPIC DSO_LDOPTS=-shared + OS_LIBS="$OS_LIBS -lc" case "${target_cpu}" in alpha) AC_DEFINE(_ALPHA_) @@ -1147,6 +1149,8 @@ mips-sony-newsos*) CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" DLL_SUFFIX=so.1.0 DSO_CFLAGS=-fPIC + MDCPUCFG_H=_openbsd.cfg + PR_MD_CSRCS=openbsd.c case "$OS_TEST" in alpha|mips|pmax) DSO_LDOPTS=-shared ;; @@ -1412,14 +1416,17 @@ mips-sony-newsos*) LD='$(CC)' IMPLIB='emximp -o' FILTER='emxexp' + OS_DLLFLAGS='$(DSO_LDOPTS) -o $@' _OPTIMIZE_FLAGS=-O3 _DEBUG_FLAGS=-g if test -n "$MOZ_DEBUG"; then DLLFLAGS='-g' EXEFLAGS='-g $(OMF_FLAG) -Zmtd -L$(DIST)/lib -o $@' + DSO_LDOPTS='-g -Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO' else DLLFLAGS= EXEFLAGS='-Zmtd -o $@' + DSO_LDOPTS='-Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO' fi ;; *-os2_vacpp) @@ -1828,6 +1835,7 @@ AC_SUBST(CC) AC_SUBST(CXX) AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) +AC_SUBST(CPPFLAGS) AC_SUBST(HOST_CC) AC_SUBST(HOST_CFLAGS) AC_SUBST(LDFLAGS) diff --git a/mozilla/nsprpub/gmakefile.win b/mozilla/nsprpub/gmakefile.win index d9fb574b6e0..8e1a3fc8ac1 100644 --- a/mozilla/nsprpub/gmakefile.win +++ b/mozilla/nsprpub/gmakefile.win @@ -54,15 +54,15 @@ all:: build_all # Furthermore, shmsdos doesn't support '&&' so there's a chance the # 'cd' could fail and configure would be run in the wrong dir # -$(MOZ_OBJDIR)/config.status: check_old configure configure.in +$(MOZ_OBJDIR)/config.status: configure configure.in @$(MAKE_OBJDIR) cd $(MOZ_OBJDIR)/ ; \ sh $(NSPR_CONFIGURE) -build_all: $(MOZ_OBJDIR)/config.status +build_all: $(MOZ_OBJDIR)/config.status check_old gmake -C $(MOZ_OBJDIR) -clobber_all: $(MOZ_OBJDIR)/config.status +clobber_all: $(MOZ_OBJDIR)/config.status check_old gmake -C $(MOZ_OBJDIR) clobber_all distclean: check_old diff --git a/mozilla/nsprpub/makefile.win b/mozilla/nsprpub/makefile.win deleted file mode 100644 index 5948366b6d5..00000000000 --- a/mozilla/nsprpub/makefile.win +++ /dev/null @@ -1,105 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.1 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -# -# An NMAKE file to set up and adjust NSPR20's build system for -# Client build. Client build should invoke NMAKE on this file -# instead of invoking gmake directly. -# - -DEPTH = .. -include <$(DEPTH)\config\config.mak> - -# -# Backslashes are escape characters to gmake, so flip all backslashes -# in $(MOZ_TOOLS) to forward slashes and pass that to gmake. -# - -GMAKE = $(MOZ_TOOLS)\bin\gmake.exe - -GMAKE_FLAGS = MOZ_TOOLS_FLIPPED=$(MOZ_TOOLS:\=/) PR_CLIENT_BUILD=1 PR_CLIENT_BUILD_WINDOWS=1 - -# -# The Client's debug build uses MSVC's debug runtime library (/MDd). -# - -!ifdef MOZ_DEBUG -!else -GMAKE_FLAGS = $(GMAKE_FLAGS) BUILD_OPT=1 -!endif - -!if "$(MOZ_BITS)" == "16" -GMAKE_FLAGS = $(GMAKE_FLAGS) OS_TARGET=WIN16 -!else - -GMAKE_FLAGS = $(GMAKE_FLAGS) OS_TARGET=WIN95 -!ifdef MOZ_DEBUG -!ifdef MOZ_NO_DEBUG_RTL -!IF "$(CPU)" == "ALPHA" -PR_OBJDIR = WIN954.0ALPHA_DBG.OBJ -!else -PR_OBJDIR = WIN954.0_DBG.OBJ -!endif -!else -GMAKE_FLAGS = $(GMAKE_FLAGS) USE_DEBUG_RTL=1 -!IF "$(CPU)" == "ALPHA" -PR_OBJDIR = WIN954.0ALPHA_DBG.OBJD -!else -PR_OBJDIR = WIN954.0_DBG.OBJD -!endif -!endif -!else -!IF "$(CPU)" == "ALPHA" -PR_OBJDIR = WIN954.0ALPHA_OPT.OBJ -!else -PR_OBJDIR = WIN954.0_OPT.OBJ -!endif -!endif - -!endif - - -# -# The rules. Simply invoke gmake with the same target. -# The default target is 'all'. For Win16, set up the -# environment to use the Watcom compiler, Watcom headers, -# and Watcom libs. -# - -all:: export libs install - -export libs install clobber clobber_all clean depend:: -!if "$(MOZ_BITS)" == "16" - set PATH=%WATCPATH% - set INCLUDE=%WATC_INC% - set LIB=%WATC_LIB% -!endif - $(GMAKE) $(GMAKE_FLAGS) $@ -!if "$(MOZ_BITS)" == "16" - set PATH=%MSVCPATH% - set INCLUDE=%MSVC_INC% - set LIB=%MSVC_LIB% -!endif - -!if "$(MOZ_BITS)" != "16" -export:: - $(MAKE_INSTALL) $(XPDIST)\$(PR_OBJDIR)\include\*.h $(DIST)\include - $(MAKE_INSTALL) $(XPDIST)\$(PR_OBJDIR)\include\obsolete\*.h $(DIST)\include\obsolete - $(MAKE_INSTALL) $(XPDIST)\$(PR_OBJDIR)\include\private\*.h $(DIST)\include\private - $(MAKE_INSTALL) $(XPDIST)\$(PR_OBJDIR)\lib\*.lib $(DIST)\lib - $(MAKE_INSTALL) $(XPDIST)\$(PR_OBJDIR)\lib\*.dll $(DIST)\bin -!endif diff --git a/mozilla/nsprpub/pr/include/md/_macos.h b/mozilla/nsprpub/pr/include/md/_macos.h index bcbca3c4360..43318527e0c 100644 --- a/mozilla/nsprpub/pr/include/md/_macos.h +++ b/mozilla/nsprpub/pr/include/md/_macos.h @@ -103,6 +103,7 @@ struct _MDFileDesc { _MDSocketCallerInfo misc; _MDSocketCallerInfo read; _MDSocketCallerInfo write; + _MDSocketCallerInfo poll; }; /* diff --git a/mozilla/nsprpub/pr/include/md/_os2.h b/mozilla/nsprpub/pr/include/md/_os2.h index 6d0170e07a9..bcee5cbcdbe 100644 --- a/mozilla/nsprpub/pr/include/md/_os2.h +++ b/mozilla/nsprpub/pr/include/md/_os2.h @@ -43,11 +43,6 @@ #define sock_errno() errno #define soclose close #define sock_init() - -#include -#include -static _smutex _md_shm_lock = 0; - #endif /* diff --git a/mozilla/nsprpub/pr/src/md/mac/macsockotpt.c b/mozilla/nsprpub/pr/src/md/mac/macsockotpt.c index 0819188455b..57902ac12b3 100644 --- a/mozilla/nsprpub/pr/src/md/mac/macsockotpt.c +++ b/mozilla/nsprpub/pr/src/md/mac/macsockotpt.c @@ -292,6 +292,7 @@ static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResul _MDFileDesc * md = &(secret->md); EndpointRef endpoint = (EndpointRef)secret->md.osfd; PRThread * thread = NULL; + PRThread * pollThread = md->poll.thread; OSStatus err; OTResult resultOT; TDiscon discon; @@ -452,7 +453,11 @@ static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResul return; } - WakeUpNotifiedThread(thread, result); + if (pollThread) + WakeUpNotifiedThread(pollThread, kOTNoError); + + if (thread && (thread != pollThread)) + WakeUpNotifiedThread(thread, result); } @@ -1658,8 +1663,13 @@ PRInt32 _MD_writev(PRFileDesc *fd, const struct PRIOVec *iov, PRInt32 iov_size, static PRBool GetState(PRFileDesc *fd, PRBool *readReady, PRBool *writeReady, PRBool *exceptReady) { OTResult resultOT; - - *readReady = fd->secret->md.readReady; + // hack to emulate BSD sockets; say that a socket that has disconnected + // is still readable. + size_t availableData = 1; + if (!fd->secret->md.orderlyDisconnect) + OTCountDataBytes((EndpointRef)fd->secret->md.osfd, &availableData); + + *readReady = fd->secret->md.readReady && (availableData > 0); *exceptReady = fd->secret->md.exceptReady; resultOT = OTGetEndpointState((EndpointRef)fd->secret->md.osfd); @@ -1680,14 +1690,11 @@ PRInt32 _MD_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) { PRInt32 ready = 0; PRPollDesc *pd, *epd; - PRIntervalTime sleepTime, timein; + PRThread *thread = _PR_MD_CURRENT_THREAD(); + PRIntervalTime timein; - sleepTime = PR_MillisecondsToInterval(5UL); if (PR_INTERVAL_NO_TIMEOUT != timeout) - { - if (sleepTime > timeout) sleepTime = timeout; timein = PR_IntervalNow(); - } do { @@ -1724,6 +1731,8 @@ PRInt32 _MD_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) PR_ASSERT(NULL != bottomFD); if ((NULL != bottomFD) && (_PR_FILEDESC_OPEN == bottomFD->secret->state)) { + bottomFD->secret->md.poll.thread = thread; + if (GetState(bottomFD, &readReady, &writeReady, &exceptReady)) { if (readReady) @@ -1757,7 +1766,10 @@ PRInt32 _MD_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout) if (ready > 0) return ready; - (void) PR_Sleep(sleepTime); + thread->io_pending = PR_TRUE; + thread->io_fd = NULL; + thread->md.osErrCode = noErr; + WaitOnThisThread(thread, timeout); } while ((timeout == PR_INTERVAL_NO_TIMEOUT) || (((PRIntervalTime)(PR_IntervalNow() - timein)) < timeout)); diff --git a/mozilla/nsprpub/pr/src/md/os2/os2cv.c b/mozilla/nsprpub/pr/src/md/os2/os2cv.c index 1205f3afac7..f91ae80dc54 100644 --- a/mozilla/nsprpub/pr/src/md/os2/os2cv.c +++ b/mozilla/nsprpub/pr/src/md/os2/os2cv.c @@ -219,7 +219,7 @@ static void md_PostNotifyToCvar(_MDCVar *cvar, _MDLock *lock, * 0 when it succeeds. * */ -PR_IMPLEMENT(PRInt32) +PRInt32 _PR_MD_NEW_CV(_MDCVar *cv) { cv->magic = _MD_MAGIC_CV; @@ -230,7 +230,7 @@ _PR_MD_NEW_CV(_MDCVar *cv) return 0; } -PR_IMPLEMENT(void) _PR_MD_FREE_CV(_MDCVar *cv) +void _PR_MD_FREE_CV(_MDCVar *cv) { cv->magic = (PRUint32)-1; return; @@ -239,7 +239,7 @@ PR_IMPLEMENT(void) _PR_MD_FREE_CV(_MDCVar *cv) /* * _PR_MD_WAIT_CV() -- Wait on condition variable */ -PR_IMPLEMENT(void) +void _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout ) { PRThread *thred = _PR_MD_CURRENT_THREAD(); @@ -306,21 +306,21 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout ) return; } /* --- end _PR_MD_WAIT_CV() --- */ -PR_IMPLEMENT(void) +void _PR_MD_NOTIFY_CV(_MDCVar *cv, _MDLock *lock) { md_PostNotifyToCvar(cv, lock, PR_FALSE); return; } -PR_IMPLEMENT(void) +void _PR_MD_NOTIFYALL_CV(_MDCVar *cv, _MDLock *lock) { md_PostNotifyToCvar(cv, lock, PR_TRUE); return; } -PR_IMPLEMENT(void) +void _PR_MD_UNLOCK(_MDLock *lock) { if (0 != lock->notified.length) { diff --git a/mozilla/nsprpub/pr/src/md/os2/os2inrval.c b/mozilla/nsprpub/pr/src/md/os2/os2inrval.c index ecba3068c7c..ea2dd38a887 100644 --- a/mozilla/nsprpub/pr/src/md/os2/os2inrval.c +++ b/mozilla/nsprpub/pr/src/md/os2/os2inrval.c @@ -29,7 +29,7 @@ PRInt32 _os2_highMask = 0; -PR_IMPLEMENT(void) +void _PR_MD_INTERVAL_INIT() { if (DosTmrQueryFreq(&_os2_ticksPerSec) == NO_ERROR) @@ -46,7 +46,7 @@ _PR_MD_INTERVAL_INIT() PR_ASSERT(_os2_ticksPerSec > PR_INTERVAL_MIN && _os2_ticksPerSec < PR_INTERVAL_MAX); } -PR_IMPLEMENT(PRIntervalTime) +PRIntervalTime _PR_MD_GET_INTERVAL() { QWORD count; @@ -69,7 +69,7 @@ _PR_MD_GET_INTERVAL() } } -PR_IMPLEMENT(PRIntervalTime) +PRIntervalTime _PR_MD_INTERVAL_PER_SEC() { if(_os2_ticksPerSec != -1) diff --git a/mozilla/nsprpub/pr/src/md/os2/os2misc.c b/mozilla/nsprpub/pr/src/md/os2/os2misc.c index 27277e686b2..28c9a6410bc 100644 --- a/mozilla/nsprpub/pr/src/md/os2/os2misc.c +++ b/mozilla/nsprpub/pr/src/md/os2/os2misc.c @@ -473,7 +473,7 @@ PRStatus _MD_OS2GetHostName(char *name, PRUint32 namelen) return PR_FAILURE; } -PR_IMPLEMENT(void) +void _PR_MD_WAKEUP_CPUS( void ) { return; diff --git a/mozilla/nsprpub/pr/src/md/os2/os2sem.c b/mozilla/nsprpub/pr/src/md/os2/os2sem.c index 86a41f5836a..57131beb431 100644 --- a/mozilla/nsprpub/pr/src/md/os2/os2sem.c +++ b/mozilla/nsprpub/pr/src/md/os2/os2sem.c @@ -24,7 +24,7 @@ #include "primpl.h" -PR_IMPLEMENT(void) +void _PR_MD_NEW_SEM(_MDSemaphore *md, PRUintn value) { int rv; @@ -36,7 +36,7 @@ _PR_MD_NEW_SEM(_MDSemaphore *md, PRUintn value) PR_ASSERT(rv == NO_ERROR); } -PR_IMPLEMENT(void) +void _PR_MD_DESTROY_SEM(_MDSemaphore *md) { int rv; @@ -45,7 +45,7 @@ _PR_MD_DESTROY_SEM(_MDSemaphore *md) } -PR_IMPLEMENT(PRStatus) +PRStatus _PR_MD_TIMED_WAIT_SEM(_MDSemaphore *md, PRIntervalTime ticks) { int rv; @@ -57,13 +57,13 @@ _PR_MD_TIMED_WAIT_SEM(_MDSemaphore *md, PRIntervalTime ticks) return PR_FAILURE; } -PR_IMPLEMENT(PRStatus) +PRStatus _PR_MD_WAIT_SEM(_MDSemaphore *md) { return _PR_MD_TIMED_WAIT_SEM(md, PR_INTERVAL_NO_TIMEOUT); } -PR_IMPLEMENT(void) +void _PR_MD_POST_SEM(_MDSemaphore *md) { int rv; diff --git a/mozilla/nsprpub/pr/src/md/os2/os2thred.c b/mozilla/nsprpub/pr/src/md/os2/os2thred.c index b6c1615bf21..cbb8603c75d 100644 --- a/mozilla/nsprpub/pr/src/md/os2/os2thred.c +++ b/mozilla/nsprpub/pr/src/md/os2/os2thred.c @@ -36,7 +36,7 @@ _NSPR_TLS* pThreadLocalStorage = 0; _PRInterruptTable _pr_interruptTable[] = { { 0 } }; APIRET (* APIENTRY QueryThreadContext)(TID, ULONG, PCONTEXTRECORD); -PR_IMPLEMENT(void) +void _PR_MD_ENSURE_TLS(void) { if(!pThreadLocalStorage) @@ -50,7 +50,7 @@ _PR_MD_ENSURE_TLS(void) } } -PR_IMPLEMENT(void) +void _PR_MD_EARLY_INIT() { HMODULE hmod; @@ -77,7 +77,7 @@ _pr_SetThreadMDHandle(PRThread *thread) } -PR_IMPLEMENT(PRStatus) +PRStatus _PR_MD_INIT_THREAD(PRThread *thread) { #ifdef XP_OS2_EMX @@ -98,7 +98,7 @@ _PR_MD_INIT_THREAD(PRThread *thread) return (thread->md.blocked_sema.sem != 0) ? PR_SUCCESS : PR_FAILURE; } -PR_IMPLEMENT(PRStatus) +PRStatus _PR_MD_CREATE_THREAD(PRThread *thread, void (*start)(void *), PRThreadPriority priority, @@ -119,14 +119,14 @@ _PR_MD_CREATE_THREAD(PRThread *thread, return PR_SUCCESS; } -PR_IMPLEMENT(void) +void _PR_MD_YIELD(void) { /* Isn't there some problem with DosSleep(0) on OS/2? */ DosSleep(0); } -PR_IMPLEMENT(void) +void _PR_MD_SET_PRIORITY(_MDThread *thread, PRThreadPriority newPri) { int nativePri; @@ -159,7 +159,7 @@ _PR_MD_SET_PRIORITY(_MDThread *thread, PRThreadPriority newPri) return; } -PR_IMPLEMENT(void) +void _PR_MD_CLEAN_THREAD(PRThread *thread) { if (&thread->md.blocked_sema) { @@ -172,7 +172,7 @@ _PR_MD_CLEAN_THREAD(PRThread *thread) } } -PR_IMPLEMENT(void) +void _PR_MD_EXIT_THREAD(PRThread *thread) { _PR_MD_DESTROY_SEM(&thread->md.blocked_sema); @@ -200,7 +200,7 @@ _PR_MD_EXIT_THREAD(PRThread *thread) } -PR_IMPLEMENT(void) +void _PR_MD_EXIT(PRIntn status) { _exit(status); @@ -240,19 +240,19 @@ _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask) } #endif /* HAVE_THREAD_AFFINITY */ -PR_IMPLEMENT(void) +void _PR_MD_SUSPEND_CPU(_PRCPU *cpu) { _PR_MD_SUSPEND_THREAD(cpu->thread); } -PR_IMPLEMENT(void) +void _PR_MD_RESUME_CPU(_PRCPU *cpu) { _PR_MD_RESUME_THREAD(cpu->thread); } -PR_IMPLEMENT(void) +void _PR_MD_SUSPEND_THREAD(PRThread *thread) { if (_PR_IS_NATIVE_THREAD(thread)) { @@ -266,7 +266,7 @@ _PR_MD_SUSPEND_THREAD(PRThread *thread) } } -PR_IMPLEMENT(void) +void _PR_MD_RESUME_THREAD(PRThread *thread) { if (_PR_IS_NATIVE_THREAD(thread)) { diff --git a/mozilla/nsprpub/pr/src/memory/Makefile.in b/mozilla/nsprpub/pr/src/memory/Makefile.in index 04da1f136cd..61a5291eedb 100644 --- a/mozilla/nsprpub/pr/src/memory/Makefile.in +++ b/mozilla/nsprpub/pr/src/memory/Makefile.in @@ -43,7 +43,7 @@ endif TARGETS = $(OBJS) -INCLUDES = -I$(includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private +INCLUDES = -I$(includedir) -I$(includedir)/boehm -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private DEFINES += -D_NSPR_BUILD_ diff --git a/mozilla/nsprpub/pr/src/pthreads/ptthread.c b/mozilla/nsprpub/pr/src/pthreads/ptthread.c index 63a83dcd749..68c959b99f1 100644 --- a/mozilla/nsprpub/pr/src/pthreads/ptthread.c +++ b/mozilla/nsprpub/pr/src/pthreads/ptthread.c @@ -806,11 +806,27 @@ void _PR_InitThreads( #endif #if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) +#if defined(FREEBSD) + { + pthread_attr_t attr; + int policy; + /* get the min and max priorities of the default policy */ + pthread_attr_init(&attr); + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_getschedpolicy(&attr, &policy); + pt_book.minPrio = sched_get_priority_min(policy); + PR_ASSERT(-1 != pt_book.minPrio); + pt_book.maxPrio = sched_get_priority_max(policy); + PR_ASSERT(-1 != pt_book.maxPrio); + pthread_attr_destroy(&attr); + } +#else /* ** These might be function evaluations */ pt_book.minPrio = PT_PRIO_MIN; pt_book.maxPrio = PT_PRIO_MAX; +#endif #endif PR_ASSERT(NULL == pt_book.ml);