diff options
Diffstat (limited to 'tools/node_modules/expresso/deps/jscoverage/js/config')
35 files changed, 11821 insertions, 0 deletions
diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/Makefile.in b/tools/node_modules/expresso/deps/jscoverage/js/config/Makefile.in new file mode 100644 index 0000000..39f9912 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/Makefile.in @@ -0,0 +1,106 @@ +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Robert Ginda <rginda@netscape.com> +# John Taylor <jtaylor@netscape.com> +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +DEPTH = .. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +# For sanity's sake, we compile nsinstall without the wrapped system +# headers, so that we can use it to set up the wrapped system headers. +VISIBILITY_FLAGS = + +ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH))) +ifneq ($(OS_ARCH), WINCE) +HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX) +HOST_CSRCS = nsinstall.c pathsub.c +endif +endif + +PLSRCS = nfspwd.pl revdepth.pl + +TARGETS = $(HOST_PROGRAM) $(PLSRCS:.pl=) $(SIMPLE_PROGRAMS) + +# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have +# a recursive rule for finding nsinstall and the Perl scripts. +ifdef NSBUILDROOT +override NSBUILDROOT := +endif + +ifdef GNU_CC +MODULE_OPTIMIZE_FLAGS = -O3 +endif + +ifndef COMPILER_DEPEND +ifndef MOZ_NATIVE_MAKEDEPEND +DIRS += mkdepend +endif +endif + +include $(topsrcdir)/config/config.mk + +# Do not install util programs +NO_INSTALL=1 + +include $(topsrcdir)/config/rules.mk + +export:: $(TARGETS) +ifdef HOST_PROGRAM + $(INSTALL) $(HOST_PROGRAM) $(DIST)/bin +endif + +ifdef WRAP_SYSTEM_INCLUDES +export:: + if test ! -d system_wrappers; then mkdir system_wrappers; fi + $(PERL) $(srcdir)/preprocessor.pl $(DEFINES) $(ACDEFINES) \ + -DBUILD_STATIC_LIBS=$(BUILD_STATIC_LIBS) \ + $(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers + $(INSTALL) system_wrappers $(DIST)/include + +GARBAGE_DIRS += system_wrappers +endif + +FORCE: + +ifdef MKDEPEND_DIR +clean clobber realclean clobber_all:: + cd $(MKDEPEND_DIR); $(MAKE) $@ +endif diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/Moz/Milestone.pm b/tools/node_modules/expresso/deps/jscoverage/js/config/Moz/Milestone.pm new file mode 100644 index 0000000..8dd1449 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/Moz/Milestone.pm @@ -0,0 +1,232 @@ +#!/usr/bin/perl -w +# ***** 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 Win32 Version System. +# +# The Initial Developer of the Original Code is Netscape Communications Corporation +# Portions created by the Initial Developer are Copyright (C) 2002 +# 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 ***** + +package Moz::Milestone; +use strict; + +use vars qw($officialMilestone + $milestone); + +local $Moz::Milestone::milestone; +local $Moz::Milestone::officialMilestone; + +# +# Usage: getOfficialMilestone($milestoneFile) +# Returns full milestone (x.x.x.x[ab12pre+]) +# +sub getOfficialMilestone($) { + my $mfile = $_[0]; + open(FILE,"$mfile") || + die ("Can't open $mfile for reading!"); + + my $num = <FILE>; + while($num =~ /^\s*#/ || $num !~ /^\d/) { + $num = <FILE>; + } + + close(FILE); + if ($num !~ /^\d/) { return; } + chomp($num); + # Remove extra ^M caused by using dos-mode line-endings + chop $num if (substr($num, -1, 1) eq "\r"); + $Moz::Milestone::officialMilestone = $num; + $Moz::Milestone::milestone = &getMilestoneNum; + return $num; +} + +# +# Usage: getMilestoneNum($num) +# Returns: milestone without a + if it exists. +# +sub getMilestoneNum { + if (defined($Moz::Milestone::milestone)) { + return $Moz::Milestone::milestone; + } + + if (defined($Moz::Milestone::officialMilestone)) { + $Moz::Milestone::milestone = $Moz::Milestone::officialMilestone; + } else { + $Moz::Milestone::milestone = $_[0]; + } + + if ($Moz::Milestone::milestone =~ /\+$/) { # for x.x.x+, strip off the + + $Moz::Milestone::milestone =~ s/\+$//; + } + + return $Moz::Milestone::milestone; +} + +# +# Usage: getMilestoneQualifier($num) +# Returns: + if it exists. +# +sub getMilestoneQualifier { + my $milestoneQualifier; + if (defined($Moz::Milestone::officialMilestone)) { + $milestoneQualifier = $Moz::Milestone::officialMilestone; + } else { + $milestoneQualifier = $_[0]; + } + + if ($milestoneQualifier =~ /\+$/) { + return "+"; + } +} + +sub getMilestoneMajor { + my $milestoneMajor; + if (defined($Moz::Milestone::milestone)) { + $milestoneMajor = $Moz::Milestone::milestone; + } else { + $milestoneMajor = $_[0]; + } + my @parts = split(/\./,$milestoneMajor); + return $parts[0]; +} + +sub getMilestoneMinor { + my $milestoneMinor; + if (defined($Moz::Milestone::milestone)) { + $milestoneMinor = $Moz::Milestone::milestone; + } else { + $milestoneMinor = $_[0]; + } + my @parts = split(/\./,$milestoneMinor); + + if ($#parts < 1 ) { return 0; } + return $parts[1]; +} + +sub getMilestoneMini { + my $milestoneMini; + if (defined($Moz::Milestone::milestone)) { + $milestoneMini = $Moz::Milestone::milestone; + } else { + $milestoneMini = $_[0]; + } + my @parts = split(/\./,$milestoneMini); + + if ($#parts < 2 ) { return 0; } + return $parts[2]; +} + +sub getMilestoneMicro { + my $milestoneMicro; + if (defined($Moz::Milestone::milestone)) { + $milestoneMicro = $Moz::Milestone::milestone; + } else { + $milestoneMicro = $_[0]; + } + my @parts = split(/\./,$milestoneMicro); + + if ($#parts < 3 ) { return 0; } + return $parts[3]; +} + +sub getMilestoneAB { + my $milestoneAB; + if (defined($Moz::Milestone::milestone)) { + $milestoneAB = $Moz::Milestone::milestone; + } else { + $milestoneAB = $_[0]; + } + + if ($milestoneAB =~ /a/) { return "alpha"; } + if ($milestoneAB =~ /b/) { return "beta"; } + return "final"; +} + +# +# build_file($template_file,$output_file) +# +sub build_file($$) { + my @FILE; + my @MILESTONE_PARTS; + my $MINI_VERSION = 0; + my $MICRO_VERSION = 0; + my $OFFICIAL = 0; + my $QUALIFIER = ""; + + if (!defined($Moz::Milestone::milestone)) { die("$0: no milestone file set!\n"); } + @MILESTONE_PARTS = split(/\./, &getMilestoneNum); + if ($#MILESTONE_PARTS >= 2) { + $MINI_VERSION = 1; + } else { + $MILESTONE_PARTS[2] = 0; + } + if ($#MILESTONE_PARTS >= 3) { + $MICRO_VERSION = 1; + } else { + $MILESTONE_PARTS[3] = 0; + } + if (! &getMilestoneQualifier) { + $OFFICIAL = 1; + } else { + $QUALIFIER = "+"; + } + + if (-e $_[0]) { + open(FILE, "$_[0]") || die("$0: Can't open $_[0] for reading!\n"); + @FILE = <FILE>; + close(FILE); + + open(FILE, ">$_[1]") || die("$0: Can't open $_[1] for writing!\n"); + + # + # There will be more of these based on what we need for files. + # + foreach(@FILE) { + s/__MOZ_MAJOR_VERSION__/$MILESTONE_PARTS[0]/g; + s/__MOZ_MINOR_VERSION__/$MILESTONE_PARTS[1]/g; + s/__MOZ_MINI_VERSION__/$MILESTONE_PARTS[2]/g; + s/__MOZ_MICRO_VERSION__/$MILESTONE_PARTS[3]/g; + if ($MINI_VERSION) { + s/__MOZ_OPTIONAL_MINI_VERSION__/.$MILESTONE_PARTS[2]/g; + } + if ($MICRO_VERSION) { + s/__MOZ_OPTIONAL_MICRO_VERSION__/.$MILESTONE_PARTS[3]/g; + } + + print FILE $_; + } + close(FILE); + } else { + die("$0: $_[0] doesn't exist for autoversioning!\n"); + } + +} + +1; diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/autoconf.mk.in b/tools/node_modules/expresso/deps/jscoverage/js/config/autoconf.mk.in new file mode 100644 index 0000000..d82e614 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/autoconf.mk.in @@ -0,0 +1,349 @@ +# +# ***** 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 this file as it was released upon August 6, 1998. +# +# The Initial Developer of the Original Code is +# Christopher Seawood. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Benjamin Smedberg <benjamin@smedbergs.us> +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 netscape style .mk file for autoconf builds + +INCLUDED_AUTOCONF_MK = 1 +USE_AUTOCONF = 1 +MOZILLA_CLIENT = 1 +target = @target@ +ac_configure_args = @ac_configure_args@ +BUILD_MODULES = @BUILD_MODULES@ +MOZILLA_VERSION = @MOZILLA_VERSION@ + +MOZ_BUILD_APP = @MOZ_BUILD_APP@ +MOZ_APP_NAME = @MOZ_APP_NAME@ +MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@ +MOZ_APP_VERSION = @MOZ_APP_VERSION@ + +MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +includedir = @includedir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ + +installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) + +DIST = $(DEPTH)/dist + +MOZ_JS_LIBS = @MOZ_JS_LIBS@ + +MOZ_SYNC_BUILD_FILES = @MOZ_SYNC_BUILD_FILES@ + +MOZ_DEBUG = @MOZ_DEBUG@ +MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@ +MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@ +MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@ +MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@ +MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@ +MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@ +MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@ +MOZ_EXTENSIONS = @MOZ_EXTENSIONS@ +MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@ +MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@ +MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@ +MOZ_PERF_METRICS = @MOZ_PERF_METRICS@ +MOZ_LEAKY = @MOZ_LEAKY@ +MOZ_MEMORY = @MOZ_MEMORY@ +MOZ_JPROF = @MOZ_JPROF@ +MOZ_SHARK = @MOZ_SHARK@ +MOZ_CALLGRIND = @MOZ_CALLGRIND@ +MOZ_VTUNE = @MOZ_VTUNE@ +DEHYDRA_PATH = @DEHYDRA_PATH@ + +ENABLE_EAZEL_PROFILER=@ENABLE_EAZEL_PROFILER@ +EAZEL_PROFILER_CFLAGS=@EAZEL_PROFILER_CFLAGS@ +EAZEL_PROFILER_LIBS=@EAZEL_PROFILER_LIBS@ +GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@ +NS_TRACE_MALLOC = @NS_TRACE_MALLOC@ +INCREMENTAL_LINKER = @INCREMENTAL_LINKER@ +MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ +BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@ +ENABLE_TESTS = @ENABLE_TESTS@ +JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@ +JS_STATIC_BUILD = @JS_STATIC_BUILD@ + +TAR=@TAR@ + +# The MOZ_UI_LOCALE var is used to build a particular locale. Do *not* +# use the var to change any binary files. Do *not* use this var unless you +# write rules for the "clean-locale" and "locale" targets. +MOZ_UI_LOCALE = @MOZ_UI_LOCALE@ + +MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@ +MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@ + +MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@ + +XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@ +XPCOM_LIBS=@XPCOM_LIBS@ +MOZ_TIMELINE=@MOZ_TIMELINE@ + +ENABLE_STRIP = @ENABLE_STRIP@ +PKG_SKIP_STRIP = @PKG_SKIP_STRIP@ + +MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@ +MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@ + +MOZ_BUILD_ROOT = @MOZ_BUILD_ROOT@ + +MOZ_INSURE = @MOZ_INSURE@ +MOZ_INSURIFYING = @MOZ_INSURIFYING@ +MOZ_INSURE_DIRS = @MOZ_INSURE_DIRS@ +MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@ + +MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@ + +CROSS_COMPILE = @CROSS_COMPILE@ + +WCHAR_CFLAGS = @WCHAR_CFLAGS@ + +OS_CPPFLAGS = @CPPFLAGS@ +OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ +OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ +OS_LDFLAGS = @LDFLAGS@ + +OS_COMPILE_CFLAGS = $(OS_CPPFLAGS) @COMPILE_CFLAGS@ +OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS) @COMPILE_CXXFLAGS@ + +OS_INCLUDES = $(NSPR_CFLAGS) +OS_LIBS = @LIBS@ +ACDEFINES = @MOZ_DEFINES@ + +WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@ + +MOZ_OPTIMIZE = @MOZ_OPTIMIZE@ +MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@ +MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@ +MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@ + +MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@ + +MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE = @MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE@ +PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@ +PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@ +PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@ +PROFILE_USE_LDFLAGS = @PROFILE_USE_LDFLAGS@ + +WIN_TOP_SRC = @WIN_TOP_SRC@ +CYGWIN_WRAPPER = @CYGWIN_WRAPPER@ +AS_PERL = @AS_PERL@ +CYGDRIVE_MOUNT = @CYGDRIVE_MOUNT@ +AR = @AR@ +AR_FLAGS = @AR_FLAGS@ +AR_EXTRACT = @AR_EXTRACT@ +AR_LIST = @AR_LIST@ +AR_DELETE = @AR_DELETE@ +AS = @AS@ +ASFLAGS = @ASFLAGS@ +AS_DASH_C_FLAG = @AS_DASH_C_FLAG@ +LD = @LD@ +RC = @RC@ +RCFLAGS = @RCFLAGS@ +WINDRES = @WINDRES@ +USE_SHORT_LIBNAME = @USE_SHORT_LIBNAME@ +IMPLIB = @IMPLIB@ +FILTER = @FILTER@ +BIN_FLAGS = @BIN_FLAGS@ +MIDL = @MIDL@ +MIDL_FLAGS = @MIDL_FLAGS@ +_MSC_VER = @_MSC_VER@ + +DLL_PREFIX = @DLL_PREFIX@ +LIB_PREFIX = @LIB_PREFIX@ +OBJ_SUFFIX = @OBJ_SUFFIX@ +LIB_SUFFIX = @LIB_SUFFIX@ +DLL_SUFFIX = @DLL_SUFFIX@ +BIN_SUFFIX = @BIN_SUFFIX@ +ASM_SUFFIX = @ASM_SUFFIX@ +IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@ +USE_N32 = @USE_N32@ +HAVE_64BIT_OS = @HAVE_64BIT_OS@ + +# Temp hack. It is not my intention to leave this crap in here for ever. +# Im talking to fur right now to solve the problem without introducing +# NS_USE_NATIVE to the build system -ramiro. +NS_USE_NATIVE = @NS_USE_NATIVE@ + +CC = @CC@ +CXX = @CXX@ + +CC_VERSION = @CC_VERSION@ +CXX_VERSION = @CXX_VERSION@ + +GNU_AS = @GNU_AS@ +GNU_LD = @GNU_LD@ +GNU_CC = @GNU_CC@ +GNU_CXX = @GNU_CXX@ +HAVE_GCC3_ABI = @HAVE_GCC3_ABI@ +INTEL_CC = @INTEL_CC@ +INTEL_CXX = @INTEL_CXX@ + +HOST_CC = @HOST_CC@ +HOST_CXX = @HOST_CXX@ +HOST_CFLAGS = @HOST_CFLAGS@ +HOST_CXXFLAGS = @HOST_CXXFLAGS@ +HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@ +HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@ +HOST_AR = @HOST_AR@ +HOST_AR_FLAGS = @HOST_AR_FLAGS@ +HOST_LD = @HOST_LD@ +HOST_RANLIB = @HOST_RANLIB@ +HOST_BIN_SUFFIX = @HOST_BIN_SUFFIX@ + +HOST_OS_ARCH = @HOST_OS_ARCH@ +host_cpu = @host_cpu@ +host_vendor = @host_vendor@ +host_os = @host_os@ + +TARGET_NSPR_MDCPUCFG = @TARGET_NSPR_MDCPUCFG@ +TARGET_CPU = @TARGET_CPU@ +TARGET_VENDOR = @TARGET_VENDOR@ +TARGET_OS = @TARGET_OS@ +TARGET_MD_ARCH = @TARGET_MD_ARCH@ +TARGET_XPCOM_ABI = @TARGET_XPCOM_ABI@ + +AUTOCONF = @AUTOCONF@ +PERL = @PERL@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +WHOAMI = @WHOAMI@ +UNZIP = @UNZIP@ +ZIP = @ZIP@ +XARGS = @XARGS@ +STRIP = @STRIP@ +DOXYGEN = @DOXYGEN@ +MAKE = @MAKE@ +PBBUILD_BIN = @PBBUILD@ +SDP = @SDP@ +NSINSTALL_BIN = @NSINSTALL_BIN@ + +NSPR_CONFIG = @NSPR_CONFIG@ +NSPR_CFLAGS = @NSPR_CFLAGS@ +NSPR_LIBS = @NSPR_LIBS@ + +USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@ + +# MKSHLIB_FORCE_ALL is used to force the linker to include all object +# files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker +# to normal behavior. Makefile's that create shared libraries out of +# archives use these flags to force in all of the .o files in the +# archives into the shared library. +WRAP_MALLOC_LIB = @WRAP_MALLOC_LIB@ +WRAP_MALLOC_CFLAGS = @WRAP_MALLOC_CFLAGS@ +DSO_CFLAGS = @DSO_CFLAGS@ +DSO_PIC_CFLAGS = @DSO_PIC_CFLAGS@ +MKSHLIB = @MKSHLIB@ +MKCSHLIB = @MKCSHLIB@ +MKSHLIB_FORCE_ALL = @MKSHLIB_FORCE_ALL@ +MKSHLIB_UNFORCE_ALL = @MKSHLIB_UNFORCE_ALL@ +DSO_LDOPTS = @DSO_LDOPTS@ +DLL_SUFFIX = @DLL_SUFFIX@ + +NO_LD_ARCHIVE_FLAGS = @NO_LD_ARCHIVE_FLAGS@ + +MOZ_TOOLKIT_REGISTRY_CFLAGS = \ + $(TK_CFLAGS) + +MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@ + +# Used for LD_LIBRARY_PATH +LIBS_PATH = @LIBS_PATH@ + +MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@ +COMPILER_DEPEND = @COMPILER_DEPEND@ +MDDEPDIR := @MDDEPDIR@ + +MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@ + +# XXX - these need to be cleaned up and have real checks added -cls +CM_BLDTYPE=dbg +AWT_11=1 +MOZ_BITS=32 +OS_TARGET=@OS_TARGET@ +OS_ARCH=@OS_ARCH@ +OS_RELEASE=@OS_RELEASE@ +OS_TEST=@OS_TEST@ + +TARGET_DEVICE = @TARGET_DEVICE@ + +# For AIX build +AIX_OBJMODEL = @AIX_OBJMODEL@ + +# For OS/2 build +MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@ +MOZ_OS2_USE_DECLSPEC = @MOZ_OS2_USE_DECLSPEC@ +MOZ_OS2_HIGH_MEMORY = @MOZ_OS2_HIGH_MEMORY@ + +MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@ +BUILD_OFFICIAL = @BUILD_OFFICIAL@ +MOZ_MILESTONE_RELEASE = @MOZ_MILESTONE_RELEASE@ + +# Win32 options +MOZ_PROFILE = @MOZ_PROFILE@ +MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@ +MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@ +MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@ +MOZ_QUANTIFY = @MOZ_QUANTIFY@ +MSMANIFEST_TOOL = @MSMANIFEST_TOOL@ +WIN32_REDIST_DIR = @WIN32_REDIST_DIR@ +WIN32_CRT_SRC_DIR = @WIN32_CRT_SRC_DIR@ +WIN32_CUSTOM_CRT_DIR = @WIN32_CUSTOM_CRT_DIR@ + +# Codesighs tools option, enables win32 mapfiles. +MOZ_MAPINFO = @MOZ_MAPINFO@ + +WINCE = @WINCE@ + +MACOS_SDK_DIR = @MACOS_SDK_DIR@ +NEXT_ROOT = @NEXT_ROOT@ +GCC_VERSION = @GCC_VERSION@ +XCODEBUILD_VERSION= @XCODEBUILD_VERSION@ +HAS_XCODE_2_1 = @HAS_XCODE_2_1@ +UNIVERSAL_BINARY= @UNIVERSAL_BINARY@ +HAVE_DTRACE= @HAVE_DTRACE@ + +VISIBILITY_FLAGS = @VISIBILITY_FLAGS@ +WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@ + +HAVE_ARM_SIMD= @HAVE_ARM_SIMD@ diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-dirs.py b/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-dirs.py new file mode 100644 index 0000000..916696e --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-dirs.py @@ -0,0 +1,108 @@ +# check-sync-dirs.py --- check that one directory is an exact subset of another +# +# Usage: python check-sync-dirs.py COPY ORIGINAL +# +# Check that the files present in the directory tree COPY are exact +# copies of their counterparts in the directory tree ORIGINAL. COPY +# need not have all the files in ORIGINAL, but COPY may not have files +# absent from ORIGINAL. +# +# Each directory in COPY may have a file named +# 'check-sync-exceptions', which lists files in COPY that need not be +# the same as the corresponding file in ORIGINAL, or exist at all in +# ORIGINAL. (The 'check-sync-exceptions' file itself is always +# treated as exceptional.) Blank lines and '#' comments in the file +# are ignored. + +import sys +import os +from os.path import join +import filecmp +import textwrap +import fnmatch + +if len(sys.argv) != 3: + print >> sys.stderr, "Usage: %s COPY ORIGINAL" % sys.argv[0] + sys.exit(1) + +copy = sys.argv[1] +original = sys.argv[2] + +# Ignore detritus left lying around by editing tools. +ignored_patterns = ['*~', '.#*', '#*#', '*.orig', '*.rej'] + +# Return the contents of FILENAME, a 'check-sync-exceptions' file, as +# a dictionary whose keys are exactly the list of filenames, along +# with the basename of FILENAME itself. If FILENAME does not exist, +# return the empty dictionary. +def read_exceptions(filename): + if (os.path.exists(filename)): + f = file(filename) + exceptions={} + for line in f: + line = line.strip() + if line != '' and line[0] != '#': + exceptions[line] = None + exceptions[os.path.basename (filename)] = None + f.close() + return exceptions + else: + return {} + +# Return true if FILENAME matches any pattern in the list of filename +# patterns PATTERNS. +def fnmatch_any(filename, patterns): + for pattern in patterns: + if fnmatch.fnmatch(filename, pattern): + return True + return False + +# Check the contents of the directory tree COPY against ORIGINAL. For each +# file that differs, apply REPORT to COPY, ORIGINAL, and the file's +# relative path. COPY and ORIGINAL should be absolute. Ignore files +# that match patterns given in the list IGNORE. +def check(copy, original, ignore, report): + os.chdir(copy) + for (dirpath, dirnames, filenames) in os.walk('.'): + exceptions = read_exceptions(join(dirpath, 'check-sync-exceptions')) + for filename in filenames: + if filename in exceptions: + continue + if fnmatch_any(filename, ignore): + continue + relative_name = join(dirpath, filename) + original_name = join(original, relative_name) + if (os.path.exists(original_name) + and filecmp.cmp(relative_name, original_name)): + continue + report(copy, original, relative_name) + + +differences_found = False + +# Print an error message for DIFFERING, which was found to differ +# between COPY and ORIGINAL. Set the global variable differences_found. +def report(copy, original, differing): + global differences_found + if not differences_found: + print >> sys.stderr, "TEST-FAIL | build file copies are not in sync" + print >> sys.stderr, "file(s) found in: %s" % (copy) + print >> sys.stderr, ("differ from their originals in: %s" + % (original)) + print >> sys.stderr, "file differs: %s" % (differing) + differences_found = True + +check(os.path.abspath(copy), + os.path.abspath(original), + ignored_patterns, + report) + +if differences_found: + msg=('''In general, the files in '%s' should always be exact copies of +originals in '%s'. A change made to one should also be made to the +other. See 'check-sync-dirs.py' for more details.''' + % (copy, original)) + print >> sys.stderr, textwrap.fill(msg, 75) + sys.exit(1) + +sys.exit(0) diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-exceptions b/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-exceptions new file mode 100644 index 0000000..7c0bc47 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/check-sync-exceptions @@ -0,0 +1,6 @@ +Makefile.in +autoconf.mk.in +check-sync-dirs.py + +# This is a copy of nspr's config/make-system-wrappers.pl. +make-system-wrappers.pl diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/config.mk b/tools/node_modules/expresso/deps/jscoverage/js/config/config.mk new file mode 100644 index 0000000..d19ca4a --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/config.mk @@ -0,0 +1,884 @@ +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Benjamin Smedberg <benjamin@smedbergs.us> +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +# +# config.mk +# +# Determines the platform and builds the macros needed to load the +# appropriate platform-specific .mk file, then defines all (most?) +# of the generic macros. +# + +# Define an include-at-most-once flag +INCLUDED_CONFIG_MK = 1 + +EXIT_ON_ERROR = set -e; # Shell loops continue past errors without this. + +ifndef topsrcdir +topsrcdir = $(DEPTH) +endif + +ifndef INCLUDED_AUTOCONF_MK +include $(DEPTH)/config/autoconf.mk +endif +ifndef INCLUDED_INSURE_MK +ifdef MOZ_INSURIFYING +include $(topsrcdir)/config/insure.mk +endif +endif + +COMMA = , + +# Sanity check some variables +CHECK_VARS := \ + XPI_NAME \ + LIBRARY_NAME \ + MODULE \ + DEPTH \ + SHORT_LIBNAME \ + XPI_PKGNAME \ + INSTALL_EXTENSION_ID \ + $(NULL) + +# checks for internal spaces or trailing spaces in the variable +# named by $x +check-variable = $(if $(filter-out 0 1,$(words $($(x))z)),$(error Spaces are not allowed in $(x))) + +$(foreach x,$(CHECK_VARS),$(check-variable)) + +# FINAL_TARGET specifies the location into which we copy end-user-shipped +# build products (typelibs, components, chrome). +# +# It will usually be the well-loved $(DIST)/bin, today, but can also be an +# XPI-contents staging directory for ambitious and right-thinking extensions. +FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin) + +# MAKE_JARS_TARGET is a staging area for make-jars.pl. When packaging in +# the jar format, make-jars leaves behind a directory structure that's not +# needed in $(FINAL_TARGET). For both, flat, and symlink, the directory +# structure contains the chrome, so leave it in $(FINAL_TARGET). +ifeq (jar,$(MOZ_CHROME_FILE_FORMAT)) +MAKE_JARS_TARGET = $(if $(XPI_NAME),$(FINAL_TARGET).stage,$(DIST)/chrome-stage) +else +MAKE_JARS_TARGET = $(FINAL_TARGET) +endif + +# +# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship. +# Since the longest of these is 5 characters without the suffix, +# be sure to not set VERSION_NUMBER to anything longer than 3 +# characters for Win16's sake. +# +VERSION_NUMBER = 50 + +ifeq ($(HOST_OS_ARCH),WINNT) +win_srcdir := $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir)) +BUILD_TOOLS = $(WIN_TOP_SRC)/build/unix +else +win_srcdir := $(srcdir) +BUILD_TOOLS = $(topsrcdir)/build/unix +endif + +CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config +AUTOCONF_TOOLS = $(topsrcdir)/build/autoconf + +ifeq ($(OS_ARCH),QNX) +ifeq ($(OS_TARGET),NTO) +LD := qcc -Vgcc_ntox86 -nostdlib +else +LD := $(CC) +endif +endif +ifeq ($(OS_ARCH),BeOS) +BEOS_ADDON_WORKAROUND = 1 +endif + +# +# Strip off the excessively long version numbers on these platforms, +# but save the version to allow multiple versions of the same base +# platform to be built in the same tree. +# +ifneq (,$(filter FreeBSD HP-UX IRIX Linux NetBSD OpenBSD OSF1 SunOS,$(OS_ARCH))) +OS_RELEASE := $(basename $(OS_RELEASE)) + +# Allow the user to ignore the OS_VERSION, which is usually irrelevant. +ifdef WANT_MOZILLA_CONFIG_OS_VERSION +OS_VERS := $(suffix $(OS_RELEASE)) +OS_VERSION := $(shell echo $(OS_VERS) | sed 's/-.*//') +endif + +endif + +OS_CONFIG := $(OS_ARCH)$(OS_RELEASE) + +FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs +FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps +FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names + +MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX) +MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX) + +ifdef MOZ_MEMORY +ifneq ($(OS_ARCH),WINNT) +JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL) +endif +endif + +# determine debug-related options +_DEBUG_CFLAGS := +_DEBUG_LDFLAGS := + +ifndef MOZ_DEBUG + # global debugging is disabled + # check if it was explicitly enabled for this module + ifneq (, $(findstring $(MODULE), $(MOZ_DEBUG_MODULES))) + MOZ_DEBUG:=1 + endif +else + # global debugging is enabled + # check if it was explicitly disabled for this module + ifneq (, $(findstring ^$(MODULE), $(MOZ_DEBUG_MODULES))) + MOZ_DEBUG:= + endif +endif + +ifdef MOZ_DEBUG + _DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS) + XULPPFLAGS += $(MOZ_DEBUG_ENABLE_DEFS) +else + _DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS) + XULPPFLAGS += $(MOZ_DEBUG_DISABLE_DEFS) +endif + +# determine if -g should be passed to the compiler, based on +# the current module, and the value of MOZ_DBGRINFO_MODULES + +ifdef MOZ_DEBUG + MOZ_DBGRINFO_MODULES += ALL_MODULES + pattern := ALL_MODULES ^ALL_MODULES +else + MOZ_DBGRINFO_MODULES += ^ALL_MODULES + pattern := ALL_MODULES ^ALL_MODULES +endif + +ifdef MODULE + # our current Makefile specifies a module name - add it to our pattern + pattern += $(MODULE) ^$(MODULE) +endif + +# start by finding the first relevant module name +# (remember that the order of the module names in MOZ_DBGRINFO_MODULES +# is reversed from the order the user specified to configure - +# this allows the user to put general names at the beginning +# of the list, and to override them with explicit module names later +# in the list) + +first_match:=$(firstword $(filter $(pattern), $(MOZ_DBGRINFO_MODULES))) + +ifeq ($(first_match), $(MODULE)) + # the user specified explicitly that + # this module should be compiled with -g + _DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS) + _DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS) +else + ifeq ($(first_match), ^$(MODULE)) + # the user specified explicitly that this module + # should not be compiled with -g (nothing to do) + else + ifeq ($(first_match), ALL_MODULES) + # the user didn't mention this module explicitly, + # but wanted all modules to be compiled with -g + _DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS) + _DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS) + else + ifeq ($(first_match), ^ALL_MODULES) + # the user didn't mention this module explicitly, + # but wanted all modules to be compiled without -g (nothing to do) + endif + endif + endif +endif + + +# append debug flags +# (these might have been above when processing MOZ_DBGRINFO_MODULES) +OS_CFLAGS += $(_DEBUG_CFLAGS) +OS_CXXFLAGS += $(_DEBUG_CFLAGS) +OS_LDFLAGS += $(_DEBUG_LDFLAGS) + +# MOZ_PROFILE equivs for win32 +ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_) +ifdef MOZ_DEBUG +ifneq (,$(MOZ_BROWSE_INFO)$(MOZ_BSCFILE)) +OS_CFLAGS += -FR +OS_CXXFLAGS += -FR +endif +else # ! MOZ_DEBUG + +# MOZ_DEBUG_SYMBOLS generates debug symbols in separate PDB files. +# Used for generating an optimized build with debugging symbols. +# Used in the Windows nightlies to generate symbols for crash reporting. +ifdef MOZ_DEBUG_SYMBOLS +OS_CXXFLAGS += -Zi -UDEBUG -DNDEBUG +OS_CFLAGS += -Zi -UDEBUG -DNDEBUG +OS_LDFLAGS += -DEBUG -OPT:REF -OPT:nowin98 +endif + +ifdef MOZ_QUANTIFY +# -FIXED:NO is needed for Quantify to work, but it increases the size +# of executables, so only use it if building for Quantify. +WIN32_EXE_LDFLAGS += -FIXED:NO + +# We need -OPT:NOICF to prevent identical methods from being merged together. +# Otherwise, Quantify doesn't know which method was actually called when it's +# showing you the profile. +OS_LDFLAGS += -OPT:NOICF +endif + +# +# Handle trace-malloc in optimized builds. +# No opt to give sane callstacks. +# +ifdef NS_TRACE_MALLOC +MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG +OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF -OPT:nowin98 +endif # NS_TRACE_MALLOC + +endif # MOZ_DEBUG +endif # WINNT && !GNU_CC + +# +# Build using PIC by default +# Do not use PIC if not building a shared lib (see exceptions below) +# + +ifndef BUILD_STATIC_LIBS +_ENABLE_PIC=1 +endif +ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC)) +_ENABLE_PIC=1 +endif + +# In Firefox, all components are linked into either libxul or the static +# meta-component, and should be compiled with PIC. +ifdef MOZ_META_COMPONENT +_ENABLE_PIC=1 +endif + +# If module is going to be merged into the nsStaticModule, +# make sure that the entry points are translated and +# the module is built static. + +ifdef IS_COMPONENT +ifdef EXPORT_LIBRARY +ifneq (,$(BUILD_STATIC_LIBS)) +ifdef MODULE_NAME +DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 +FORCE_STATIC_LIB=1 +endif +endif +endif +endif + +# Determine if module being compiled is destined +# to be merged into libxul + +ifdef MOZ_ENABLE_LIBXUL +ifdef LIBXUL_LIBRARY +ifdef IS_COMPONENT +ifdef MODULE_NAME +DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 +else +$(error Component makefile does not specify MODULE_NAME.) +endif +endif +FORCE_STATIC_LIB=1 +_ENABLE_PIC=1 +SHORT_LIBNAME= +endif +endif + +# If we are building this component into an extension/xulapp, it cannot be +# statically linked. In the future we may want to add a xulapp meta-component +# build option. + +ifdef XPI_NAME +_ENABLE_PIC=1 +ifdef IS_COMPONENT +EXPORT_LIBRARY= +FORCE_STATIC_LIB= +FORCE_SHARED_LIB=1 +endif +endif + +# +# Disable PIC if necessary +# + +ifndef _ENABLE_PIC +DSO_CFLAGS= +ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1) +DSO_PIC_CFLAGS=-mdynamic-no-pic +else +DSO_PIC_CFLAGS= +endif +endif + +# This comes from configure +ifdef MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE +NO_PROFILE_GUIDED_OPTIMIZE = 1 +endif + +# Enable profile-based feedback +ifndef NO_PROFILE_GUIDED_OPTIMIZE +ifdef MOZ_PROFILE_GENERATE +# No sense in profiling tools +ifndef INTERNAL_TOOLS +OS_CFLAGS += $(PROFILE_GEN_CFLAGS) +OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS) +OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS) +ifeq (WINNT,$(OS_ARCH)) +AR_FLAGS += -LTCG +endif +endif # INTERNAL_TOOLS +endif # MOZ_PROFILE_GENERATE + +ifdef MOZ_PROFILE_USE +ifndef INTERNAL_TOOLS +OS_CFLAGS += $(PROFILE_USE_CFLAGS) +OS_CXXFLAGS += $(PROFILE_USE_CFLAGS) +OS_LDFLAGS += $(PROFILE_USE_LDFLAGS) +ifeq (WINNT,$(OS_ARCH)) +AR_FLAGS += -LTCG +endif +endif # INTERNAL_TOOLS +endif # MOZ_PROFILE_USE +endif # NO_PROFILE_GUIDED_OPTIMIZE + + +# Does the makefile specifies the internal XPCOM API linkage? +ifneq (,$(MOZILLA_INTERNAL_API)$(LIBXUL_LIBRARY)) +DEFINES += -DMOZILLA_INTERNAL_API +endif + +# Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're +# building libxul libraries +ifdef MOZ_ENABLE_LIBXUL +ifdef LIBXUL_LIBRARY +DEFINES += \ + -D_IMPL_NS_COM \ + -DEXPORT_XPT_API \ + -DEXPORT_XPTC_API \ + -D_IMPL_NS_COM_OBSOLETE \ + -D_IMPL_NS_GFX \ + -D_IMPL_NS_WIDGET \ + -DIMPL_XREAPI \ + -DIMPL_NS_NET \ + -DIMPL_THEBES \ + $(NULL) + +ifndef MOZ_NATIVE_ZLIB +DEFINES += -DZLIB_INTERNAL +endif +endif +endif + +# Force _all_ exported methods to be |_declspec(dllexport)| when we're +# building them into the executable. + +ifeq (,$(filter-out WINNT WINCE OS2, $(OS_ARCH))) +ifdef BUILD_STATIC_LIBS +DEFINES += \ + -D_IMPL_NS_GFX \ + -D_IMPL_NS_MSG_BASE \ + -D_IMPL_NS_WIDGET \ + $(NULL) +endif +endif + +# Flags passed to make-jars.pl + +MAKE_JARS_FLAGS = \ + -t $(topsrcdir) \ + -f $(MOZ_CHROME_FILE_FORMAT) \ + $(NULL) + +ifdef USE_EXTENSION_MANIFEST +MAKE_JARS_FLAGS += -e +endif + +ifdef BOTH_MANIFESTS +MAKE_JARS_FLAGS += --both-manifests +endif + +TAR_CREATE_FLAGS = -cvhf + +ifeq ($(OS_ARCH),BSD_OS) +TAR_CREATE_FLAGS = -cvLf +endif + +ifeq ($(OS_ARCH),OS2) +TAR_CREATE_FLAGS = -cvf +endif + +# +# Personal makefile customizations go in these optional make include files. +# +MY_CONFIG := $(DEPTH)/config/myconfig.mk +MY_RULES := $(DEPTH)/config/myrules.mk + +# +# Default command macros; can be overridden in <arch>.mk. +# +CCC = $(CXX) +NFSPWD = $(CONFIG_TOOLS)/nfspwd +PURIFY = purify $(PURIFYOPTIONS) +QUANTIFY = quantify $(QUANTIFYOPTIONS) +ifdef CROSS_COMPILE +XPIDL_COMPILE = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX) +XPIDL_LINK = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/host/bin/host_xpt_link$(HOST_BIN_SUFFIX) +else +XPIDL_COMPILE = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX) +XPIDL_LINK = $(CYGWIN_WRAPPER) $(LIBXUL_DIST)/bin/xpt_link$(BIN_SUFFIX) +endif + +# Java macros +JAVA_GEN_DIR = _javagen +JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR) +JAVA_IFACES_PKG_NAME = org/mozilla/interfaces + +REQ_INCLUDES = -I$(srcdir) -I. $(foreach d,$(REQUIRES),-I$(DIST)/include/$d) -I$(DIST)/include +ifdef LIBXUL_SDK +REQ_INCLUDES_SDK = $(foreach d,$(REQUIRES),-I$(LIBXUL_SDK)/include/$d) -I$(LIBXUL_SDK)/include +endif + +INCLUDES = $(LOCAL_INCLUDES) $(REQ_INCLUDES) $(REQ_INCLUDES_SDK) -I$(PUBLIC) $(OS_INCLUDES) + +ifndef MOZILLA_INTERNAL_API +INCLUDES += -I$(LIBXUL_DIST)/sdk/include +endif + +# The entire tree should be subject to static analysis using the XPCOM +# script. Additional scripts may be added by specific subdirectories. + +DEHYDRA_SCRIPT = $(topsrcdir)/xpcom/analysis/static-checking.js + +DEHYDRA_MODULES = \ + $(topsrcdir)/xpcom/analysis/final.js \ + $(NULL) + +TREEHYDRA_MODULES = \ + $(topsrcdir)/xpcom/analysis/outparams.js \ + $(topsrcdir)/xpcom/analysis/stack.js \ + $(topsrcdir)/xpcom/analysis/flow.js \ + $(NULL) + +DEHYDRA_ARGS = \ + --topsrcdir=$(topsrcdir) \ + --objdir=$(DEPTH) \ + --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \ + --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \ + $(NULL) + +DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)' + +ifdef DEHYDRA_PATH +OS_CXXFLAGS += $(DEHYDRA_FLAGS) +endif + +CFLAGS = $(OS_CFLAGS) +CXXFLAGS = $(OS_CXXFLAGS) +LDFLAGS = $(OS_LDFLAGS) $(MOZ_FIX_LINK_PATHS) + +# Allow each module to override the *default* optimization settings +# by setting MODULE_OPTIMIZE_FLAGS if the developer has not given +# arguments to --enable-optimize +ifdef MOZ_OPTIMIZE +ifeq (1,$(MOZ_OPTIMIZE)) +ifdef MODULE_OPTIMIZE_FLAGS +CFLAGS += $(MODULE_OPTIMIZE_FLAGS) +CXXFLAGS += $(MODULE_OPTIMIZE_FLAGS) +else +CFLAGS += $(MOZ_OPTIMIZE_FLAGS) +CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS) +endif # MODULE_OPTIMIZE_FLAGS +else +CFLAGS += $(MOZ_OPTIMIZE_FLAGS) +CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS) +endif # MOZ_OPTIMIZE == 1 +LDFLAGS += $(MOZ_OPTIMIZE_LDFLAGS) +endif # MOZ_OPTIMIZE + +ifdef CROSS_COMPILE +HOST_CFLAGS += $(HOST_OPTIMIZE_FLAGS) +else +ifdef MOZ_OPTIMIZE +ifeq (1,$(MOZ_OPTIMIZE)) +ifdef MODULE_OPTIMIZE_FLAGS +HOST_CFLAGS += $(MODULE_OPTIMIZE_FLAGS) +else +HOST_CFLAGS += $(MOZ_OPTIMIZE_FLAGS) +endif # MODULE_OPTIMIZE_FLAGS +else +HOST_CFLAGS += $(MOZ_OPTIMIZE_FLAGS) +endif # MOZ_OPTIMIZE == 1 +endif # MOZ_OPTIMIZE +endif # CROSS_COMPILE + + +ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_) +#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded +#// DLL version of the RTL is used... +#// +#//------------------------------------------------------------------------ +ifdef USE_STATIC_LIBS +RTL_FLAGS=-MT # Statically linked multithreaded RTL +ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC)) +ifndef MOZ_NO_DEBUG_RTL +RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL +endif +endif # MOZ_DEBUG || NS_TRACE_MALLOC + +else # !USE_STATIC_LIBS + +RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL +ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC)) +ifndef MOZ_NO_DEBUG_RTL +RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL +endif +endif # MOZ_DEBUG || NS_TRACE_MALLOC +endif # USE_STATIC_LIBS +endif # WINNT && !GNU_CC + +ifeq ($(OS_ARCH),Darwin) +# Darwin doesn't cross-compile, so just set both types of flags here. +HOST_CMFLAGS += -fobjc-exceptions +HOST_CMMFLAGS += -fobjc-exceptions +OS_COMPILE_CMFLAGS += -fobjc-exceptions +OS_COMPILE_CMMFLAGS += -fobjc-exceptions +endif + +COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) +COMPILE_CXXFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROFILER_CFLAGS) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(CXXFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) +COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) +COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) + +ifndef CROSS_COMPILE +HOST_CFLAGS += $(RTL_FLAGS) +endif + +# +# Name of the binary code directories +# +# Override defaults + +# We need to know where to find the libraries we +# put on the link line for binaries, and should +# we link statically or dynamic? Assuming dynamic for now. + +ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC)) +ifneq (,$(filter-out WINCE,$(OS_ARCH))) +LIBS_DIR = -L$(DIST)/bin -L$(DIST)/lib +ifdef LIBXUL_SDK +LIBS_DIR += -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib +endif +endif +endif + +# Default location of include files +IDL_DIR = $(DIST)/idl +ifdef MODULE +PUBLIC = $(DIST)/include/$(MODULE) +else +PUBLIC = $(DIST)/include +endif + +XPIDL_FLAGS = -I$(srcdir) -I$(IDL_DIR) +ifdef LIBXUL_SDK +XPIDL_FLAGS += -I$(LIBXUL_SDK)/idl +endif + +SDK_PUBLIC = $(DIST)/sdk/include +SDK_IDL_DIR = $(DIST)/sdk/idl +SDK_LIB_DIR = $(DIST)/sdk/lib +SDK_BIN_DIR = $(DIST)/sdk/bin + +DEPENDENCIES = .md + +MOZ_COMPONENT_LIBS=$(XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS) + +ifdef GC_LEAK_DETECTOR +XPCOM_LIBS += -lboehm +endif + +ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES))) +DEFINES += -DXPCONNECT_STANDALONE +endif + +ifeq ($(OS_ARCH),OS2) +ELF_DYNSTR_GC = echo +else +ELF_DYNSTR_GC = : +endif + +ifndef CROSS_COMPILE +ifdef USE_ELF_DYNSTR_GC +ifdef MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS +ELF_DYNSTR_GC = $(DEPTH)/config/elf-dynstr-gc +endif +endif +endif + +ifeq ($(OS_ARCH),Darwin) +ifdef NEXT_ROOT +export NEXT_ROOT +PBBUILD = NEXT_ROOT= $(PBBUILD_BIN) +else # NEXT_ROOT +PBBUILD = $(PBBUILD_BIN) +endif # NEXT_ROOT +PBBUILD_SETTINGS = GCC_VERSION="$(GCC_VERSION)" SYMROOT=build ARCHS="$(OS_TEST)" +ifdef MACOS_SDK_DIR +PBBUILD_SETTINGS += SDKROOT="$(MACOS_SDK_DIR)" +endif # MACOS_SDK_DIR +ifdef MACOSX_DEPLOYMENT_TARGET +export MACOSX_DEPLOYMENT_TARGET +PBBUILD_SETTINGS += MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DEPLOYMENT_TARGET)" +endif # MACOSX_DEPLOYMENT_TARGET +ifdef MOZ_OPTIMIZE +ifeq (2,$(MOZ_OPTIMIZE)) +# Only override project defaults if the config specified explicit settings +PBBUILD_SETTINGS += GCC_MODEL_TUNING= OPTIMIZATION_CFLAGS="$(MOZ_OPTIMIZE_FLAGS)" +endif # MOZ_OPTIMIZE=2 +endif # MOZ_OPTIMIZE +ifeq (1,$(HAS_XCODE_2_1)) +# Xcode 2.1 puts its build products in a directory corresponding to the +# selected build style/configuration. +XCODE_PRODUCT_DIR = build/$(BUILDSTYLE) +else +XCODE_PRODUCT_DIR = build +endif # HAS_XCODE_2_1=1 +endif # OS_ARCH=Darwin + + +ifdef MOZ_NATIVE_MAKEDEPEND +MKDEPEND_DIR = +MKDEPEND = $(CYGWIN_WRAPPER) $(MOZ_NATIVE_MAKEDEPEND) +else +MKDEPEND_DIR = $(CONFIG_TOOLS)/mkdepend +MKDEPEND = $(CYGWIN_WRAPPER) $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX) +endif + +# Set link flags according to whether we want a console. +ifdef MOZ_WINCONSOLE +ifeq ($(MOZ_WINCONSOLE),1) +ifeq ($(OS_ARCH),OS2) +BIN_FLAGS += -Zlinker -PM:VIO +endif +ifeq ($(OS_ARCH),WINNT) +ifdef GNU_CC +WIN32_EXE_LDFLAGS += -mconsole +else +WIN32_EXE_LDFLAGS += -SUBSYSTEM:CONSOLE +endif +endif +else # MOZ_WINCONSOLE +ifeq ($(OS_ARCH),OS2) +BIN_FLAGS += -Zlinker -PM:PM +endif +ifeq ($(OS_ARCH),WINNT) +ifdef GNU_CC +WIN32_EXE_LDFLAGS += -mwindows +else +WIN32_EXE_LDFLAGS += -SUBSYSTEM:WINDOWS +endif +endif +endif +endif + +# Flags needed to link against the component library +ifdef MOZ_COMPONENTLIB +MOZ_COMPONENTLIB_EXTRA_DSO_LIBS = mozcomps xpcom_compat + +# Tell the linker where NSS is, if we're building crypto +ifeq ($(OS_ARCH),Darwin) +ifeq (,$(findstring crypto,$(MOZ_META_COMPONENTS))) +MOZ_COMPONENTLIB_EXTRA_LIBS = $(foreach library, $(patsubst -l%, $(LIB_PREFIX)%$(DLL_SUFFIX), $(filter -l%, $(NSS_LIBS))), -dylib_file @executable_path/$(library):$(DIST)/bin/$(library)) +endif +endif +endif + +# If we're building a component on MSVC, we don't want to generate an +# import lib, because that import lib will collide with the name of a +# static version of the same library. +ifeq ($(GNU_LD)$(OS_ARCH),WINNT) +ifdef IS_COMPONENT +LDFLAGS += -IMPLIB:fake.lib +DELETE_AFTER_LINK = fake.lib fake.exp +endif +endif + +# +# Include any personal overrides the user might think are needed. +# +-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-config.mk +-include $(MY_CONFIG) + +###################################################################### +# Now test variables that might have been set or overridden by $(MY_CONFIG). + +DEFINES += -DOSTYPE=\"$(OS_CONFIG)\" +DEFINES += -DOSARCH=$(OS_ARCH) + +# For profiling +ifdef ENABLE_EAZEL_PROFILER +ifndef INTERNAL_TOOLS +ifneq ($(LIBRARY_NAME), xpt) +ifneq (, $(findstring $(shell $(topsrcdir)/build/unix/print-depth-path.sh | awk -F/ '{ print $$2; }'), $(MOZ_PROFILE_MODULES))) +PROFILER_CFLAGS = $(EAZEL_PROFILER_CFLAGS) -DENABLE_EAZEL_PROFILER +PROFILER_LIBS = $(EAZEL_PROFILER_LIBS) +endif +endif +endif +endif + +###################################################################### + +GARBAGE += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB + +ifeq ($(OS_ARCH),Darwin) +ifndef NSDISTMODE +NSDISTMODE=absolute_symlink +endif +PWD := $(shell pwd) +endif + +ifdef NSINSTALL_BIN +NSINSTALL = $(CYGWIN_WRAPPER) $(NSINSTALL_BIN) +else +ifeq (WINNT,$(CROSS_COMPILE)$(OS_ARCH)) +NSINSTALL = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall +else +ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH)) +NSINSTALL = $(MOZ_TOOLS_DIR)/nsinstall +else +NSINSTALL = $(CONFIG_TOOLS)/nsinstall +endif # OS2 +endif # WINNT +endif # NSINSTALL_BIN + + +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 # Darwin +else +# install using relative symbolic links +INSTALL = $(NSINSTALL) -R +endif # absolute_symlink +endif # copy +endif # WINNT/OS2 + +ifeq (,$(filter-out WINCE,$(OS_ARCH))) +NSINSTALL = $(CYGWIN_WRAPPER) nsinstall +INSTALL = $(CYGWIN_WRAPPER) nsinstall +endif + +# Use nsinstall in copy mode to install files on the system +SYSINSTALL = $(NSINSTALL) -t + +ifeq ($(OS_ARCH),WINNT) +ifneq (,$(CYGDRIVE_MOUNT)) +export CYGDRIVE_MOUNT +endif +endif + +# +# Localization build automation +# + +# Because you might wish to "make locales AB_CD=ab-CD", we don't hardcode +# MOZ_UI_LOCALE directly, but use an intermediate variable that can be +# overridden by the command line. (Besides, AB_CD is prettier). +AB_CD = $(MOZ_UI_LOCALE) + +ifndef L10NBASEDIR +L10NBASEDIR = $(error L10NBASEDIR not defined by configure) +endif + +EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(L10NBASEDIR)/$(AB_CD)/$(subst /locales,,$(1))) + +ifdef relativesrcdir +LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir)) +endif + +ifdef LOCALE_SRCDIR +# if LOCALE_MERGEDIR is set, use mergedir first, then the localization, +# and finally en-US +ifdef LOCALE_MERGEDIR +MAKE_JARS_FLAGS += -c $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir)) +endif +MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR) +ifdef LOCALE_MERGEDIR +MAKE_JARS_FLAGS += -c $(topsrcdir)/$(relativesrcdir)/en-US +endif +endif + +ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH))) +RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh +endif + +# +# Java macros +# + +# Make sure any compiled classes work with at least JVM 1.4 +JAVAC_FLAGS += -source 1.4 + +ifdef MOZ_DEBUG +JAVAC_FLAGS += -g +endif diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/fastcwd.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/fastcwd.pl new file mode 100644 index 0000000..c327ccf --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/fastcwd.pl @@ -0,0 +1,66 @@ +#!perl5 +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +sub fastcwd { + local($odev, $oino, $cdev, $cino, $tdev, $tino); + local(@path, $path); + local(*DIR); + + ($cdev, $cino) = stat('.'); + for (;;) { + ($odev, $oino) = ($cdev, $cino); + chdir('..'); + ($cdev, $cino) = stat('.'); + last if $odev == $cdev && $oino == $cino; + opendir(DIR, '.'); + for (;;) { + $_ = readdir(DIR); + next if $_ eq '.'; + next if $_ eq '..'; + + last unless $_; + ($tdev, $tino) = lstat($_); + last unless $tdev != $odev || $tino != $oino; + } + closedir(DIR); + unshift(@path, $_); + } + chdir($path = '/' . join('/', @path)); + $path; +} +1; diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/gcc_hidden.h b/tools/node_modules/expresso/deps/jscoverage/js/config/gcc_hidden.h new file mode 100644 index 0000000..58140c1 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/gcc_hidden.h @@ -0,0 +1,2 @@ +/* Begin all files as hidden visibility */ +#pragma GCC visibility push(hidden) diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/insure.mk b/tools/node_modules/expresso/deps/jscoverage/js/config/insure.mk new file mode 100644 index 0000000..fc796eb --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/insure.mk @@ -0,0 +1,53 @@ +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +INCLUDED_INSURE_MK = 1 + +INSURE_MATCH_SCRIPT=$(topsrcdir)/build/autoconf/match-dir.sh + +INSURE_EXCLUDE=$(shell $(INSURE_MATCH_SCRIPT) $(MOZ_INSURE_EXCLUDE_DIRS)) + +INSURE_INCLUDE=$(shell $(INSURE_MATCH_SCRIPT) $(MOZ_INSURE_DIRS)) + +ifeq ($(INSURE_EXCLUDE),0) + +ifeq ($(INSURE_INCLUDE),1) +CC := $(MOZ_INSURE) +CXX := $(MOZ_INSURE) +endif # INSURE_INCLUDE == 1 + +endif # INSURE_EXCLUDE == 0 diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/make-system-wrappers.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/make-system-wrappers.pl new file mode 100644 index 0000000..31c9af4 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/make-system-wrappers.pl @@ -0,0 +1,59 @@ +#!/usr/bin/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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# IBM Corporation. +# Portions created by the Initial Developer are Copyright (C) 2004 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Brian Ryner <bryner@brianryner.com> +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +$output_dir = shift; + +while (<STDIN>) { + chomp; + if (-e "$output_dir/$_") { + next; + } + + if (/(.*)\/[^\/*]/) { + mkdir "$output_dir/$1"; + } + + open OUT, ">$output_dir/$_"; + print OUT "#pragma GCC system_header\n"; # suppress include_next warning + print OUT "#pragma GCC visibility push(default)\n"; + print OUT "#include_next \<$_\>\n"; + print OUT "#pragma GCC visibility pop\n"; + close OUT; +} + diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.pl new file mode 100644 index 0000000..e3cee2a --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.pl @@ -0,0 +1,112 @@ +#!/usr/bin/perl -w +# ***** 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 Win32 Version System. +# +# The Initial Developer of the Original Code is Netscape Communications Corporation +# Portions created by the Initial Developer are Copyright (C) 2002 +# 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 ***** + +use Getopt::Long; + +use strict; +use vars qw( + $OBJDIR + $SRCDIR + $TOPSRCDIR + $SCRIPTDIR + @TEMPLATE_FILE + $MILESTONE_FILE + $MILESTONE + $MILESTONE_NUM + @MILESTONE_PARTS + $MINI_VERSION + $MICRO_VERSION + $opt_debug + $opt_template + $opt_help + ); + +$SCRIPTDIR = $0; +$SCRIPTDIR =~ s/[^\/]*$//; +push(@INC,$SCRIPTDIR); + +require "Moz/Milestone.pm"; + +&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template'); + +if (defined($opt_help)) { + &usage(); + exit; +} + +if (defined($opt_template)) { + @TEMPLATE_FILE = @ARGV; + if ($opt_debug) { + print("TEMPLATE_FILE = --@TEMPLATE_FILE--\n"); + } +} + +if (!defined($SRCDIR)) { $SRCDIR = '.'; } +if (!defined($OBJDIR)) { $OBJDIR = '.'; } + +$MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt"; +@MILESTONE_PARTS = (0, 0, 0, 0); + +# +# Grab milestone (top line of $MILESTONE_FILE that starts with a digit) +# +my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE); + +if (defined(@TEMPLATE_FILE)) { + my $TFILE; + + foreach $TFILE (@TEMPLATE_FILE) { + my $BUILT_FILE = "$OBJDIR/$TFILE"; + $TFILE = "$SRCDIR/$TFILE.tmpl"; + + if (-e $TFILE) { + + Moz::Milestone::build_file($TFILE,$BUILT_FILE); + + } else { + warn("$0: No such file $TFILE!\n"); + } + } +} else { + print "$milestone\n"; +} + +sub usage() { + print <<END +`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files +END + ; +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.txt b/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.txt new file mode 100644 index 0000000..f3b9fdf --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/milestone.txt @@ -0,0 +1,13 @@ +# Holds the current milestone. +# Should be in the format of +# +# x.x.x +# x.x.x.x +# x.x.x+ +# +# Referenced by milestone.pl. +# Hopefully I'll be able to automate replacement of *all* +# hardcoded milestones in the tree from these two files. +#-------------------------------------------------------- + +1.9.1b2 diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/Makefile.in b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/Makefile.in new file mode 100644 index 0000000..2e0fc2a --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/Makefile.in @@ -0,0 +1,84 @@ +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +DEPTH = ../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +# undefine (as best we can, thanks gmake!) so we don't need build_number +MOZILLA_OFFICIAL = +BUILD_OFFICIAL = +MODULE = mkdepend +HOST_PROGRAM = mkdepend$(BIN_SUFFIX) +ifdef GNU_CC +MODULE_OPTIMIZE_FLAGS = -O3 +else +ifeq ($(OS_ARCH),SunOS) +MODULE_OPTIMIZE_FLAGS = -fast +endif +endif + +ifeq ($(OS_ARCH),WINNT) +ifndef GNU_CC +MODULE_OPTIMIZE_FLAGS = -Ox +endif +endif + +HOST_CSRCS = \ + cppsetup.c \ + ifparser.c \ + include.c \ + main.c \ + parse.c \ + pr.c \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" + +ifdef GNU_CC +_GCCDIR = $(shell $(CC) -print-file-name=include) +HOST_CFLAGS += -DPREINCDIR=\"$(_GCCDIR)\" +endif + +export:: $(HOST_PROGRAM) + +$(HOST_OBJS): def.h ifparser.h imakemdep.h diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/cppsetup.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/cppsetup.c new file mode 100644 index 0000000..49a746a --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/cppsetup.c @@ -0,0 +1,233 @@ +/* $Xorg: cppsetup.c,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/cppsetup.c,v 3.11 2001/12/17 20:52:22 dawes Exp $ */ + +#include "def.h" + +#ifdef CPP +/* + * This file is strictly for the sake of cpy.y and yylex.c (if + * you indeed have the source for cpp). + */ +#define IB 1 +#define SB 2 +#define NB 4 +#define CB 8 +#define QB 16 +#define WB 32 +#define SALT '#' +#if defined(pdp11) || defined(vax) || defined(ns16000) || defined(mc68000) || defined(ibm032) +#define COFF 128 +#else +#define COFF 0 +#endif +/* + * These variables used by cpy.y and yylex.c + */ +extern char *outp, *inp, *newp, *pend; +extern char *ptrtab; +extern char fastab[]; +extern char slotab[]; + +/* + * cppsetup + */ +struct filepointer *currentfile; +struct inclist *currentinc; + +int +cppsetup(char *line, struct filepointer *filep, struct inclist *inc) +{ + char *p, savec; + static boolean setupdone = FALSE; + boolean value; + + if (!setupdone) { + cpp_varsetup(); + setupdone = TRUE; + } + + currentfile = filep; + currentinc = inc; + inp = newp = line; + for (p=newp; *p; p++) + ; + + /* + * put a newline back on the end, and set up pend, etc. + */ + *p++ = '\n'; + savec = *p; + *p = '\0'; + pend = p; + + ptrtab = slotab+COFF; + *--inp = SALT; + outp=inp; + value = yyparse(); + *p = savec; + return(value); +} + +struct symtab **lookup(symbol) + char *symbol; +{ + static struct symtab *undefined; + struct symtab **sp; + + sp = isdefined(symbol, currentinc, NULL); + if (sp == NULL) { + sp = &undefined; + (*sp)->s_value = NULL; + } + return (sp); +} + +pperror(tag, x0,x1,x2,x3,x4) + int tag,x0,x1,x2,x3,x4; +{ + warning("\"%s\", line %d: ", currentinc->i_file, currentfile->f_line); + warning(x0,x1,x2,x3,x4); +} + + +yyerror(s) + register char *s; +{ + fatalerr("Fatal error: %s\n", s); +} +#else /* not CPP */ + +#include "ifparser.h" +struct _parse_data { + struct filepointer *filep; + struct inclist *inc; + char *filename; + const char *line; +}; + +static const char * +my_if_errors (IfParser *ip, const char *cp, const char *expecting) +{ + struct _parse_data *pd = (struct _parse_data *) ip->data; + int lineno = pd->filep->f_line; + char *filename = pd->filename; + char prefix[300]; + int prefixlen; + int i; + + sprintf (prefix, "\"%s\":%d", filename, lineno); + prefixlen = strlen(prefix); + fprintf (stderr, "%s: %s", prefix, pd->line); + i = cp - pd->line; + if (i > 0 && pd->line[i-1] != '\n') { + putc ('\n', stderr); + } + for (i += prefixlen + 3; i > 0; i--) { + putc (' ', stderr); + } + fprintf (stderr, "^--- expecting %s\n", expecting); + return NULL; +} + + +#define MAXNAMELEN 256 + +static struct symtab ** +lookup_variable (IfParser *ip, const char *var, int len) +{ + char tmpbuf[MAXNAMELEN + 1]; + struct _parse_data *pd = (struct _parse_data *) ip->data; + + if (len > MAXNAMELEN) + return 0; + + strncpy (tmpbuf, var, len); + tmpbuf[len] = '\0'; + return isdefined (tmpbuf, pd->inc, NULL); +} + + +static int +my_eval_defined (IfParser *ip, const char *var, int len) +{ + if (lookup_variable (ip, var, len)) + return 1; + else + return 0; +} + +#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') + +static long +my_eval_variable (IfParser *ip, const char *var, int len) +{ + long val; + struct symtab **s; + + s = lookup_variable (ip, var, len); + if (!s) + return 0; + do { + var = (*s)->s_value; + if (!isvarfirstletter(*var) || !strcmp((*s)->s_name, var)) + break; + s = lookup_variable (ip, var, strlen(var)); + } while (s); + + var = ParseIfExpression(ip, var, &val); + if (var && *var) debug(4, ("extraneous: '%s'\n", var)); + return val; +} + +int +cppsetup(char *filename, + char *line, + struct filepointer *filep, + struct inclist *inc) +{ + IfParser ip; + struct _parse_data pd; + long val = 0; + + pd.filep = filep; + pd.inc = inc; + pd.line = line; + pd.filename = filename; + ip.funcs.handle_error = my_if_errors; + ip.funcs.eval_defined = my_eval_defined; + ip.funcs.eval_variable = my_eval_variable; + ip.data = (char *) &pd; + + (void) ParseIfExpression (&ip, line, &val); + if (val) + return IF; + else + return IFFALSE; +} +#endif /* CPP */ + diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/def.h b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/def.h new file mode 100644 index 0000000..d6e5f89 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/def.h @@ -0,0 +1,184 @@ +/* $Xorg: def.h,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/def.h,v 3.14 2003/01/17 17:09:49 tsi Exp $ */ + +#ifndef NO_X11 +#include <X11/Xos.h> +#include <X11/Xfuncproto.h> +#endif +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#if 0 +#ifndef X_NOT_POSIX +#ifndef _POSIX_SOURCE +#define _POSIX_SOURCE +#endif +#endif +#endif +#include <sys/types.h> +#include <fcntl.h> +#include <sys/stat.h> + +#define MAXDEFINES 512 +#define MAXFILES 1024 +#define MAXINCFILES 256 /* "-include" files */ +#define MAXDIRS 1024 +#define SYMTABINC 10 /* must be > 1 for define() to work right */ +#define TRUE 1 +#define FALSE 0 + +/* the following must match the directives table in main.c */ +#define IF 0 +#define IFDEF 1 +#define IFNDEF 2 +#define ELSE 3 +#define ENDIF 4 +#define DEFINE 5 +#define UNDEF 6 +#define INCLUDE 7 +#define LINE 8 +#define PRAGMA 9 +#define ERROR 10 +#define IDENT 11 +#define SCCS 12 +#define ELIF 13 +#define EJECT 14 +#define WARNING 15 +#define INCLUDENEXT 16 +#define IFFALSE 17 /* pseudo value --- never matched */ +#define ELIFFALSE 18 /* pseudo value --- never matched */ +#define INCLUDEDOT 19 /* pseudo value --- never matched */ +#define IFGUESSFALSE 20 /* pseudo value --- never matched */ +#define ELIFGUESSFALSE 21 /* pseudo value --- never matched */ +#define INCLUDENEXTDOT 22 /* pseudo value --- never matched */ + +#ifdef DEBUG +extern int _debugmask; +/* + * debug levels are: + * + * 0 show ifn*(def)*,endif + * 1 trace defined/!defined + * 2 show #include + * 3 show #include SYMBOL + * 4-6 unused + */ +#define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; } +#else +#define debug(level,arg) /**/ +#endif /* DEBUG */ + +typedef unsigned char boolean; + +struct symtab { + char *s_name; + char *s_value; +}; + +/* possible i_flag */ +#define DEFCHECKED (1<<0) /* whether defines have been checked */ +#define NOTIFIED (1<<1) /* whether we have revealed includes */ +#define MARKED (1<<2) /* whether it's in the makefile */ +#define SEARCHED (1<<3) /* whether we have read this */ +#define FINISHED (1<<4) /* whether we are done reading this */ +#define INCLUDED_SYM (1<<5) /* whether #include SYMBOL was found + Can't use i_list if TRUE */ +struct inclist { + char *i_incstring; /* string from #include line */ + char *i_file; /* path name of the include file */ + struct inclist **i_list; /* list of files it itself includes */ + int i_listlen; /* length of i_list */ + struct symtab **i_defs; /* symbol table for this file and its + children when merged */ + int i_ndefs; /* current # defines */ + boolean *i_merged; /* whether we have merged child + defines */ + unsigned char i_flags; +}; + +struct filepointer { + char *f_name; + char *f_p; + char *f_base; + char *f_end; + long f_len; + long f_line; + long cmdinc_count; + char **cmdinc_list; + long cmdinc_line; +}; + +#include <stdlib.h> +#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ +char *malloc(), *realloc(); +#endif /* macII */ + +char *copy(char *str); +int match(char *str, char **list); +char *base_name(char *file); +char *getnextline(struct filepointer *fp); +struct symtab **slookup(char *symbol, struct inclist *file); +struct symtab **isdefined(char *symbol, struct inclist *file, + struct inclist **srcfile); +struct symtab **fdefined(char *symbol, struct inclist *file, + struct inclist **srcfile); +struct filepointer *getfile(char *file); +void included_by(struct inclist *ip, + struct inclist *newfile); +struct inclist *newinclude(char *newfile, char *incstring); +void inc_clean (void); +struct inclist *inc_path(char *file, char *include, int type); + +void freefile(struct filepointer *fp); + +void define2(char *name, char *val, struct inclist *file); +void define(char *def, struct inclist *file); +void undefine(char *symbol, struct inclist *file); +int find_includes(struct filepointer *filep, + struct inclist *file, + struct inclist *file_red, + int recursion, boolean failOK); + +void recursive_pr_include(struct inclist *head, + char *file, char *base); +void add_include(struct filepointer *filep, + struct inclist *file, + struct inclist *file_red, + char *include, int type, + boolean failOK); + +int cppsetup(char *filename, + char *line, + struct filepointer *filep, + struct inclist *inc); + + +extern void fatalerr(char *, ...); +extern void warning(char *, ...); +extern void warning1(char *, ...); diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.c new file mode 100644 index 0000000..d8d9e76 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.c @@ -0,0 +1,549 @@ +/* + * $Xorg: ifparser.c,v 1.3 2000/08/17 19:41:50 cpqbld Exp $ + * + * Copyright 1992 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Network Computing Devices may not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Network Computing Devices makes + * no representations about the suitability of this software for any purpose. + * It is provided ``as is'' without express or implied warranty. + * + * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Jim Fulton + * Network Computing Devices, Inc. + * + * Simple if statement processor + * + * This module can be used to evaluate string representations of C language + * if constructs. It accepts the following grammar: + * + * EXPRESSION := VALUE + * | VALUE BINOP EXPRESSION + * | VALUE '?' EXPRESSION ':' EXPRESSION + * + * VALUE := '(' EXPRESSION ')' + * | '!' VALUE + * | '-' VALUE + * | '+' VALUE + * | '~' VALUE + * | 'defined' '(' variable ')' + * | 'defined' variable + * | # variable '(' variable-list ')' + * | variable + * | number + * + * BINOP := '*' | '/' | '%' + * | '+' | '-' + * | '<<' | '>>' + * | '<' | '>' | '<=' | '>=' + * | '==' | '!=' + * | '&' | '^' | '|' + * | '&&' | '||' + * + * The normal C order of precedence is supported. + * + * + * External Entry Points: + * + * ParseIfExpression parse a string for #if + */ +/* $XFree86: xc/config/makedepend/ifparser.c,v 3.11 2002/09/23 01:48:08 tsi Exp $ */ + +#include "ifparser.h" +#include <ctype.h> +#include <stdlib.h> +#include <string.h> + +/**************************************************************************** + Internal Macros and Utilities for Parser + ****************************************************************************/ + +#define DO(val) if (!(val)) return NULL +#define CALLFUNC(ggg,fff) (*((ggg)->funcs.fff)) +#define SKIPSPACE(ccc) while (isspace(*ccc)) ccc++ +#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') + + +static const char * +parse_variable (IfParser *g, const char *cp, const char **varp) +{ + SKIPSPACE (cp); + + if (!isvarfirstletter (*cp)) + return CALLFUNC(g, handle_error) (g, cp, "variable name"); + + *varp = cp; + /* EMPTY */ + for (cp++; isalnum(*cp) || *cp == '_'; cp++) ; + return cp; +} + + +static const char * +parse_number (IfParser *g, const char *cp, long *valp) +{ + long base = 10; + SKIPSPACE (cp); + + if (!isdigit(*cp)) + return CALLFUNC(g, handle_error) (g, cp, "number"); + + *valp = 0; + + if (*cp == '0') { + cp++; + if ((*cp == 'x') || (*cp == 'X')) { + base = 16; + cp++; + } else { + base = 8; + } + } + + /* Ignore overflows and assume ASCII, what source is usually written in */ + while (1) { + int increment = -1; + if (base == 8) { + if ((*cp >= '0') && (*cp <= '7')) + increment = *cp++ - '0'; + } else if (base == 16) { + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + else if ((*cp >= 'A') && (*cp <= 'F')) + increment = *cp++ - ('A' - 10); + else if ((*cp >= 'a') && (*cp <= 'f')) + increment = *cp++ - ('a' - 10); + } else { /* Decimal */ + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + } + if (increment < 0) + break; + *valp = (*valp * base) + increment; + } + + /* Skip trailing qualifiers */ + while (*cp == 'U' || *cp == 'u' || *cp == 'L' || *cp == 'l') cp++; + return cp; +} + +static const char * +parse_character (IfParser *g, const char *cp, long *valp) +{ + char val; + + SKIPSPACE (cp); + if (*cp == '\\') + switch (cp[1]) { + case 'n': val = '\n'; break; + case 't': val = '\t'; break; + case 'v': val = '\v'; break; + case 'b': val = '\b'; break; + case 'r': val = '\r'; break; + case 'f': val = '\f'; break; + case 'a': val = '\a'; break; + case '\\': val = '\\'; break; + case '?': val = '\?'; break; + case '\'': val = '\''; break; + case '\"': val = '\"'; break; + case 'x': val = (char) strtol (cp + 2, NULL, 16); break; + default: val = (char) strtol (cp + 1, NULL, 8); break; + } + else + val = *cp; + while (*cp != '\'') cp++; + *valp = (long) val; + return cp; +} + +static const char * +parse_value (IfParser *g, const char *cp, long *valp) +{ + const char *var, *varend; + + *valp = 0; + + SKIPSPACE (cp); + if (!*cp) + return cp; + + switch (*cp) { + case '(': + DO (cp = ParseIfExpression (g, cp + 1, valp)); + SKIPSPACE (cp); + if (*cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + + return cp + 1; /* skip the right paren */ + + case '!': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = !(*valp); + return cp; + + case '-': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = -(*valp); + return cp; + + case '+': + DO (cp = parse_value (g, cp + 1, valp)); + return cp; + + case '~': + DO (cp = parse_value (g, cp + 1, valp)); + *valp = ~(*valp); + return cp; + + case '#': + DO (cp = parse_variable (g, cp + 1, &var)); + SKIPSPACE (cp); + if (*cp != '(') + return CALLFUNC(g, handle_error) (g, cp, "("); + do { + DO (cp = parse_variable (g, cp + 1, &var)); + SKIPSPACE (cp); + } while (*cp && *cp != ')'); + if (*cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + *valp = 1; /* XXX */ + return cp + 1; + + case '\'': + DO (cp = parse_character (g, cp + 1, valp)); + if (*cp != '\'') + return CALLFUNC(g, handle_error) (g, cp, "'"); + return cp + 1; + + case 'd': + if (strncmp (cp, "defined", 7) == 0 && !isalnum(cp[7])) { + int paren = 0; + int len; + + cp += 7; + SKIPSPACE (cp); + if (*cp == '(') { + paren = 1; + cp++; + } + DO (cp = parse_variable (g, cp, &var)); + len = cp - var; + SKIPSPACE (cp); + if (paren && *cp != ')') + return CALLFUNC(g, handle_error) (g, cp, ")"); + *valp = (*(g->funcs.eval_defined)) (g, var, len); + return cp + paren; /* skip the right paren */ + } + /* fall out */ + } + + if (isdigit(*cp)) { + DO (cp = parse_number (g, cp, valp)); + } else if (!isvarfirstletter(*cp)) + return CALLFUNC(g, handle_error) (g, cp, "variable or number"); + else { + DO (cp = parse_variable (g, cp, &var)); + varend = cp; + SKIPSPACE(cp); + if (*cp != '(') { + *valp = (*(g->funcs.eval_variable)) (g, var, varend - var); + } else { + do { + long dummy; + DO (cp = ParseIfExpression (g, cp + 1, &dummy)); + SKIPSPACE(cp); + if (*cp == ')') + break; + if (*cp != ',') + return CALLFUNC(g, handle_error) (g, cp, ","); + } while (1); + + *valp = 1; /* XXX */ + cp++; + } + } + + return cp; +} + + + +static const char * +parse_product (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_value (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '*': + DO (cp = parse_product (g, cp + 1, &rightval)); + *valp = (*valp * rightval); + break; + + case '/': + DO (cp = parse_product (g, cp + 1, &rightval)); + *valp = (*valp / rightval); + break; + + case '%': + DO (cp = parse_product (g, cp + 1, &rightval)); + *valp = (*valp % rightval); + break; + } + return cp; +} + + +static const char * +parse_sum (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_product (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '+': + DO (cp = parse_sum (g, cp + 1, &rightval)); + *valp = (*valp + rightval); + break; + + case '-': + DO (cp = parse_sum (g, cp + 1, &rightval)); + *valp = (*valp - rightval); + break; + } + return cp; +} + + +static const char * +parse_shift (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_sum (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '<': + if (cp[1] == '<') { + DO (cp = parse_shift (g, cp + 2, &rightval)); + *valp = (*valp << rightval); + } + break; + + case '>': + if (cp[1] == '>') { + DO (cp = parse_shift (g, cp + 2, &rightval)); + *valp = (*valp >> rightval); + } + break; + } + return cp; +} + + +static const char * +parse_inequality (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_shift (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '<': + if (cp[1] == '=') { + DO (cp = parse_inequality (g, cp + 2, &rightval)); + *valp = (*valp <= rightval); + } else { + DO (cp = parse_inequality (g, cp + 1, &rightval)); + *valp = (*valp < rightval); + } + break; + + case '>': + if (cp[1] == '=') { + DO (cp = parse_inequality (g, cp + 2, &rightval)); + *valp = (*valp >= rightval); + } else { + DO (cp = parse_inequality (g, cp + 1, &rightval)); + *valp = (*valp > rightval); + } + break; + } + return cp; +} + + +static const char * +parse_equality (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_inequality (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '=': + if (cp[1] == '=') + cp++; + DO (cp = parse_equality (g, cp + 1, &rightval)); + *valp = (*valp == rightval); + break; + + case '!': + if (cp[1] != '=') + break; + DO (cp = parse_equality (g, cp + 2, &rightval)); + *valp = (*valp != rightval); + break; + } + return cp; +} + + +static const char * +parse_band (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_equality (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '&': + if (cp[1] != '&') { + DO (cp = parse_band (g, cp + 1, &rightval)); + *valp = (*valp & rightval); + } + break; + } + return cp; +} + + +static const char * +parse_bxor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_band (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '^': + DO (cp = parse_bxor (g, cp + 1, &rightval)); + *valp = (*valp ^ rightval); + break; + } + return cp; +} + + +static const char * +parse_bor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_bxor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '|': + if (cp[1] != '|') { + DO (cp = parse_bor (g, cp + 1, &rightval)); + *valp = (*valp | rightval); + } + break; + } + return cp; +} + + +static const char * +parse_land (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_bor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '&': + if (cp[1] != '&') + return CALLFUNC(g, handle_error) (g, cp, "&&"); + DO (cp = parse_land (g, cp + 2, &rightval)); + *valp = (*valp && rightval); + break; + } + return cp; +} + + +static const char * +parse_lor (IfParser *g, const char *cp, long *valp) +{ + long rightval; + + DO (cp = parse_land (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '|': + if (cp[1] != '|') + return CALLFUNC(g, handle_error) (g, cp, "||"); + DO (cp = parse_lor (g, cp + 2, &rightval)); + *valp = (*valp || rightval); + break; + } + return cp; +} + + +static const char * +parse_cond(IfParser *g, const char *cp, long *valp) +{ + long trueval, falseval; + + DO (cp = parse_lor (g, cp, valp)); + SKIPSPACE (cp); + + switch (*cp) { + case '?': + DO (cp = parse_cond (g, cp + 1, &trueval)); + SKIPSPACE (cp); + if (*cp != ':') + return CALLFUNC(g, handle_error) (g, cp, ":"); + DO (cp = parse_cond (g, cp + 1, &falseval)); + *valp = (*valp ? trueval : falseval); + break; + } + return cp; +} + + +/**************************************************************************** + External Entry Points + ****************************************************************************/ + +const char * +ParseIfExpression (IfParser *g, const char *cp, long *valp) +{ + return parse_cond (g, cp, valp); +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.h b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.h new file mode 100644 index 0000000..89d2a2f --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/ifparser.h @@ -0,0 +1,83 @@ +/* + * $Xorg: ifparser.h,v 1.3 2000/08/17 19:41:51 cpqbld Exp $ + * + * Copyright 1992 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Network Computing Devices may not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Network Computing Devices makes + * no representations about the suitability of this software for any purpose. + * It is provided ``as is'' without express or implied warranty. + * + * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Jim Fulton + * Network Computing Devices, Inc. + * + * Simple if statement processor + * + * This module can be used to evaluate string representations of C language + * if constructs. It accepts the following grammar: + * + * EXPRESSION := VALUE + * | VALUE BINOP EXPRESSION + * | VALUE '?' EXPRESSION ':' EXPRESSION + * + * VALUE := '(' EXPRESSION ')' + * | '!' VALUE + * | '-' VALUE + * | '~' VALUE + * | 'defined' '(' variable ')' + * | variable + * | number + * + * BINOP := '*' | '/' | '%' + * | '+' | '-' + * | '<<' | '>>' + * | '<' | '>' | '<=' | '>=' + * | '==' | '!=' + * | '&' | '^' | '|' + * | '&&' | '||' + * + * The normal C order of precedence is supported. + * + * + * External Entry Points: + * + * ParseIfExpression parse a string for #if + */ + +/* $XFree86: xc/config/makedepend/ifparser.h,v 3.5 2001/07/25 15:04:40 dawes Exp $ */ + +#include <stdio.h> + +typedef int Bool; +#define False 0 +#define True 1 + +typedef struct _if_parser { + struct { /* functions */ + const char *(*handle_error) (struct _if_parser *, const char *, + const char *); + long (*eval_variable) (struct _if_parser *, const char *, int); + int (*eval_defined) (struct _if_parser *, const char *, int); + } funcs; + char *data; +} IfParser; + +const char *ParseIfExpression ( + IfParser *, + const char *, + long * +); + diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/imakemdep.h b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/imakemdep.h new file mode 100644 index 0000000..5c58351 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/imakemdep.h @@ -0,0 +1,733 @@ + +/* $XConsortium: imakemdep.h,v 1.83 95/04/07 19:47:46 kaleb Exp $ */ +/* $XFree86: xc/config/imake/imakemdep.h,v 3.12 1995/07/08 10:22:17 dawes Exp $ */ +/* + +Copyright (c) 1993, 1994 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +*/ + + +/* + * This file contains machine-dependent constants for the imake utility. + * When porting imake, read each of the steps below and add in any necessary + * definitions. In general you should *not* edit ccimake.c or imake.c! + */ + +#ifdef CCIMAKE +/* + * Step 1: imake_ccflags + * Define any special flags that will be needed to get imake.c to compile. + * These will be passed to the compile along with the contents of the + * make variable BOOTSTRAPCFLAGS. + */ +#ifdef hpux +#ifdef hp9000s800 +#define imake_ccflags "-DSYSV" +#else +#define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV" +#endif +#endif + +#if defined(macII) || defined(_AUX_SOURCE) +#define imake_ccflags "-DmacII -DSYSV" +#endif + +#ifdef stellar +#define imake_ccflags "-DSYSV" +#endif + +#if defined(USL) || defined(Oki) || defined(NCR) +#define imake_ccflags "-Xc -DSVR4" +#endif + +#ifdef sony +#if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV) +#define imake_ccflags "-DSVR4" +#else +#include <sys/param.h> +#if NEWSOS < 41 +#define imake_ccflags "-Dbsd43 -DNOSTDHDRS" +#else +#if NEWSOS < 42 +#define imake_ccflags "-Dbsd43" +#endif +#endif +#endif +#endif + +#ifdef _CRAY +#define imake_ccflags "-DSYSV -DUSG" +#endif + +#if defined(_IBMR2) || defined(aix) +#define imake_ccflags "-Daix -DSYSV" +#endif + +#ifdef Mips +# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43) +# define imake_ccflags "-DBSD43" +# else +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef is68k +#define imake_ccflags "-Dluna -Duniosb" +#endif + +#ifdef SYSV386 +# ifdef SVR4 +# define imake_ccflags "-Xc -DSVR4" +# else +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef SVR4 +# ifdef i386 +# define imake_ccflags "-Xc -DSVR4" +# endif +#endif + +#ifdef SYSV +# ifdef i386 +# define imake_ccflags "-DSYSV" +# endif +#endif + +#ifdef __convex__ +#define imake_ccflags "-fn -tm c1" +#endif + +#ifdef apollo +#define imake_ccflags "-DX_NOT_POSIX" +#endif + +#ifdef WIN32 +#define imake_ccflags "-nologo -batch -D__STDC__" +#endif + +#ifdef __uxp__ +#define imake_ccflags "-DSVR4 -DANSICPP" +#endif + +#ifdef __sxg__ +#define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS" +#endif + +#ifdef sequent +#define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX" +#endif + +#ifdef _SEQUENT_ +#define imake_ccflags "-DSYSV -DUSG" +#endif + +#if defined(SX) || defined(PC_UX) +#define imake_ccflags "-DSYSV" +#endif + +#ifdef nec_ews_svr2 +#define imake_ccflags "-DUSG" +#endif + +#if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft) +#define imake_ccflags "-DSVR4" +#endif + +#ifdef MACH +#define imake_ccflags "-DNOSTDHDRS" +#endif + +/* this is for OS/2 under EMX. This won't work with DOS */ +#if defined(__EMX__) +#define imake_ccflags "-DBSD43" +#endif + +#else /* not CCIMAKE */ +#ifndef MAKEDEPEND +/* + * Step 2: dup2 + * If your OS doesn't have a dup2() system call to duplicate one file + * descriptor onto another, define such a mechanism here (if you don't + * already fall under the existing category(ies). + */ +#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) +#define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \ + fcntl(fd1, F_DUPFD, fd2))) +#endif + + +/* + * Step 3: FIXUP_CPP_WHITESPACE + * If your cpp collapses tabs macro expansions into a single space and + * replaces escaped newlines with a space, define this symbol. This will + * cause imake to attempt to patch up the generated Makefile by looking + * for lines that have colons in them (this is why the rules file escapes + * all colons). One way to tell if you need this is to see whether or not + * your Makefiles have no tabs in them and lots of @@ strings. + */ +#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || (defined(AMOEBA) && defined(CROSS_COMPILE)) +#define FIXUP_CPP_WHITESPACE +#endif +#ifdef WIN32 +#define REMOVE_CPP_LEADSPACE +#define INLINE_SYNTAX +#define MAGIC_MAKE_VARS +#endif +#ifdef __minix_vmd +#define FIXUP_CPP_WHITESPACE +#endif + +/* + * Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP + * If you want to use cc -E instead of cpp, define USE_CC_E. + * If use cc -E but want a different compiler, define DEFAULT_CC. + * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP. + */ +#ifdef hpux +#define USE_CC_E +#endif +#ifdef WIN32 +#define USE_CC_E +#define DEFAULT_CC "cl" +#endif +#ifdef apollo +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#if defined(_IBMR2) && !defined(DEFAULT_CPP) +#define DEFAULT_CPP "/usr/lpp/X11/Xamples/util/cpp/cpp" +#endif +#if defined(sun) && defined(SVR4) +#define DEFAULT_CPP "/usr/ccs/lib/cpp" +#endif +#ifdef __bsdi__ +#define DEFAULT_CPP "/usr/bin/cpp" +#endif +#ifdef __uxp__ +#define DEFAULT_CPP "/usr/ccs/lib/cpp" +#endif +#ifdef __sxg__ +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#ifdef _CRAY +#define DEFAULT_CPP "/lib/pcpp" +#endif +#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#define DEFAULT_CPP "/usr/libexec/cpp" +#endif +#ifdef MACH +#define USE_CC_E +#endif +#ifdef __minix_vmd +#define DEFAULT_CPP "/usr/lib/cpp" +#endif +#if defined(__EMX__) +/* expects cpp in PATH */ +#define DEFAULT_CPP "cpp" +#endif + +/* + * Step 5: cpp_argv + * The following table contains the flags that should be passed + * whenever a Makefile is being generated. If your preprocessor + * doesn't predefine any unique symbols, choose one and add it to the + * end of this table. Then, do the following: + * + * a. Use this symbol in Imake.tmpl when setting MacroFile. + * b. Put this symbol in the definition of BootstrapCFlags in your + * <platform>.cf file. + * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol" + * to the end of the command line. + * + * Note that you may define more than one symbol (useful for platforms + * that support multiple operating systems). + */ + +#define ARGUMENTS 50 /* number of arguments in various arrays */ +char *cpp_argv[ARGUMENTS] = { + "cc", /* replaced by the actual program to exec */ + "-I.", /* add current directory to include path */ +#ifdef unix + "-Uunix", /* remove unix symbol so that filename unix.c okay */ +#endif +#if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(MACH) +# ifdef __i386__ + "-D__i386__", +# endif +# ifdef __x86_64__ + "-D__x86_64__", +# endif +# ifdef __GNUC__ + "-traditional", +# endif +#endif +#ifdef M4330 + "-DM4330", /* Tektronix */ +#endif +#ifdef M4310 + "-DM4310", /* Tektronix */ +#endif +#if defined(macII) || defined(_AUX_SOURCE) + "-DmacII", /* Apple A/UX */ +#endif +#ifdef USL + "-DUSL", /* USL */ +#endif +#ifdef sony + "-Dsony", /* Sony */ +#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42 + "-Dbsd43", +#endif +#endif +#ifdef _IBMR2 + "-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */ +#ifndef aix +#define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */ +#endif +#endif /* _IBMR2 */ +#ifdef aix + "-Daix", /* AIX instead of AOS */ +#ifndef ibm +#define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */ +#endif +#endif /* aix */ +#ifdef ibm + "-Dibm", /* IBM PS/2 and RT under both AOS and AIX */ +#endif +#ifdef luna + "-Dluna", /* OMRON luna 68K and 88K */ +#ifdef luna1 + "-Dluna1", +#endif +#ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */ + "-traditional", /* for some older version */ +#endif /* instead of "-DXCOMM=\\#" */ +#ifdef uniosb + "-Duniosb", +#endif +#ifdef uniosu + "-Duniosu", +#endif +#endif /* luna */ +#ifdef _CRAY /* Cray */ + "-Ucray", +#endif +#ifdef Mips + "-DMips", /* Define and use Mips for Mips Co. OS/mach. */ +# if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43) + "-DBSD43", /* Mips RISCOS supports two environments */ +# else + "-DSYSV", /* System V environment is the default */ +# endif +#endif /* Mips */ +#ifdef MOTOROLA + "-DMOTOROLA", /* Motorola Delta Systems */ +# ifdef SYSV + "-DSYSV", +# endif +# ifdef SVR4 + "-DSVR4", +# endif +#endif /* MOTOROLA */ +#ifdef i386 + "-Di386", +# ifdef SVR4 + "-DSVR4", +# endif +# ifdef SYSV + "-DSYSV", +# ifdef ISC + "-DISC", +# ifdef ISC40 + "-DISC40", /* ISC 4.0 */ +# else +# ifdef ISC202 + "-DISC202", /* ISC 2.0.2 */ +# else +# ifdef ISC30 + "-DISC30", /* ISC 3.0 */ +# else + "-DISC22", /* ISC 2.2.1 */ +# endif +# endif +# endif +# endif +# ifdef SCO + "-DSCO", +# ifdef SCO324 + "-DSCO324", +# endif +# endif +# endif +# ifdef ESIX + "-DESIX", +# endif +# ifdef ATT + "-DATT", +# endif +# ifdef DELL + "-DDELL", +# endif +#endif +#ifdef SYSV386 /* System V/386 folks, obsolete */ + "-Di386", +# ifdef SVR4 + "-DSVR4", +# endif +# ifdef ISC + "-DISC", +# ifdef ISC40 + "-DISC40", /* ISC 4.0 */ +# else +# ifdef ISC202 + "-DISC202", /* ISC 2.0.2 */ +# else +# ifdef ISC30 + "-DISC30", /* ISC 3.0 */ +# else + "-DISC22", /* ISC 2.2.1 */ +# endif +# endif +# endif +# endif +# ifdef SCO + "-DSCO", +# ifdef SCO324 + "-DSCO324", +# endif +# endif +# ifdef ESIX + "-DESIX", +# endif +# ifdef ATT + "-DATT", +# endif +# ifdef DELL + "-DDELL", +# endif +#endif +#ifdef __osf__ + "-D__osf__", +# ifdef __mips__ + "-D__mips__", +# endif +# ifdef __alpha + "-D__alpha", +# endif +# ifdef __i386__ + "-D__i386__", +# endif +# ifdef __GNUC__ + "-traditional", +# endif +#endif +#ifdef Oki + "-DOki", +#endif +#ifdef sun +#ifdef SVR4 + "-DSVR4", +#endif +#endif +#ifdef WIN32 + "-DWIN32", + "-nologo", + "-batch", + "-D__STDC__", +#endif +#ifdef NCR + "-DNCR", /* NCR */ +#endif +#ifdef linux + "-traditional", + "-Dlinux", +#endif +#ifdef __uxp__ + "-D__uxp__", +#endif +#ifdef __sxg__ + "-D__sxg__", +#endif +#ifdef nec_ews_svr2 + "-Dnec_ews_svr2", +#endif +#ifdef AMOEBA + "-DAMOEBA", +# ifdef CROSS_COMPILE + "-DCROSS_COMPILE", +# ifdef CROSS_i80386 + "-Di80386", +# endif +# ifdef CROSS_sparc + "-Dsparc", +# endif +# ifdef CROSS_mc68000 + "-Dmc68000", +# endif +# else +# ifdef i80386 + "-Di80386", +# endif +# ifdef sparc + "-Dsparc", +# endif +# ifdef mc68000 + "-Dmc68000", +# endif +# endif +#endif +#ifdef __minix_vmd + "-Dminix", +#endif + +#if defined(__EMX__) + "-traditional", + "-Demxos2", +#endif + +}; +#else /* else MAKEDEPEND */ +/* + * Step 6: predefs + * If your compiler and/or preprocessor define any specific symbols, add + * them to the the following table. The definition of struct symtab is + * in util/makedepend/def.h. + */ +struct symtab predefs[] = { +#ifdef apollo + {"apollo", "1"}, +#endif +#ifdef ibm032 + {"ibm032", "1"}, +#endif +#ifdef ibm + {"ibm", "1"}, +#endif +#ifdef aix + {"aix", "1"}, +#endif +#ifdef sun + {"sun", "1"}, +#endif +#ifdef sun2 + {"sun2", "1"}, +#endif +#ifdef sun3 + {"sun3", "1"}, +#endif +#ifdef sun4 + {"sun4", "1"}, +#endif +#ifdef sparc + {"sparc", "1"}, +#endif +#ifdef __sparc__ + {"__sparc__", "1"}, +#endif +#ifdef hpux + {"hpux", "1"}, +#endif +#ifdef __hpux + {"__hpux", "1"}, +#endif +#ifdef __hp9000s800 + {"__hp9000s800", "1"}, +#endif +#ifdef __hp9000s700 + {"__hp9000s700", "1"}, +#endif +#ifdef vax + {"vax", "1"}, +#endif +#ifdef VMS + {"VMS", "1"}, +#endif +#ifdef cray + {"cray", "1"}, +#endif +#ifdef CRAY + {"CRAY", "1"}, +#endif +#ifdef _CRAY + {"_CRAY", "1"}, +#endif +#ifdef att + {"att", "1"}, +#endif +#ifdef mips + {"mips", "1"}, +#endif +#ifdef __mips__ + {"__mips__", "1"}, +#endif +#ifdef ultrix + {"ultrix", "1"}, +#endif +#ifdef stellar + {"stellar", "1"}, +#endif +#ifdef mc68000 + {"mc68000", "1"}, +#endif +#ifdef mc68020 + {"mc68020", "1"}, +#endif +#ifdef __GNUC__ + {"__GNUC__", "1"}, +#endif +#if __STDC__ + {"__STDC__", "1"}, +#endif +#ifdef __HIGHC__ + {"__HIGHC__", "1"}, +#endif +#ifdef CMU + {"CMU", "1"}, +#endif +#ifdef luna + {"luna", "1"}, +#ifdef luna1 + {"luna1", "1"}, +#endif +#ifdef luna2 + {"luna2", "1"}, +#endif +#ifdef luna88k + {"luna88k", "1"}, +#endif +#ifdef uniosb + {"uniosb", "1"}, +#endif +#ifdef uniosu + {"uniosu", "1"}, +#endif +#endif +#ifdef ieeep754 + {"ieeep754", "1"}, +#endif +#ifdef is68k + {"is68k", "1"}, +#endif +#ifdef m68k + {"m68k", "1"}, +#endif +#ifdef m88k + {"m88k", "1"}, +#endif +#ifdef __m88k__ + {"__m88k__", "1"}, +#endif +#ifdef bsd43 + {"bsd43", "1"}, +#endif +#ifdef hcx + {"hcx", "1"}, +#endif +#ifdef sony + {"sony", "1"}, +#ifdef SYSTYPE_SYSV + {"SYSTYPE_SYSV", "1"}, +#endif +#ifdef _SYSTYPE_SYSV + {"_SYSTYPE_SYSV", "1"}, +#endif +#endif +#ifdef __OSF__ + {"__OSF__", "1"}, +#endif +#ifdef __osf__ + {"__osf__", "1"}, +#endif +#ifdef __alpha + {"__alpha", "1"}, +#endif +#ifdef __DECC + {"__DECC", "1"}, +#endif +#ifdef __decc + {"__decc", "1"}, +#endif +#ifdef __uxp__ + {"__uxp__", "1"}, +#endif +#ifdef __sxg__ + {"__sxg__", "1"}, +#endif +#ifdef _SEQUENT_ + {"_SEQUENT_", "1"}, + {"__STDC__", "1"}, +#endif +#ifdef __bsdi__ + {"__bsdi__", "1"}, +#endif +#ifdef nec_ews_svr2 + {"nec_ews_svr2", "1"}, +#endif +#ifdef nec_ews_svr4 + {"nec_ews_svr4", "1"}, +#endif +#ifdef _nec_ews_svr4 + {"_nec_ews_svr4", "1"}, +#endif +#ifdef _nec_up + {"_nec_up", "1"}, +#endif +#ifdef SX + {"SX", "1"}, +#endif +#ifdef nec + {"nec", "1"}, +#endif +#ifdef _nec_ft + {"_nec_ft", "1"}, +#endif +#ifdef PC_UX + {"PC_UX", "1"}, +#endif +#ifdef sgi + {"sgi", "1"}, +#endif +#ifdef __sgi + {"__sgi", "1"}, +#endif +#ifdef __FreeBSD__ + {"__FreeBSD__", "1"}, +#endif +#ifdef __NetBSD__ + {"__NetBSD__", "1"}, +#endif +#ifdef __OpenBSD__ + {"__OpenBSD__", "1"}, +#endif +#ifdef __EMX__ + {"__EMX__", "1"}, +#endif + /* add any additional symbols before this line */ + {NULL, NULL} +}; + +#endif /* MAKEDEPEND */ +#endif /* CCIMAKE */ diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/include.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/include.c new file mode 100644 index 0000000..3b89f26 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/include.c @@ -0,0 +1,337 @@ +/* $Xorg: include.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/include.c,v 3.7 2001/12/14 19:53:20 dawes Exp $ */ + + +#include "def.h" + +#ifdef _MSC_VER +#include <windows.h> +static int +does_file_exist(char *file) +{ + WIN32_FILE_ATTRIBUTE_DATA data; + BOOL b = GetFileAttributesExA(file, GetFileExInfoStandard, &data); + if (!b) + return 0; + return (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0; +} +#else +static int +does_file_exist(char *file) +{ + struct stat sb; + return stat(file, &sb) == 0 && !S_ISDIR(sb.st_mode); +} +#endif + +extern struct inclist inclist[ MAXFILES ], + *inclistp, *inclistnext; +extern char *includedirs[ ], + **includedirsnext; +extern char *notdotdot[ ]; +extern boolean show_where_not; +extern boolean warn_multiple; + +static boolean +isdot(char *p) +{ + if(p && *p++ == '.' && *p++ == '\0') + return(TRUE); + return(FALSE); +} + +static boolean +isdotdot(char *p) +{ + if(p && *p++ == '.' && *p++ == '.' && *p++ == '\0') + return(TRUE); + return(FALSE); +} + +static boolean +issymbolic(char *dir, char *component) +{ +#ifdef S_IFLNK + struct stat st; + char buf[ BUFSIZ ], **pp; + + sprintf(buf, "%s%s%s", dir, *dir ? "/" : "", component); + for (pp=notdotdot; *pp; pp++) + if (strcmp(*pp, buf) == 0) + return (TRUE); + if (lstat(buf, &st) == 0 + && (st.st_mode & S_IFMT) == S_IFLNK) { + *pp++ = copy(buf); + if (pp >= ¬dotdot[ MAXDIRS ]) + fatalerr("out of .. dirs, increase MAXDIRS\n"); + return(TRUE); + } +#endif + return(FALSE); +} + +/* + * Occasionally, pathnames are created that look like .../x/../y + * Any of the 'x/..' sequences within the name can be eliminated. + * (but only if 'x' is not a symbolic link!!) + */ +static void +remove_dotdot(char *path) +{ + register char *end, *from, *to, **cp; + char *components[ MAXFILES ], + newpath[ BUFSIZ ]; + boolean component_copied; + + /* + * slice path up into components. + */ + to = newpath; + if (*path == '/') + *to++ = '/'; + *to = '\0'; + cp = components; + for (from=end=path; *end; end++) + if (*end == '/') { + while (*end == '/') + *end++ = '\0'; + if (*from) + *cp++ = from; + from = end; + } + *cp++ = from; + *cp = NULL; + + /* + * Recursively remove all 'x/..' component pairs. + */ + cp = components; + while(*cp) { + if (!isdot(*cp) && !isdotdot(*cp) && isdotdot(*(cp+1)) + && !issymbolic(newpath, *cp)) + { + char **fp = cp + 2; + char **tp = cp; + + do + *tp++ = *fp; /* move all the pointers down */ + while (*fp++); + if (cp != components) + cp--; /* go back and check for nested ".." */ + } else { + cp++; + } + } + /* + * Concatenate the remaining path elements. + */ + cp = components; + component_copied = FALSE; + while(*cp) { + if (component_copied) + *to++ = '/'; + component_copied = TRUE; + for (from = *cp; *from; ) + *to++ = *from++; + *to = '\0'; + cp++; + } + *to++ = '\0'; + + /* + * copy the reconstituted path back to our pointer. + */ + strcpy(path, newpath); +} + +/* + * Add an include file to the list of those included by 'file'. + */ +struct inclist * +newinclude(char *newfile, char *incstring) +{ + register struct inclist *ip; + + /* + * First, put this file on the global list of include files. + */ + ip = inclistp++; + if (inclistp == inclist + MAXFILES - 1) + fatalerr("out of space: increase MAXFILES\n"); + ip->i_file = copy(newfile); + + if (incstring == NULL) + ip->i_incstring = ip->i_file; + else + ip->i_incstring = copy(incstring); + + inclistnext = inclistp; + return(ip); +} + +void +included_by(struct inclist *ip, struct inclist *newfile) +{ + register int i; + + if (ip == NULL) + return; + /* + * Put this include file (newfile) on the list of files included + * by 'file'. If 'file' is NULL, then it is not an include + * file itself (i.e. was probably mentioned on the command line). + * If it is already on the list, don't stick it on again. + */ + if (ip->i_list == NULL) { + ip->i_list = (struct inclist **) + malloc(sizeof(struct inclist *) * ++ip->i_listlen); + ip->i_merged = (boolean *) + malloc(sizeof(boolean) * ip->i_listlen); + } else { + for (i=0; i<ip->i_listlen; i++) + if (ip->i_list[ i ] == newfile) { + i = strlen(newfile->i_file); + if (!(ip->i_flags & INCLUDED_SYM) && + !(i > 2 && + newfile->i_file[i-1] == 'c' && + newfile->i_file[i-2] == '.')) + { + /* only bitch if ip has */ + /* no #include SYMBOL lines */ + /* and is not a .c file */ + if (warn_multiple) + { + warning("%s includes %s more than once!\n", + ip->i_file, newfile->i_file); + warning1("Already have\n"); + for (i=0; i<ip->i_listlen; i++) + warning1("\t%s\n", ip->i_list[i]->i_file); + } + } + return; + } + ip->i_list = (struct inclist **) realloc(ip->i_list, + sizeof(struct inclist *) * ++ip->i_listlen); + ip->i_merged = (boolean *) + realloc(ip->i_merged, sizeof(boolean) * ip->i_listlen); + } + ip->i_list[ ip->i_listlen-1 ] = newfile; + ip->i_merged[ ip->i_listlen-1 ] = FALSE; +} + +void +inc_clean (void) +{ + register struct inclist *ip; + + for (ip = inclist; ip < inclistp; ip++) { + ip->i_flags &= ~MARKED; + } +} + +struct inclist * +inc_path(char *file, char *include, int type) +{ + static char path[ BUFSIZ ]; + register char **pp, *p; + register struct inclist *ip; + + /* + * Check all previously found include files for a path that + * has already been expanded. + */ + if ((type == INCLUDE) || (type == INCLUDEDOT)) + inclistnext = inclist; + ip = inclistnext; + + for (; ip->i_file; ip++) { + if ((strcmp(ip->i_incstring, include) == 0) && + !(ip->i_flags & INCLUDED_SYM)) { + inclistnext = ip + 1; + return ip; + } + } + + if (inclistnext == inclist) { + /* + * If the path was surrounded by "" or is an absolute path, + * then check the exact path provided. + */ + if ((type == INCLUDEDOT) || + (type == INCLUDENEXTDOT) || + (*include == '/')) { + if (does_file_exist(include)) + return newinclude(include, include); + if (show_where_not) + warning1("\tnot in %s\n", include); + } + + /* + * If the path was surrounded by "" see if this include file is + * in the directory of the file being parsed. + */ + if ((type == INCLUDEDOT) || (type == INCLUDENEXTDOT)) { + for (p=file+strlen(file); p>file; p--) + if (*p == '/') + break; + if (p == file) { + strcpy(path, include); + } else { + strncpy(path, file, (p-file) + 1); + path[ (p-file) + 1 ] = '\0'; + strcpy(path + (p-file) + 1, include); + } + remove_dotdot(path); + if (does_file_exist(path)) + return newinclude(path, include); + if (show_where_not) + warning1("\tnot in %s\n", path); + } + } + + /* + * Check the include directories specified. Standard include dirs + * should be at the end. + */ + if ((type == INCLUDE) || (type == INCLUDEDOT)) + includedirsnext = includedirs; + pp = includedirsnext; + + for (; *pp; pp++) { + sprintf(path, "%s/%s", *pp, include); + remove_dotdot(path); + if (does_file_exist(path)) { + includedirsnext = pp + 1; + return newinclude(path, include); + } + if (show_where_not) + warning1("\tnot in %s\n", path); + } + + return NULL; +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/main.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/main.c new file mode 100644 index 0000000..a86866f --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/main.c @@ -0,0 +1,860 @@ +/* $Xorg: main.c,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/main.c,v 3.32 2003/03/26 20:43:48 tsi Exp $ */ + +#include "def.h" +#ifdef hpux +#define sigvec sigvector +#endif /* hpux */ + +#ifdef X_POSIX_C_SOURCE +#define _POSIX_C_SOURCE X_POSIX_C_SOURCE +#include <signal.h> +#undef _POSIX_C_SOURCE +#else +#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) +#include <signal.h> +#else +#define _POSIX_SOURCE +#include <signal.h> +#undef _POSIX_SOURCE +#endif +#endif + +#include <stdarg.h> + +#ifdef MINIX +#define USE_CHMOD 1 +#endif + +#ifdef DEBUG +int _debugmask; +#endif + +/* #define DEBUG_DUMP */ +#ifdef DEBUG_DUMP +#define DBG_PRINT(file, fmt, args) fprintf(file, fmt, args) +#else +#define DBG_PRINT(file, fmt, args) /* empty */ +#endif + +#define DASH_INC_PRE "#include \"" +#define DASH_INC_POST "\"" + +char *ProgramName; + +char *directives[] = { + "if", + "ifdef", + "ifndef", + "else", + "endif", + "define", + "undef", + "include", + "line", + "pragma", + "error", + "ident", + "sccs", + "elif", + "eject", + "warning", + "include_next", + NULL +}; + +#define MAKEDEPEND +#include "imakemdep.h" /* from config sources */ +#undef MAKEDEPEND + +struct inclist inclist[ MAXFILES ], + *inclistp = inclist, + *inclistnext = inclist, + maininclist; + +static char *filelist[ MAXFILES ]; +char *includedirs[ MAXDIRS + 1 ], + **includedirsnext = includedirs; +char *notdotdot[ MAXDIRS ]; +static int cmdinc_count = 0; +static char *cmdinc_list[ 2 * MAXINCFILES ]; +char *objprefix = ""; +char *objsuffix = OBJSUFFIX; +static char *startat = "# DO NOT DELETE"; +int width = 78; +static boolean append = FALSE; +boolean printed = FALSE; +boolean verbose = FALSE; +boolean show_where_not = FALSE; +/* Warn on multiple includes of same file */ +boolean warn_multiple = FALSE; + +static void setfile_cmdinc(struct filepointer *filep, long count, char **list); +static void redirect(char *line, char *makefile); + +static +#ifdef SIGNALRETURNSINT +int +#else +void +#endif +catch (int sig) +{ + fflush (stdout); + fatalerr ("got signal %d\n", sig); +} + +#if defined(USG) || (defined(i386) && defined(SYSV)) || defined(WIN32) || defined(__UNIXOS2__) || defined(Lynx_22) || defined(__CYGWIN__) +#define USGISH +#endif + +#ifndef USGISH +#ifdef X_NOT_POSIX +#define sigaction sigvec +#define sa_handler sv_handler +#define sa_mask sv_mask +#define sa_flags sv_flags +#endif +struct sigaction sig_act; +#endif /* USGISH */ + +int +main(int argc, char *argv[]) +{ + char **fp = filelist; + char **incp = includedirs; + char *p; + struct inclist *ip; + char *makefile = NULL; + struct filepointer *filecontent; + struct symtab *psymp = predefs; + char *endmarker = NULL; + char *defincdir = NULL; + char **undeflist = NULL; + int numundefs = 0, i; + register char offset; + + ProgramName = argv[0]; + + while (psymp->s_name) + { + define2(psymp->s_name, psymp->s_value, &maininclist); + psymp++; + } + if (argc == 2 && argv[1][0] == '@') { + struct stat ast; + int afd; + char *args; + char **nargv; + int nargc; + char quotechar = '\0'; + + nargc = 1; + if ((afd = open(argv[1]+1, O_RDONLY)) < 0) + fatalerr("cannot open \"%s\"\n", argv[1]+1); + fstat(afd, &ast); + args = (char *)malloc(ast.st_size + 1); + if ((ast.st_size = read(afd, args, ast.st_size)) < 0) + fatalerr("failed to read %s\n", argv[1]+1); + args[ast.st_size] = '\0'; + close(afd); + for (p = args; *p; p++) { + if (quotechar) { + if (quotechar == '\\' || + (*p == quotechar && p[-1] != '\\')) + quotechar = '\0'; + continue; + } + switch (*p) { + case '\\': + case '"': + case '\'': + quotechar = *p; + break; + case ' ': + case '\n': + *p = '\0'; + if (p > args && p[-1]) + nargc++; + break; + } + } + if (p[-1]) + nargc++; + nargv = (char **)malloc(nargc * sizeof(char *)); + nargv[0] = argv[0]; + argc = 1; + for (p = args; argc < nargc; p += strlen(p) + 1) + if (*p) nargv[argc++] = p; + argv = nargv; + } + for(argc--, argv++; argc; argc--, argv++) { + /* if looking for endmarker then check before parsing */ + if (endmarker && strcmp (endmarker, *argv) == 0) { + endmarker = NULL; + continue; + } + if (**argv != '-') { + /* treat +thing as an option for C++ */ + if (endmarker && **argv == '+') + continue; + *fp++ = argv[0]; + continue; + } + switch(argv[0][1]) { + case '-': + endmarker = &argv[0][2]; + if (endmarker[0] == '\0') endmarker = "--"; + break; + case 'D': + offset = 2; + if (argv[0][2] == '\0') { + argv++; + argc--; + offset = 0; + } + /* offset +1 here since first def letter + * cannot be `=` + */ + for (p = argv[0] + offset + 1; *p; p++) + if (*p == '=') { + *p = ' '; + break; + } + define(argv[0] + offset, &maininclist); + break; + case 'I': + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = argv[0]+2; + if (**(incp-1) == '\0') { + *(incp-1) = *(++argv); + argc--; + } + break; + case 'U': + /* Undef's override all -D's so save them up */ + numundefs++; + if (numundefs == 1) + undeflist = malloc(sizeof(char *)); + else + undeflist = realloc(undeflist, + numundefs * sizeof(char *)); + offset = 2; + if (argv[0][2] == '\0') { + argv++; + argc--; + offset = 0; + } + undeflist[numundefs - 1] = argv[0] + offset; + break; + case 'Y': + defincdir = argv[0]+2; + break; + /* do not use if endmarker processing */ + case 'a': + if (endmarker) break; + append = TRUE; + break; + case 'w': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + width = atoi(argv[0]); + } else + width = atoi(argv[0]+2); + break; + case 'o': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + objsuffix = argv[0]; + } else + objsuffix = argv[0]+2; + break; + case 'p': + if (endmarker) break; + if (argv[0][2] == '\0') { + argv++; + argc--; + objprefix = argv[0]; + } else + objprefix = argv[0]+2; + break; + case 'v': + if (endmarker) break; + verbose = TRUE; +#ifdef DEBUG + if (argv[0][2]) + _debugmask = atoi(argv[0]+2); +#endif + break; + case 's': + if (endmarker) break; + startat = argv[0]+2; + if (*startat == '\0') { + startat = *(++argv); + argc--; + } + if (*startat != '#') + fatalerr("-s flag's value should start %s\n", + "with '#'."); + break; + case 'f': + if (endmarker) break; + makefile = argv[0]+2; + if (*makefile == '\0') { + makefile = *(++argv); + argc--; + } + break; + + case 'm': + warn_multiple = TRUE; + break; + + /* Ignore -O, -g so we can just pass ${CFLAGS} to + makedepend + */ + case 'O': + case 'g': + break; + case 'i': + if (strcmp(&argv[0][1],"include") == 0) { + char *buf; + if (argc<2) + fatalerr("option -include is a " + "missing its parameter\n"); + if (cmdinc_count >= MAXINCFILES) + fatalerr("Too many -include flags.\n"); + argc--; + argv++; + buf = malloc(strlen(DASH_INC_PRE) + + strlen(argv[0]) + + strlen(DASH_INC_POST) + 1); + if(!buf) + fatalerr("out of memory at " + "-include string\n"); + cmdinc_list[2 * cmdinc_count + 0] = argv[0]; + cmdinc_list[2 * cmdinc_count + 1] = buf; + cmdinc_count++; + break; + } + /* intentional fall through */ + default: + if (endmarker) break; + /* fatalerr("unknown opt = %s\n", argv[0]); */ + warning("ignoring option %s\n", argv[0]); + } + } + /* Now do the undefs from the command line */ + for (i = 0; i < numundefs; i++) + undefine(undeflist[i], &maininclist); + if (numundefs > 0) + free(undeflist); + + if (!defincdir) { +#ifdef PREINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = PREINCDIR; +#endif +#ifdef __UNIXOS2__ + { + char *emxinc = getenv("C_INCLUDE_PATH"); + /* can have more than one component */ + if (emxinc) { + char *beg, *end; + beg= (char*)strdup(emxinc); + for (;;) { + end = (char*)strchr(beg,';'); + if (end) *end = 0; + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many include dirs\n"); + *incp++ = beg; + if (!end) break; + beg = end+1; + } + } + } +#else /* !__UNIXOS2__, does not use INCLUDEDIR at all */ + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = INCLUDEDIR; +#endif + +#ifdef EXTRAINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = EXTRAINCDIR; +#endif + +#ifdef POSTINCDIR + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = POSTINCDIR; +#endif + } else if (*defincdir) { + if (incp >= includedirs + MAXDIRS) + fatalerr("Too many -I flags.\n"); + *incp++ = defincdir; + } + + redirect(startat, makefile); + + /* + * catch signals. + */ +#ifdef USGISH +/* should really reset SIGINT to SIG_IGN if it was. */ +#ifdef SIGHUP + signal (SIGHUP, catch); +#endif + signal (SIGINT, catch); +#ifdef SIGQUIT + signal (SIGQUIT, catch); +#endif + signal (SIGILL, catch); +#ifdef SIGBUS + signal (SIGBUS, catch); +#endif + signal (SIGSEGV, catch); +#ifdef SIGSYS + signal (SIGSYS, catch); +#endif +#else + sig_act.sa_handler = catch; +#if defined(_POSIX_SOURCE) || !defined(X_NOT_POSIX) + sigemptyset(&sig_act.sa_mask); + sigaddset(&sig_act.sa_mask, SIGINT); + sigaddset(&sig_act.sa_mask, SIGQUIT); +#ifdef SIGBUS + sigaddset(&sig_act.sa_mask, SIGBUS); +#endif + sigaddset(&sig_act.sa_mask, SIGILL); + sigaddset(&sig_act.sa_mask, SIGSEGV); + sigaddset(&sig_act.sa_mask, SIGHUP); + sigaddset(&sig_act.sa_mask, SIGPIPE); +#ifdef SIGSYS + sigaddset(&sig_act.sa_mask, SIGSYS); +#endif +#else + sig_act.sa_mask = ((1<<(SIGINT -1)) + |(1<<(SIGQUIT-1)) +#ifdef SIGBUS + |(1<<(SIGBUS-1)) +#endif + |(1<<(SIGILL-1)) + |(1<<(SIGSEGV-1)) + |(1<<(SIGHUP-1)) + |(1<<(SIGPIPE-1)) +#ifdef SIGSYS + |(1<<(SIGSYS-1)) +#endif + ); +#endif /* _POSIX_SOURCE */ + sig_act.sa_flags = 0; + sigaction(SIGHUP, &sig_act, (struct sigaction *)0); + sigaction(SIGINT, &sig_act, (struct sigaction *)0); + sigaction(SIGQUIT, &sig_act, (struct sigaction *)0); + sigaction(SIGILL, &sig_act, (struct sigaction *)0); +#ifdef SIGBUS + sigaction(SIGBUS, &sig_act, (struct sigaction *)0); +#endif + sigaction(SIGSEGV, &sig_act, (struct sigaction *)0); +#ifdef SIGSYS + sigaction(SIGSYS, &sig_act, (struct sigaction *)0); +#endif +#endif /* USGISH */ + + /* + * now peruse through the list of files. + */ + for(fp=filelist; *fp; fp++) { + DBG_PRINT(stderr,"file: %s\n",*fp); + filecontent = getfile(*fp); + setfile_cmdinc(filecontent, cmdinc_count, cmdinc_list); + ip = newinclude(*fp, (char *)NULL); + + find_includes(filecontent, ip, ip, 0, FALSE); + freefile(filecontent); + recursive_pr_include(ip, ip->i_file, base_name(*fp)); + inc_clean(); + } + if (printed) + printf("\n"); + return 0; +} + +#ifdef __UNIXOS2__ +/* + * eliminate \r chars from file + */ +static int +elim_cr(char *buf, int sz) +{ + int i,wp; + for (i= wp = 0; i<sz; i++) { + if (buf[i] != '\r') + buf[wp++] = buf[i]; + } + return wp; +} +#endif + +struct filepointer * +getfile(char *file) +{ + int fd; + struct filepointer *content; + struct stat st; + + content = (struct filepointer *)malloc(sizeof(struct filepointer)); + content->f_name = file; + if ((fd = open(file, O_RDONLY)) < 0) { + warning("cannot open \"%s\"\n", file); + content->f_p = content->f_base = content->f_end = (char *)malloc(1); + *content->f_p = '\0'; + return(content); + } + fstat(fd, &st); + content->f_base = (char *)malloc(st.st_size+1); + if (content->f_base == NULL) + fatalerr("cannot allocate mem\n"); + if ((st.st_size = read(fd, content->f_base, st.st_size)) < 0) + fatalerr("failed to read %s\n", file); +#ifdef __UNIXOS2__ + st.st_size = elim_cr(content->f_base,st.st_size); +#endif + close(fd); + content->f_len = st.st_size+1; + content->f_p = content->f_base; + content->f_end = content->f_base + st.st_size; + *content->f_end = '\0'; + content->f_line = 0; + content->cmdinc_count = 0; + content->cmdinc_list = NULL; + content->cmdinc_line = 0; + return(content); +} + +void +setfile_cmdinc(struct filepointer* filep, long count, char** list) +{ + filep->cmdinc_count = count; + filep->cmdinc_list = list; + filep->cmdinc_line = 0; +} + +void +freefile(struct filepointer *fp) +{ + free(fp->f_base); + free(fp); +} + +char *copy(char *str) +{ + char *p = (char *)malloc(strlen(str) + 1); + + strcpy(p, str); + return(p); +} + +int +match(char *str, char **list) +{ + int i; + + for (i=0; *list; i++, list++) + if (strcmp(str, *list) == 0) + return(i); + return(-1); +} + +/* + * Get the next line. We only return lines beginning with '#' since that + * is all this program is ever interested in. + */ +char *getnextline(struct filepointer *filep) +{ + char *p, /* walking pointer */ + *eof, /* end of file pointer */ + *bol; /* beginning of line pointer */ + int lineno; /* line number */ + boolean whitespace = FALSE; + + /* + * Fake the "-include" line files in form of #include to the + * start of each file. + */ + if (filep->cmdinc_line < filep->cmdinc_count) { + char *inc = filep->cmdinc_list[2 * filep->cmdinc_line + 0]; + char *buf = filep->cmdinc_list[2 * filep->cmdinc_line + 1]; + filep->cmdinc_line++; + sprintf(buf,"%s%s%s",DASH_INC_PRE,inc,DASH_INC_POST); + DBG_PRINT(stderr,"%s\n",buf); + return(buf); + } + + p = filep->f_p; + eof = filep->f_end; + if (p >= eof) + return((char *)NULL); + lineno = filep->f_line; + + for (bol = p--; ++p < eof; ) { + if ((bol == p) && ((*p == ' ') || (*p == '\t'))) + { + /* Consume leading white-spaces for this line */ + while (((p+1) < eof) && ((*p == ' ') || (*p == '\t'))) + { + p++; + bol++; + } + whitespace = TRUE; + } + + if (*p == '/' && (p+1) < eof && *(p+1) == '*') { + /* Consume C comments */ + *(p++) = ' '; + *(p++) = ' '; + while (p < eof && *p) { + if (*p == '*' && (p+1) < eof && *(p+1) == '/') { + *(p++) = ' '; + *(p++) = ' '; + break; + } + if (*p == '\n') + lineno++; + *(p++) = ' '; + } + --p; + } + else if (*p == '/' && (p+1) < eof && *(p+1) == '/') { + /* Consume C++ comments */ + *(p++) = ' '; + *(p++) = ' '; + while (p < eof && *p) { + if (*p == '\\' && (p+1) < eof && + *(p+1) == '\n') { + *(p++) = ' '; + lineno++; + } + else if (*p == '?' && (p+3) < eof && + *(p+1) == '?' && + *(p+2) == '/' && + *(p+3) == '\n') { + *(p++) = ' '; + *(p++) = ' '; + *(p++) = ' '; + lineno++; + } + else if (*p == '\n') + break; /* to process end of line */ + *(p++) = ' '; + } + --p; + } + else if (*p == '\\' && (p+1) < eof && *(p+1) == '\n') { + /* Consume backslash line terminations */ + *(p++) = ' '; + *p = ' '; + lineno++; + } + else if (*p == '?' && (p+3) < eof && + *(p+1) == '?' && *(p+2) == '/' && *(p+3) == '\n') { + /* Consume trigraph'ed backslash line terminations */ + *(p++) = ' '; + *(p++) = ' '; + *(p++) = ' '; + *p = ' '; + lineno++; + } + else if (*p == '\n') { + lineno++; + if (*bol == '#') { + char *cp; + + *(p++) = '\0'; + /* punt lines with just # (yacc generated) */ + for (cp = bol+1; + *cp && (*cp == ' ' || *cp == '\t'); cp++); + if (*cp) goto done; + --p; + } + bol = p+1; + whitespace = FALSE; + } + } + if (*bol != '#') + bol = NULL; +done: + if (bol && whitespace) { + warning("%s: non-portable whitespace encountered at line %d\n", + filep->f_name, lineno); + } + filep->f_p = p; + filep->f_line = lineno; +#ifdef DEBUG_DUMP + if (bol) + DBG_PRINT(stderr,"%s\n",bol); +#endif + return(bol); +} + +/* + * Strip the file name down to what we want to see in the Makefile. + * It will have objprefix and objsuffix around it. + */ +char *base_name(char *file) +{ + char *p; + + file = copy(file); + for(p=file+strlen(file); p>file && *p != '.'; p--) ; + + if (*p == '.') + *p = '\0'; + return(file); +} + +#if defined(USG) && !defined(CRAY) && !defined(SVR4) && !defined(__UNIXOS2__) && !defined(clipper) && !defined(__clipper__) +int rename (char *from, char *to) +{ + (void) unlink (to); + if (link (from, to) == 0) { + unlink (from); + return 0; + } else { + return -1; + } +} +#endif /* USGISH */ + +void +redirect(char *line, char *makefile) +{ + struct stat st; + FILE *fdin, *fdout; + char backup[ BUFSIZ ], + buf[ BUFSIZ ]; + boolean found = FALSE; + int len; + + /* + * if makefile is "-" then let it pour onto stdout. + */ + if (makefile && *makefile == '-' && *(makefile+1) == '\0') { + puts(line); + return; + } + + /* + * use a default makefile is not specified. + */ + if (!makefile) { + if (stat("Makefile", &st) == 0) + makefile = "Makefile"; + else if (stat("makefile", &st) == 0) + makefile = "makefile"; + else + fatalerr("[mM]akefile is not present\n"); + } + else + stat(makefile, &st); + if ((fdin = fopen(makefile, "r")) == NULL) + fatalerr("cannot open \"%s\"\n", makefile); + sprintf(backup, "%s.bak", makefile); + unlink(backup); +#if defined(WIN32) || defined(__UNIXOS2__) || defined(__CYGWIN__) + fclose(fdin); +#endif + if (rename(makefile, backup) < 0) + fatalerr("cannot rename %s to %s\n", makefile, backup); +#if defined(WIN32) || defined(__UNIXOS2__) || defined(__CYGWIN__) + if ((fdin = fopen(backup, "r")) == NULL) + fatalerr("cannot open \"%s\"\n", backup); +#endif + if ((fdout = freopen(makefile, "w", stdout)) == NULL) + fatalerr("cannot open \"%s\"\n", backup); + len = strlen(line); + while (!found && fgets(buf, BUFSIZ, fdin)) { + if (*buf == '#' && strncmp(line, buf, len) == 0) + found = TRUE; + fputs(buf, fdout); + } + if (!found) { + if (verbose) + warning("Adding new delimiting line \"%s\" and dependencies...\n", + line); + puts(line); /* same as fputs(fdout); but with newline */ + } else if (append) { + while (fgets(buf, BUFSIZ, fdin)) { + fputs(buf, fdout); + } + } + fflush(fdout); +#if defined(USGISH) || defined(_SEQUENT_) || defined(USE_CHMOD) + chmod(makefile, st.st_mode); +#else + fchmod(fileno(fdout), st.st_mode); +#endif /* USGISH */ +} + +void +fatalerr(char *msg, ...) +{ + va_list args; + fprintf(stderr, "%s: error: ", ProgramName); + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); + exit (1); +} + +void +warning(char *msg, ...) +{ + va_list args; + fprintf(stderr, "%s: warning: ", ProgramName); + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); +} + +void +warning1(char *msg, ...) +{ + va_list args; + va_start(args, msg); + vfprintf(stderr, msg, args); + va_end(args); +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/mkdepend.man b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/mkdepend.man new file mode 100644 index 0000000..595c87e --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/mkdepend.man @@ -0,0 +1,382 @@ +.\" $Xorg: mkdepend.man,v 1.5 2001/02/09 02:03:16 xorgcvs Exp $ +.\" Copyright (c) 1993, 1994, 1998 The Open Group +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included in +.\" all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +.\" THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +.\" SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall not +.\" be used in advertising or otherwise to promote the sale, use or other +.\" dealing in this Software without prior written authorization from The +.\" Open Group. +.\" +.\" $XFree86: xc/config/makedepend/mkdepend.man,v 1.7 2002/12/14 02:39:45 dawes Exp $ +.\" +.TH MAKEDEPEND 1 __xorgversion__ +.UC 4 +.SH NAME +makedepend \- create dependencies in makefiles +.SH SYNOPSIS +.B makedepend +[ +.BI \-D name\fB=\fPdef +] [ +.BI \-D name +] [ +.BI \-I includedir +] [ +.BI \-Y includedir +] [ +.B \-a +] [ +.BI \-f makefile +] [ +.BI \-include \ file +] [ +.BI \-o objsuffix +] [ +.BI \-p objprefix +] [ +.BI \-s string +] [ +.BI \-w width +] [ +.B \-v +] [ +.B \-m +] [ +\-\^\- +.I otheroptions +\-\^\- +] +.I sourcefile +\&.\|.\|. +.br +.SH DESCRIPTION +The +.B makedepend +program reads each +.I sourcefile +in sequence and parses it like a C-preprocessor, +processing all +.I #include, +.I #define, +.I #undef, +.I #ifdef, +.I #ifndef, +.I #endif, +.I #if, +.I #elif +and +.I #else +directives so that it can correctly tell which +.I #include, +directives would be used in a compilation. +Any +.I #include, +directives can reference files having other +.I #include +directives, and parsing will occur in these files as well. +.PP +Every file that a +.I sourcefile +includes, +directly or indirectly, +is what +.B makedepend +calls a \fIdependency.\fP +These dependencies are then written to a +.I makefile +in such a way that +.B make(1) +will know which object files must be recompiled when a dependency has changed. +.PP +By default, +.B makedepend +places its output in the file named +.I makefile +if it exists, otherwise +.I Makefile. +An alternate makefile may be specified with the +.B \-f +option. +It first searches the makefile for +the line +.sp +\& # DO NOT DELETE THIS LINE \-\^\- make depend depends on it. +.sp +or one provided with the +.B \-s +option, +as a delimiter for the dependency output. +If it finds it, it will delete everything +following this to the end of the makefile +and put the output after this line. +If it doesn't find it, the program +will append the string to the end of the makefile +and place the output following that. +For each +.I sourcefile +appearing on the command line, +.B makedepend +puts lines in the makefile of the form +.sp + sourcefile.o:\0dfile .\|.\|. +.sp +Where \fIsourcefile.o\fP is the name from the command +line with its suffix replaced with ``.o'', +and \fIdfile\fP is a dependency discovered in a +.I #include +directive while parsing +.I sourcefile +or one of the files it included. +.SH EXAMPLE +Normally, +.B makedepend +will be used in a makefile target so that typing ``make depend'' will +bring the dependencies up to date for the makefile. +For example, +.nf + SRCS\0=\0file1.c\0file2.c\0.\|.\|. + CFLAGS\0=\0\-O\0\-DHACK\0\-I\^.\^.\^/foobar\0\-xyz + depend: + makedepend\0\-\^\-\0$(CFLAGS)\0\-\^\-\0$(SRCS) +.fi +.SH OPTIONS +The program +will ignore any option that it does not understand so that you may use +the same arguments that you would for +.B cc(1). +.TP 5 +.B \-D\fIname\fP=\fIdef\fP \fRor\fP \-D\fIname\fP +Define. +This places a definition for +.I name +in +.B makedepend's +symbol table. +Without +.I =def\| +the symbol becomes defined as ``1''. +.TP 5 +.B \-I\fIincludedir\fP +Include directory. +This option tells +.B makedepend +to prepend +.I includedir +to its list of directories to search when it encounters +a +.I #include +directive. +By default, +.B makedepend +only searches the standard include directories (usually /usr/include +and possibly a compiler-dependent directory). +.TP 5 +.B \-Y\fIincludedir\fP +Replace all of the standard include directories with the single specified +include directory; you can omit the +.I includedir +to simply prevent searching the standard include directories. +.TP 5 +.B \-a +Append the dependencies to the end of the file instead of replacing them. +.TP 5 +.B \-f\fImakefile\fP +Filename. +This allows you to specify an alternate makefile in which +.B makedepend +can place its output. +Specifying ``\-'' as the file name (i.e., \fB\-f\-\fP) sends the +output to standard output instead of modifying an existing file. +.TP 5 +.B \-include \fIfile\fP +Process file as input, and include all the resulting output +before processing the regular input file. This has the same +affect as if the specified file is an include statement that +appears before the very first line of the regular input file. +.TP 5 +.B \-o\fIobjsuffix\fP +Object file suffix. +Some systems may have object files whose suffix is something other +than ``.o''. +This option allows you to specify another suffix, such as +``.b'' with +.I \-o.b +or ``:obj'' +with +.I \-o:obj +and so forth. +.TP 5 +.B \-p\fIobjprefix\fP +Object file prefix. +The prefix is prepended to the name of the object file. This is +usually used to designate a different directory for the object file. +The default is the empty string. +.TP 5 +.B \-s\fIstring\fP +Starting string delimiter. +This option permits you to specify +a different string for +.B makedepend +to look for in the makefile. +.TP 5 +.B \-w\fIwidth\fP +Line width. +Normally, +.B makedepend +will ensure that every output line that it writes will be no wider than +78 characters for the sake of readability. +This option enables you to change this width. +.TP 5 +.B \-v +Verbose operation. +This option causes +.B makedepend +to emit the list of files included by each input file. +.TP 5 +.B \-m +Warn about multiple inclusion. +This option causes +.B makedepend +to produce a warning if any input file includes another file more than +once. In previous versions of +.B makedepend +this was the default behavior; the default has been changed to better +match the behavior of the C compiler, which does not consider multiple +inclusion to be an error. This option is provided for backward +compatibility, and to aid in debugging problems related to multiple +inclusion. +.TP 5 +.B "\-\^\- \fIoptions\fP \-\^\-" +If +.B makedepend +encounters a double hyphen (\-\^\-) in the argument list, +then any unrecognized argument following it +will be silently ignored; a second double hyphen terminates this +special treatment. +In this way, +.B makedepend +can be made to safely ignore esoteric compiler arguments that might +normally be found in a CFLAGS +.B make +macro (see the +.B EXAMPLE +section above). +All options that +.B makedepend +recognizes and appear between the pair of double hyphens +are processed normally. +.SH ALGORITHM +The approach used in this program enables it to run an order of magnitude +faster than any other ``dependency generator'' I have ever seen. +Central to this performance are two assumptions: +that all files compiled by a single +makefile will be compiled with roughly the same +.I \-I +and +.I \-D +options; +and that most files in a single directory will include largely the +same files. +.PP +Given these assumptions, +.B makedepend +expects to be called once for each makefile, with +all source files that are maintained by the +makefile appearing on the command line. +It parses each source and include +file exactly once, maintaining an internal symbol table +for each. +Thus, the first file on the command line will take an amount of time +proportional to the amount of time that a normal C preprocessor takes. +But on subsequent files, if it encounters an include file +that it has already parsed, it does not parse it again. +.PP +For example, +imagine you are compiling two files, +.I file1.c +and +.I file2.c, +they each include the header file +.I header.h, +and the file +.I header.h +in turn includes the files +.I def1.h +and +.I def2.h. +When you run the command +.sp + makedepend\0file1.c\0file2.c +.sp +.B makedepend +will parse +.I file1.c +and consequently, +.I header.h +and then +.I def1.h +and +.I def2.h. +It then decides that the dependencies for this file are +.sp + file1.o:\0header.h\0def1.h\0def2.h +.sp +But when the program parses +.I file2.c +and discovers that it, too, includes +.I header.h, +it does not parse the file, +but simply adds +.I header.h, +.I def1.h +and +.I def2.h +to the list of dependencies for +.I file2.o. +.SH "SEE ALSO" +cc(1), make(1) +.SH BUGS +.B makedepend +parses, but does not currently evaluate, the SVR4 #predicate(token-list) +preprocessor expression; such expressions are simply assumed to be true. +This may cause the wrong +.I #include +directives to be evaluated. +.PP +Imagine you are parsing two files, +say +.I file1.c +and +.I file2.c, +each includes the file +.I def.h. +The list of files that +.I def.h +includes might truly be different when +.I def.h +is included by +.I file1.c +than when it is included by +.I file2.c. +But once +.B makedepend +arrives at a list of dependencies for a file, +it is cast in concrete. +.SH AUTHOR +Todd Brunhoff, Tektronix, Inc. and MIT Project Athena diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/parse.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/parse.c new file mode 100644 index 0000000..968d2c4 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/parse.c @@ -0,0 +1,686 @@ +/* $Xorg: parse.c,v 1.6 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/parse.c,v 1.12 2002/02/26 05:09:10 tsi Exp $ */ + +#include "def.h" + +extern char *directives[]; +extern struct inclist inclist[ MAXFILES ], + *inclistnext, + maininclist; +extern char *includedirs[ ], + **includedirsnext; + +static int deftype (char *line, struct filepointer *filep, + struct inclist *file_red, struct inclist *file, + int parse_it); +static int zero_value(char *filename, char *exp, struct filepointer *filep, + struct inclist *file_red); +static int merge2defines(struct inclist *file1, struct inclist *file2); + +static int +gobble(struct filepointer *filep, struct inclist *file, + struct inclist *file_red) +{ + char *line; + int type; + + while ((line = getnextline(filep))) { + switch(type = deftype(line, filep, file_red, file, FALSE)) { + case IF: + case IFFALSE: + case IFGUESSFALSE: + case IFDEF: + case IFNDEF: + type = gobble(filep, file, file_red); + while ((type == ELIF) || (type == ELIFFALSE) || + (type == ELIFGUESSFALSE)) + type = gobble(filep, file, file_red); + if (type == ELSE) + (void)gobble(filep, file, file_red); + break; + case ELSE: + case ENDIF: + debug(0,("%s, line %d: #%s\n", + file->i_file, filep->f_line, + directives[type])); + return(type); + case DEFINE: + case UNDEF: + case INCLUDE: + case INCLUDEDOT: + case PRAGMA: + case ERROR: + case IDENT: + case SCCS: + case EJECT: + case WARNING: + case INCLUDENEXT: + case INCLUDENEXTDOT: + break; + case ELIF: + case ELIFFALSE: + case ELIFGUESSFALSE: + return(type); + case -1: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: unknown directive == \"%s\"\n", + filep->f_line, line); + break; + } + } + return(-1); +} + +/* + * Decide what type of # directive this line is. + */ +static int +deftype (char *line, struct filepointer *filep, + struct inclist *file_red, struct inclist *file, int parse_it) +{ + register char *p; + char *directive, savechar, *q; + register int ret; + + /* + * Parse the directive... + */ + directive=line+1; + while (*directive == ' ' || *directive == '\t') + directive++; + + p = directive; + while ((*p == '_') || (*p >= 'a' && *p <= 'z')) + p++; + savechar = *p; + *p = '\0'; + ret = match(directive, directives); + *p = savechar; + + /* If we don't recognize this compiler directive or we happen to just + * be gobbling up text while waiting for an #endif or #elif or #else + * in the case of an #elif we must check the zero_value and return an + * ELIF or an ELIFFALSE. + */ + + if (ret == ELIF && !parse_it) + { + while (*p == ' ' || *p == '\t') + p++; + /* + * parse an expression. + */ + debug(0,("%s, line %d: #elif %s ", + file->i_file, filep->f_line, p)); + ret = zero_value(file->i_file, p, filep, file_red); + if (ret != IF) + { + debug(0,("false...\n")); + if (ret == IFFALSE) + return(ELIFFALSE); + else + return(ELIFGUESSFALSE); + } + else + { + debug(0,("true...\n")); + return(ELIF); + } + } + + if (ret < 0 || ! parse_it) + return(ret); + + /* + * now decide how to parse the directive, and do it. + */ + while (*p == ' ' || *p == '\t') + p++; + q = p + strlen(p); + do { + q--; + } while (*q == ' ' || *q == '\t'); + q[1] = '\0'; + switch (ret) { + case IF: + /* + * parse an expression. + */ + ret = zero_value(file->i_file, p, filep, file_red); + debug(0,("%s, line %d: %s #if %s\n", + file->i_file, filep->f_line, ret?"false":"true", p)); + break; + case IFDEF: + case IFNDEF: + debug(0,("%s, line %d: #%s %s\n", + file->i_file, filep->f_line, directives[ret], p)); + case UNDEF: + /* + * separate the name of a single symbol. + */ + while (isalnum(*p) || *p == '_') + *line++ = *p++; + *line = '\0'; + break; + case INCLUDE: + case INCLUDENEXT: + debug(2,("%s, line %d: #include%s %s\n", + file->i_file, filep->f_line, + (ret == INCLUDE) ? "" : "_next", p)); + + /* Support ANSI macro substitution */ + while (1) { + struct symtab **sym; + + if (!*p || *p == '"' || *p == '<') + break; + + sym = isdefined(p, file_red, NULL); + if (!sym) + break; + + p = (*sym)->s_value; + debug(3,("%s : #includes SYMBOL %s = %s\n", + file->i_incstring, + (*sym) -> s_name, + (*sym) -> s_value)); + /* mark file as having included a 'soft include' */ + file->i_flags |= INCLUDED_SYM; + } + + /* + * Separate the name of the include file. + */ + while (*p && *p != '"' && *p != '<') + p++; + if (! *p) + return(-2); + if (*p++ == '"') { + if (ret == INCLUDE) + ret = INCLUDEDOT; + else + ret = INCLUDENEXTDOT; + while (*p && *p != '"') + *line++ = *p++; + } else + while (*p && *p != '>') + *line++ = *p++; + *line = '\0'; + break; + case DEFINE: + /* + * copy the definition back to the beginning of the line. + */ + strcpy (line, p); + break; + case ELSE: + case ENDIF: + case ELIF: + case PRAGMA: + case ERROR: + case IDENT: + case SCCS: + case EJECT: + case WARNING: + debug(0,("%s, line %d: #%s\n", + file->i_file, filep->f_line, directives[ret])); + /* + * nothing to do. + */ + break; + } + return(ret); +} + +struct symtab ** +fdefined(char *symbol, struct inclist *file, struct inclist **srcfile) +{ + struct inclist **ip; + struct symtab **val; + int i; + static int recurse_lvl = 0; + + if (file->i_flags & DEFCHECKED) + return(NULL); + debug(2,("Looking for %s in %s\n", symbol, file->i_file)); + file->i_flags |= DEFCHECKED; + if ((val = slookup(symbol, file))) + debug(1,("%s defined in %s as %s\n", + symbol, file->i_file, (*val)->s_value)); + if (val == NULL && file->i_list) + { + for (ip = file->i_list, i=0; i < file->i_listlen; i++, ip++) + if (file->i_merged[i]==FALSE) { + val = fdefined(symbol, *ip, srcfile); + file->i_merged[i]=merge2defines(file,*ip); + if (val!=NULL) break; + } + } + else if (val != NULL && srcfile != NULL) *srcfile = file; + recurse_lvl--; + file->i_flags &= ~DEFCHECKED; + + return(val); +} + +struct symtab ** +isdefined(char *symbol, struct inclist *file, struct inclist **srcfile) +{ + struct symtab **val; + + if ((val = slookup(symbol, &maininclist))) { + debug(1,("%s defined on command line\n", symbol)); + if (srcfile != NULL) *srcfile = &maininclist; + return(val); + } + if ((val = fdefined(symbol, file, srcfile))) + return(val); + debug(1,("%s not defined in %s\n", symbol, file->i_file)); + return(NULL); +} + +/* + * Return type based on if the #if expression evaluates to 0 + */ +static int +zero_value(char *filename, + char *exp, + struct filepointer *filep, + struct inclist *file_red) +{ + if (cppsetup(filename, exp, filep, file_red)) + return(IFFALSE); + else + return(IF); +} + +void +define2(char *name, char *val, struct inclist *file) +{ + int first, last, below; + register struct symtab **sp = NULL, **dest; + struct symtab *stab; + + /* Make space if it's needed */ + if (file->i_defs == NULL) + { + file->i_defs = (struct symtab **) + malloc(sizeof (struct symtab*) * SYMTABINC); + file->i_ndefs = 0; + } + else if (!(file->i_ndefs % SYMTABINC)) + file->i_defs = (struct symtab **) + realloc(file->i_defs, + sizeof(struct symtab*)*(file->i_ndefs+SYMTABINC)); + + if (file->i_defs == NULL) + fatalerr("malloc()/realloc() failure in insert_defn()\n"); + + below = first = 0; + last = file->i_ndefs - 1; + while (last >= first) + { + /* Fast inline binary search */ + register char *s1; + register char *s2; + register int middle = (first + last) / 2; + + /* Fast inline strchr() */ + s1 = name; + s2 = file->i_defs[middle]->s_name; + while (*s1++ == *s2++) + if (s2[-1] == '\0') break; + + /* If exact match, set sp and break */ + if (*--s1 == *--s2) + { + sp = file->i_defs + middle; + break; + } + + /* If name > i_defs[middle] ... */ + if (*s1 > *s2) + { + below = first; + first = middle + 1; + } + /* else ... */ + else + { + below = last = middle - 1; + } + } + + /* Search is done. If we found an exact match to the symbol name, + just replace its s_value */ + if (sp != NULL) + { + debug(1,("redefining %s from %s to %s in file %s\n", + name, (*sp)->s_value, val, file->i_file)); + free((*sp)->s_value); + (*sp)->s_value = copy(val); + return; + } + + sp = file->i_defs + file->i_ndefs++; + dest = file->i_defs + below + 1; + while (sp > dest) + { + *sp = sp[-1]; + sp--; + } + stab = (struct symtab *) malloc(sizeof (struct symtab)); + if (stab == NULL) + fatalerr("malloc()/realloc() failure in insert_defn()\n"); + + debug(1,("defining %s to %s in file %s\n", name, val, file->i_file)); + stab->s_name = copy(name); + stab->s_value = copy(val); + *sp = stab; +} + +void +define(char *def, struct inclist *file) +{ + char *val; + + /* Separate symbol name and its value */ + val = def; + while (isalnum(*val) || *val == '_') + val++; + if (*val) + *val++ = '\0'; + while (*val == ' ' || *val == '\t') + val++; + + if (!*val) + val = "1"; + define2(def, val, file); +} + +struct symtab ** +slookup(char *symbol, struct inclist *file) +{ + register int first = 0; + register int last = file->i_ndefs - 1; + + if (file) while (last >= first) + { + /* Fast inline binary search */ + register char *s1; + register char *s2; + register int middle = (first + last) / 2; + + /* Fast inline strchr() */ + s1 = symbol; + s2 = file->i_defs[middle]->s_name; + while (*s1++ == *s2++) + if (s2[-1] == '\0') break; + + /* If exact match, we're done */ + if (*--s1 == *--s2) + { + return file->i_defs + middle; + } + + /* If symbol > i_defs[middle] ... */ + if (*s1 > *s2) + { + first = middle + 1; + } + /* else ... */ + else + { + last = middle - 1; + } + } + return(NULL); +} + +static int +merge2defines(struct inclist *file1, struct inclist *file2) +{ + int i; + + if ((file1==NULL) || (file2==NULL) || + !(file2->i_flags & FINISHED)) + return 0; + + for (i=0; i < file2->i_listlen; i++) + if (file2->i_merged[i]==FALSE) + return 0; + + { + int first1 = 0; + int last1 = file1->i_ndefs - 1; + + int first2 = 0; + int last2 = file2->i_ndefs - 1; + + int first=0; + struct symtab** i_defs = NULL; + int deflen=file1->i_ndefs+file2->i_ndefs; + + debug(2,("merging %s into %s\n", + file2->i_file, file1->i_file)); + + if (deflen>0) + { + /* make sure deflen % SYMTABINC == 0 is still true */ + deflen += (SYMTABINC - deflen % SYMTABINC) % SYMTABINC; + i_defs=(struct symtab**) + malloc(deflen*sizeof(struct symtab*)); + if (i_defs==NULL) return 0; + } + + while ((last1 >= first1) && (last2 >= first2)) + { + char *s1=file1->i_defs[first1]->s_name; + char *s2=file2->i_defs[first2]->s_name; + + if (strcmp(s1,s2) < 0) + i_defs[first++]=file1->i_defs[first1++]; + else if (strcmp(s1,s2) > 0) + i_defs[first++]=file2->i_defs[first2++]; + else /* equal */ + { + i_defs[first++]=file2->i_defs[first2++]; + first1++; + } + } + while (last1 >= first1) + { + i_defs[first++]=file1->i_defs[first1++]; + } + while (last2 >= first2) + { + i_defs[first++]=file2->i_defs[first2++]; + } + + if (file1->i_defs) free(file1->i_defs); + file1->i_defs=i_defs; + file1->i_ndefs=first; + + return 1; + } +} + +void +undefine(char *symbol, struct inclist *file) +{ + register struct symtab **ptr; + struct inclist *srcfile; + while ((ptr = isdefined(symbol, file, &srcfile)) != NULL) + { + srcfile->i_ndefs--; + for (; ptr < srcfile->i_defs + srcfile->i_ndefs; ptr++) + *ptr = ptr[1]; + } +} + +int +find_includes(struct filepointer *filep, struct inclist *file, + struct inclist *file_red, int recursion, boolean failOK) +{ + struct inclist *inclistp; + char **includedirsp; + register char *line; + register int type; + boolean recfailOK; + + while ((line = getnextline(filep))) { + switch(type = deftype(line, filep, file_red, file, TRUE)) { + case IF: + doif: + type = find_includes(filep, file, + file_red, recursion+1, failOK); + while ((type == ELIF) || (type == ELIFFALSE) || + (type == ELIFGUESSFALSE)) + type = gobble(filep, file, file_red); + if (type == ELSE) + gobble(filep, file, file_red); + break; + case IFFALSE: + case IFGUESSFALSE: + doiffalse: + if (type == IFGUESSFALSE || type == ELIFGUESSFALSE) + recfailOK = TRUE; + else + recfailOK = failOK; + type = gobble(filep, file, file_red); + if (type == ELSE) + find_includes(filep, file, + file_red, recursion+1, recfailOK); + else + if (type == ELIF) + goto doif; + else + if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE)) + goto doiffalse; + break; + case IFDEF: + case IFNDEF: + if ((type == IFDEF && isdefined(line, file_red, NULL)) + || (type == IFNDEF && !isdefined(line, file_red, NULL))) { + debug(1,(type == IFNDEF ? + "line %d: %s !def'd in %s via %s%s\n" : "", + filep->f_line, line, + file->i_file, file_red->i_file, ": doit")); + type = find_includes(filep, file, + file_red, recursion+1, failOK); + while (type == ELIF || type == ELIFFALSE || type == ELIFGUESSFALSE) + type = gobble(filep, file, file_red); + if (type == ELSE) + gobble(filep, file, file_red); + } + else { + debug(1,(type == IFDEF ? + "line %d: %s !def'd in %s via %s%s\n" : "", + filep->f_line, line, + file->i_file, file_red->i_file, ": gobble")); + type = gobble(filep, file, file_red); + if (type == ELSE) + find_includes(filep, file, + file_red, recursion+1, failOK); + else if (type == ELIF) + goto doif; + else if (type == ELIFFALSE || type == ELIFGUESSFALSE) + goto doiffalse; + } + break; + case ELSE: + case ELIFFALSE: + case ELIFGUESSFALSE: + case ELIF: + if (!recursion) + gobble(filep, file, file_red); + case ENDIF: + if (recursion) + return(type); + case DEFINE: + define(line, file); + break; + case UNDEF: + if (!*line) { + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: incomplete undef == \"%s\"\n", + filep->f_line, line); + break; + } + undefine(line, file_red); + break; + case INCLUDE: + case INCLUDEDOT: + case INCLUDENEXT: + case INCLUDENEXTDOT: + inclistp = inclistnext; + includedirsp = includedirsnext; + debug(2,("%s, reading %s, includes %s\n", + file_red->i_file, file->i_file, line)); + add_include(filep, file, file_red, line, type, failOK); + inclistnext = inclistp; + includedirsnext = includedirsp; + break; + case ERROR: + case WARNING: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: %s\n", + filep->f_line, line); + break; + + case PRAGMA: + case IDENT: + case SCCS: + case EJECT: + break; + case -1: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: unknown directive == \"%s\"\n", + filep->f_line, line); + break; + case -2: + warning("%s", file_red->i_file); + if (file_red != file) + warning1(" (reading %s)", file->i_file); + warning1(", line %d: incomplete include == \"%s\"\n", + filep->f_line, line); + break; + } + } + file->i_flags |= FINISHED; + debug(2,("finished with %s\n", file->i_file)); + return(-1); +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/pr.c b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/pr.c new file mode 100644 index 0000000..e864793 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/mkdepend/pr.c @@ -0,0 +1,124 @@ +/* $Xorg: pr.c,v 1.4 2001/02/09 02:03:16 xorgcvs Exp $ */ +/* + +Copyright (c) 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* $XFree86: xc/config/makedepend/pr.c,v 1.5 2001/12/14 19:53:21 dawes Exp $ */ + +#include "def.h" + +extern struct inclist inclist[ MAXFILES ], + *inclistp; +extern char *objprefix; +extern char *objsuffix; +extern int width; +extern boolean printed; +extern boolean verbose; +extern boolean show_where_not; + +void +add_include(struct filepointer *filep, struct inclist *file, + struct inclist *file_red, char *include, int type, + boolean failOK) +{ + register struct inclist *newfile; + register struct filepointer *content; + + /* + * First decide what the pathname of this include file really is. + */ + newfile = inc_path(file->i_file, include, type); + if (newfile == NULL) { + if (failOK) + return; + if (file != file_red) + warning("%s (reading %s, line %d): ", + file_red->i_file, file->i_file, filep->f_line); + else + warning("%s, line %d: ", file->i_file, filep->f_line); + warning1("cannot find include file \"%s\"\n", include); + show_where_not = TRUE; + newfile = inc_path(file->i_file, include, type); + show_where_not = FALSE; + } + + if (newfile) { + included_by(file, newfile); + if (!(newfile->i_flags & SEARCHED)) { + newfile->i_flags |= SEARCHED; + content = getfile(newfile->i_file); + find_includes(content, newfile, file_red, 0, failOK); + freefile(content); + } + } +} + +static void +pr(struct inclist *ip, char *file, char *base) +{ + static char *lastfile; + static int current_len; + register int len, i; + char buf[ BUFSIZ ]; + + printed = TRUE; + len = strlen(ip->i_file)+1; + if (current_len + len > width || file != lastfile) { + lastfile = file; + sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix, + ip->i_file); + len = current_len = strlen(buf); + } + else { + buf[0] = ' '; + strcpy(buf+1, ip->i_file); + current_len += len; + } + fwrite(buf, len, 1, stdout); + + /* + * If verbose is set, then print out what this file includes. + */ + if (! verbose || ip->i_list == NULL || ip->i_flags & NOTIFIED) + return; + ip->i_flags |= NOTIFIED; + lastfile = NULL; + printf("\n# %s includes:", ip->i_file); + for (i=0; i<ip->i_listlen; i++) + printf("\n#\t%s", ip->i_list[ i ]->i_incstring); +} + +void +recursive_pr_include(struct inclist *head, char *file, char *base) +{ + int i; + + if (head->i_flags & MARKED) + return; + head->i_flags |= MARKED; + if (head->i_file != file) + pr(head, file, base); + for (i=0; i<head->i_listlen; i++) + recursive_pr_include(head->i_list[ i ], file, base); +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/nfspwd.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/nfspwd.pl new file mode 100644 index 0000000..2f0e4fb --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.c b/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.c new file mode 100644 index 0000000..b6ca0e3 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.c @@ -0,0 +1,481 @@ +/* -*- 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 mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of 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 <stdio.h> /* OSF/1 requires this before grp.h, so put it first */ +#include <assert.h> +#include <fcntl.h> +#include <errno.h> +#include <dirent.h> +#include <limits.h> +#include <grp.h> +#include <pwd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <utime.h> +#include <sys/types.h> +#include <sys/stat.h> +#include "pathsub.h" + +#ifdef HAVE_GETOPT_H +#include <getopt.h> +#endif + +#ifdef SUNOS4 +#include "sunos4.h" +#endif + +#ifdef NEXTSTEP +#include <bsd/libc.h> +#endif + +#ifdef __QNX__ +#include <unix.h> +#endif + +#ifdef NEED_S_ISLNK +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(a) (((a) & S_IFMT) == S_IFLNK) +#endif +#endif + +#ifndef _DIRECTORY_SEPARATOR +#define _DIRECTORY_SEPARATOR "/" +#endif /* _DIRECTORY_SEPARATOR */ + +#ifdef NEED_FCHMOD_PROTO +extern int fchmod(int fildes, mode_t mode); +#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; + int l; + + /* strip trailing "/." */ + l = strlen(path); + if(l > 1 && path[l - 1] == '.' && path[l - 2] == '/') + path[l - 2] = 0; + + while (*path == '/' && path[1] == '/') + path++; + for (cp = strrchr(path, '/'); cp && cp != path && *(cp - 1) == '/'; cp--); + if (cp && cp != path) { + *cp = '\0'; + if ((lstat(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; +} + +static void +copyfile( char *name, char *toname, mode_t mode, char *group, char *owner, + int dotimes, uid_t uid, gid_t gid ) +{ + int fromfd, tofd = -1, cc, wc, exists; + char buf[BUFSIZ], *bp; + struct stat sb, tosb; + struct utimbuf utb; + + exists = (lstat(toname, &tosb) == 0); + + fromfd = open(name, O_RDONLY); + if (fromfd < 0 || fstat(fromfd, &sb) < 0) + fail("cannot access %s", name); + if (exists) { + if (S_ISREG(tosb.st_mode)) { + /* See if we can open it. This is more reliable than 'access'. */ + tofd = open(toname, O_CREAT | O_WRONLY, 0666); + } + if (tofd < 0) { + (void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname); + } + } + if (tofd < 0) { + 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, (unsigned int)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); +#if !defined(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); +#if defined(VMS) + if (chmod(toname, (mode & (S_IREAD | S_IWRITE))) < 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 +} + +static void +copydir( char *from, char *to, mode_t mode, char *group, char *owner, + int dotimes, uid_t uid, gid_t gid) +{ + int i; + DIR *dir; + struct dirent *ep; + struct stat sb; + char *base, *destdir, *direntry, *destentry; + + base = xbasename(from); + + /* create destination directory */ + destdir = xmalloc((unsigned int)(strlen(to) + 1 + strlen(base) + 1)); + sprintf(destdir, "%s%s%s", to, _DIRECTORY_SEPARATOR, base); + if (mkdirs(destdir, mode) != 0) { + fail("cannot make directory %s\n", destdir); + return; + } + + dir = opendir(from); + + direntry = xmalloc((unsigned int)PATH_MAX); + destentry = xmalloc((unsigned int)PATH_MAX); + + while ((ep = readdir(dir))) + { + if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) + continue; + + sprintf(direntry, "%s/%s", from, ep->d_name); + sprintf(destentry, "%s%s%s", destdir, _DIRECTORY_SEPARATOR, ep->d_name); + + if (stat(direntry, &sb) == 0 && S_ISDIR(sb.st_mode)) + copydir( direntry, destdir, mode, group, owner, dotimes, uid, gid ); + else + copyfile( direntry, destentry, mode, group, owner, dotimes, uid, gid ); + } + + free(direntry); + free(destentry); + closedir(dir); +} + +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, fromsb; + 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) { +#ifndef NEEDS_GETCWD +#ifndef GETCWD_CANT_MALLOC + cwd = getcwd(0, PATH_MAX); +#else + cwd = malloc(PATH_MAX + 1); + cwd = getcwd(cwd, PATH_MAX); +#endif +#else + cwd = malloc(PATH_MAX + 1); + cwd = getwd(cwd); +#endif + } + + xchdir(todir); +#ifndef NEEDS_GETCWD +#ifndef GETCWD_CANT_MALLOC + todir = getcwd(0, PATH_MAX); +#else + todir = malloc(PATH_MAX + 1); + todir = getcwd(todir, PATH_MAX); +#endif +#else + todir = malloc(PATH_MAX + 1); + todir = getwd(todir); +#endif + tdlen = strlen(todir); + xchdir(cwd); + tdlen = strlen(todir); + + uid = owner ? touid(owner) : (uid_t)(-1); + gid = group ? togid(group) : (gid_t)(-1); + + while (--argc > 0) { + name = *argv++; + len = strlen(name); + base = xbasename(name); + bnlen = strlen(base); + toname = xmalloc((unsigned int)(tdlen + 1 + bnlen + 1)); + sprintf(toname, "%s%s%s", todir, _DIRECTORY_SEPARATOR, 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 (access(name, R_OK) != 0) { + fail("cannot access %s", name); + } + 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 = xmalloc((unsigned int)(len + 1)); + sprintf(linkname, "%s/%s", linkprefix, name); + } else if (dorelsymlink) { + /* Symlink the relative path from todir to source name. */ + linkname = 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, (unsigned int)len) != 0)) || + ((stat(name, &fromsb) == 0) && + (fromsb.st_mtime > tosb.st_mtime))) { + (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. */ + if( stat(name, &sb) == 0 && S_IFDIR & sb.st_mode ) + { + /* then is directory: must explicitly create destination dir */ + /* and manually copy files over */ + copydir( name, todir, mode, group, owner, dotimes, uid, gid ); + } + else + { + copyfile(name, toname, mode, group, owner, dotimes, uid, gid); + } + } + + free(toname); + } + + free(cwd); + free(todir); + return 0; +} diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.py b/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.py new file mode 100644 index 0000000..fd4e253 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/nsinstall.py @@ -0,0 +1,139 @@ +# ***** 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 Mozilla. +# +# The Initial Developer of the Original Code is +# the Mozilla Foundation. +# Portions created by the Initial Developer are Copyright (C) 2007 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Axel Hecht <axel@pike.org> +# +# 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 ***** + +# This is a partial python port of nsinstall. +# It's intended to be used when there's no natively compile nsinstall +# available, and doesn't intend to be fully equivalent. +# Its major use is for l10n repackaging on systems that don't have +# a full build environment set up. +# The basic limitation is, it doesn't even try to link and ignores +# all related options. + +from optparse import OptionParser +import os +import os.path +import sys +import shutil + +usage = "usage: %prog [options] arg1 [arg2 ...] target-directory" +p = OptionParser(usage=usage) + +p.add_option('-D', action="store_true", + help="Create a single directory only") +p.add_option('-t', action="store_true", + help="Preserve time stamp") +p.add_option('-m', action="store", + help="Set mode", metavar="mode") +p.add_option('-d', action="store_true", + help="Create directories in target") +p.add_option('-R', action="store_true", + help="Use relative symbolic links (ignored)") +p.add_option('-l', action="store_true", + help="Create link (ignored)") +p.add_option('-L', action="store", metavar="linkprefix", + help="Link prefix (ignored)") + +# The remaining arguments are not used in our tree, thus they're not +# implented. +def BadArg(option, opt, value, parser): + parser.error('option not supported: %s' % opt) + +p.add_option('-C', action="callback", metavar="CWD", + callback=BadArg, + help="NOT SUPPORTED") +p.add_option('-o', action="callback", callback=BadArg, + help="Set owner (NOT SUPPORTED)", metavar="owner") +p.add_option('-g', action="callback", callback=BadArg, + help="Set group (NOT SUPPORTED)", metavar="group") + +(options, args) = p.parse_args() + +if options.m: + # mode is specified + try: + options.m = int(options.m, 8) + except: + sys.stderr.write('nsinstall: ' + options.m + ' is not a valid mode\n') + sys.exit(1) + +# just create one directory? +if options.D: + if len(args) != 1: + sys.exit(1) + if os.path.exists(args[0]): + if not os.path.isdir(args[0]): + sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n') + sys.exit(1) + if options.m: + os.chmod(args[0], options.m) + sys.exit() + if options.m: + os.makedirs(args[0], options.m) + else: + os.makedirs(args[0]) + sys.exit() + +# nsinstall arg1 [...] directory +if len(args) < 2: + p.error('not enough arguments') + +# set up handler +if options.d: + # we're supposed to create directories + def handleTarget(srcpath, targetpath): + # target directory was already created, just use mkdir + os.mkdir(dest) +else: + # we're supposed to copy files + def handleTarget(srcpath, targetpath): + if options.t: + shutil.copy2(srcpath, targetpath) + else: + shutil.copy(srcpath, targetpath) + +# the last argument is the target directory +target = args.pop() +# ensure target directory +if not os.path.isdir(target): + os.makedirs(target) + +for f in args: + dest = os.path.join(target, + os.path.basename(os.path.normpath(f))) + handleTarget(f, dest) + if options.m: + os.chmod(dest, options.m) diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.c b/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.c new file mode 100644 index 0000000..8384e5f --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.c @@ -0,0 +1,247 @@ +/* -*- 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 mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of 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 ***** */ +/* +** Pathname subroutines. +** +** Brendan Eich, 8/29/95 +*/ +#include <assert.h> +#include <sys/types.h> +#include <dirent.h> +#include <errno.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <sys/stat.h> +#include "pathsub.h" + +#ifdef USE_REENTRANT_LIBC +#include <libc_r.h> +#endif + +#ifdef SUNOS4 +#include "sunos4.h" +#endif + +#ifndef D_INO +#define D_INO d_ino +#endif + +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 LAME_READDIR +#include <sys/param.h> +/* +** The static buffer in Unixware's readdir is too small. +*/ +struct dirent *readdir(DIR *d) +{ + static struct dirent *buf = NULL; + + if(buf == NULL) + buf = (struct dirent *) malloc(sizeof(struct dirent) + MAXPATHLEN); + 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(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/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.h b/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.h new file mode 100644 index 0000000..ab1a7fe --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/pathsub.h @@ -0,0 +1,74 @@ +/* -*- 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 mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either of 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 <limits.h> +#include <sys/types.h> + +#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/tools/node_modules/expresso/deps/jscoverage/js/config/preprocessor.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/preprocessor.pl new file mode 100644 index 0000000..3da6654 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/preprocessor.pl @@ -0,0 +1,671 @@ +#!/usr/bin/perl -w +# -*- Mode: perl; tab-width: 4; indent-tabs-mode: nil; -*- +# +# Preprocessor +# Version 1.1 +# +# Copyright (c) 2002, 2003, 2004 by Ian Hickson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Thanks to bryner and bsmedberg for suggestions. +# Thanks to jon rekai for a patch to not require File::Spec 0.8. + +use strict; + +# takes as arguments the files to process +# defaults to stdin +# output to stdout + +my $stack = new stack; +my $marker = '#'; + +# command line arguments +my @includes; +while ($_ = $ARGV[0], defined($_) && /^-./) { + shift; + last if /^--$/os; + if (/^-D(.*)$/os) { + for ($1) { + if (/^([\w\.]+)=(.*)$/os) { + $stack->define($1, $2); + } elsif (/^([\w\.]+)$/os) { + $stack->define($1, 1); + } else { + die "$0: invalid argument to -D: $_\n"; + } + } + } elsif (/^-F(.*)$/os) { + for ($1) { + if (/^(\w+)$/os) { + $stack->filter($1, 1); + } else { + die "$0: invalid argument to -F: $_\n"; + } + } + } elsif (/^-I(.*)$/os) { + push(@includes, $1); + } elsif (/^-E$/os) { + foreach (keys %ENV) { + # define all variables that have valid names + $stack->define($_, $ENV{$_}) unless m/\W/; + } + } elsif (/^-d$/os) { + $stack->{'dependencies'} = 1; + } elsif (/^--line-endings=crlf$/os) { + $stack->{'lineEndings'} = "\x0D\x0A"; + } elsif (/^--line-endings=cr$/os) { + $stack->{'lineEndings'} = "\x0D"; + } elsif (/^--line-endings=lf$/os) { + $stack->{'lineEndings'} = "\x0A"; + } elsif (/^--line-endings=(.+)$/os) { + die "$0: unrecognised line ending: $1\n"; + } elsif (/^--marker=(.)$/os) { + $marker = $1; + } else { + die "$0: invalid argument: $_\n"; + } +} +unshift(@ARGV, '-') unless @ARGV; +unshift(@ARGV, @includes); + +# do the work +foreach (@ARGV) { include($stack, $_); } +exit(0); + +######################################################################## + +package main; +use File::Spec; +use File::Spec::Unix; # on all platforms, because the #include syntax is unix-based + +# Note: Ideally we would use File::Spec 0.8. When this becomes +# possible, add "0.8" to the first "use" line above, then replace +# occurrences of "::_0_8::" with "->" below. And remove the code for +# File::Spec 0.8 much lower down the file. + +sub include { + my($stack, $filename) = @_; + my $directory = $stack->{'variables'}->{'DIRECTORY'}; + if ($filename ne '-') { + $filename = File::Spec::_0_8::rel2abs($filename, $directory); + # splitpath expects forward-slash paths on windows, so we have to + # change the slashes if using Activestate Perl. + $filename =~ s?\\?/?g if "$^O" eq "MSWin32"; + my($volume, $path) = File::Spec::_0_8::splitpath($filename); + $directory = File::Spec::_0_8::catpath($volume, $path, ''); + } + local $stack->{'variables'}->{'DIRECTORY'} = $directory; + local $stack->{'variables'}->{'FILE'} = $filename; + local $stack->{'variables'}->{'LINE'} = 0; + local *FILE; + open(FILE, $filename) or die "Couldn't open $filename: $!\n"; + my $lineout = 0; + while (<FILE>) { + # on cygwin, line endings are screwed up, so normalise them. + s/[\x0D\x0A]+$/\n/os if ($^O eq 'msys' || $^O eq 'cygwin' || "$^O" eq "MSWin32"); + $stack->newline; + if (/^\Q$marker\E([a-z]+)\n?$/os) { # argumentless processing instruction + process($stack, $1); + } elsif (/^\Q$marker\E([a-z]+)\s(.*?)\n?$/os) { # processing instruction with arguments + process($stack, $1, $2); + } elsif (/^\Q$marker\E/os) { # comment + # ignore it + } elsif ($stack->enabled) { + next if $stack->{'dependencies'}; + + # set the current line number in JavaScript if necessary + my $linein = $stack->{'variables'}->{'LINE'}; + if (++$lineout != $linein) { + if ($filename =~ /\.js(|\.in)$/o) { + $stack->print("//\@line $linein \"$filename\"\n") + } + $lineout = $linein; + } + + # print it, including any newlines + $stack->print(filtered($stack, $_)); + } + } + close(FILE); +} + +sub process { + my($stack, $instruction, @arguments) = @_; + my $method = 'preprocessor'->can($instruction); + if (not defined($method)) { + fatal($stack, 'unknown instruction', $instruction); + } + eval { &$method($stack, @arguments) }; + if ($@) { + fatal($stack, "error evaluating $instruction:", $@); + } +} + +sub filtered { + my($stack, $text) = @_; + foreach my $filter (sort keys %{$stack->{'filters'}}) { + next unless $stack->{'filters'}->{$filter}; + my $method = 'filter'->can($filter); + if (not defined($method)) { + fatal($stack, 'unknown filter', $filter); + } + $text = eval { &$method($stack, $text) }; + if ($@) { + fatal($stack, "error using $filter:", $@); + } + } + return $text; +} + +sub fatal { + my $stack = shift; + my $filename = $stack->{'variables'}->{'FILE'}; + local $" = ' '; + print STDERR "$0:$filename:$.: @_\n"; + exit(1); +} + + +######################################################################## + +package stack; + +# condition evaluated just prior to this context was false +use constant COND_FALSE => 0; + +# condition evaluated just prior to this context was true +use constant COND_TRUE => 1; + +# some prior condition at this level already evaluated to true (or a +# parent condition evaluated to false or must be ignored), so we're +# ignoring all remaining conditions at current level (and nested +# conditions, too) +use constant COND_COMPLETED => 2; + +sub new { + return bless { + 'variables' => { + # %ENV, + 'LINE' => 0, # the line number in the source file + 'DIRECTORY' => '', # current directory + 'FILE' => '', # source filename + '1' => 1, # for convenience (the constant '1' is thus true) + }, + 'filters' => { + # filters + }, + 'values' => [], # the value of the last condition evaluated at the nth level + 'lastConditionState' => [], # whether the condition in the nth-level context was true, false, or not applicable + 'conditionState' => COND_TRUE, + 'dependencies' => 0, # whether we are showing dependencies + 'lineEndings' => "\n", # default to platform conventions + }; +} + +sub newline { + my $self = shift; + $self->{'variables'}->{'LINE'}++; +} + +sub define { + my $self = shift; + my($variable, $value) = @_; + die "not a valid variable name: '$variable'\n" if $variable =~ m/[^\w\.]/; + $self->{'variables'}->{$variable} = $value; +} + +sub defined { + my $self = shift; + my($variable) = @_; + die "not a valid variable name: '$variable'\n" if $variable =~ m/[^\w\.]/; + return defined($self->{'variables'}->{$variable}); +} + +sub undefine { + my $self = shift; + my($variable) = @_; + die "not a valid variable name: '$variable'\n" if $variable =~ m/[^\w\.]/; + delete($self->{'variables'}->{$variable}); +} + +sub get { + my $self = shift; + my($variable, $required) = @_; + die "not a valid variable name: '$variable'\n" if $variable =~ m/[^\w\.]/; + my $value = $self->{'variables'}->{$variable}; + if (defined($value)) { + return $value; + } else { + die "variable '$variable' is not defined\n" if $required; + return ''; + } +} + +sub replace { + my $self = shift; + my ($value) = @_; + + ${$self->{'values'}}[-1] = $value; + $self->{'conditionState'} = $self->{'conditionState'} != COND_FALSE + ? COND_COMPLETED + : $value ? COND_TRUE : COND_FALSE; +} + +sub push { + my $self = shift; + my($value) = @_; + + push(@{$self->{'values'}}, $value); + my $lastCondition = $self->{'conditionState'}; + push(@{$self->{'lastConditionState'}}, $lastCondition); + $self->{'conditionState'} = $lastCondition != COND_TRUE + ? COND_COMPLETED + : $value ? COND_TRUE : COND_FALSE; +} + +sub pop { + my $self = shift; + $self->{'conditionState'} = pop(@{$self->{'lastConditionState'}}); + return pop(@{$self->{'values'}}); +} + +sub enabled { + my $self = shift; + return $self->{'conditionState'} == COND_TRUE; +} + +sub disabled { + my $self = shift; + return $self->{'conditionState'} != COND_TRUE; +} + +sub filter { + my $self = shift; + my($filter, $value) = @_; + die "not a valid filter name: '$filter'\n" if $filter =~ m/\W/; + $self->{'filters'}->{$filter} = $value; +} + +sub expand { + my $self = shift; + my($line) = @_; + $line =~ s/__(\w+)__/$self->get($1)/gose; + return $line; +} + +sub print { + my $self = shift; + return if $self->{'dependencies'}; + foreach my $line (@_) { + if (chomp $line) { + CORE::print("$line$self->{'lineEndings'}"); + } else { + CORE::print($line); + } + } +} + +sub visit { + my $self = shift; + my($filename) = @_; + my $directory = $stack->{'variables'}->{'DIRECTORY'}; + $filename = File::Spec::_0_8::abs2rel(File::Spec::_0_8::rel2abs($filename, $directory)); + CORE::print("$filename\n"); +} + +######################################################################## + +package preprocessor; + +sub define { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + my $argument = shift; + for ($argument) { + /^(\w+)\s(.*)$/os && do { + return $stack->define($1, $2); + }; + /^(\w+)$/os && do { + return $stack->define($1, 1); + }; + die "invalid argument: '$_'\n"; + } +} + +sub undef { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + $stack->undefine(@_); +} + +sub ifdef { + my $stack = shift; + my $variable = shift; + my $replace = defined(shift); + die "argument expected\n" unless defined($variable); + if ($replace) { + $stack->replace($stack->defined($variable)); + } else { + $stack->push($stack->defined($variable)); + } +} + +sub ifndef { + my $stack = shift; + my $variable = shift; + my $replace = defined(shift); + die "argument expected\n" unless defined($variable); + if ($replace) { + $stack->replace(not $stack->defined($variable)); + } else { + $stack->push(not $stack->defined($variable)); + } +} + +sub if { + my $stack = shift; + die "argument expected\n" unless @_; + my $argument = shift; + my $replace = defined(shift); + for ($argument) { + /^(\w+)==(.*)$/os && do { + # equality + if ($replace) { + return $stack->replace($stack->get($1) eq $2); + } else { + return $stack->push($stack->get($1) eq $2); + } + }; + /^(\w+)!=(.*)$/os && do { + # inequality + if ($replace) { + return $stack->replace($stack->get($1) ne $2); + } else { + return $stack->push($stack->get($1) ne $2); + } + }; + /^(\w+)$/os && do { + # true value + if ($replace) { + return $stack->replace($stack->get($1)); + } else { + return $stack->push($stack->get($1)); + } + }; + /^!(\w+)$/os && do { + # false value + if ($replace) { + return $stack->replace(not $stack->get($1)); + } else { + return $stack->push(not $stack->get($1)); + } + }; + die "invalid argument: '$_'\n"; + } +} + +sub else { + my $stack = shift; + die "argument unexpected\n" if @_; + $stack->replace(1); +} + +sub elif { + my $stack = shift; + die "argument expected\n" unless @_; + &if($stack, @_, 1); +} + +sub elifdef { + my $stack = shift; + die "argument expected\n" unless @_; + &ifdef($stack, @_, 1); +} + +sub elifndef { + my $stack = shift; + die "argument expected\n" unless @_; + &ifndef($stack, @_, 1); +} + +sub endif { + my $stack = shift; + die "argument unexpected\n" if @_; + $stack->pop; +} + +sub error { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + my $line = $stack->expand(@_); + die "$line\n"; +} + +sub expand { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + my $line = $stack->expand(@_); + $stack->print("$line\n"); +} + +sub literal { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + my $line = shift; + $stack->print("$line\n"); +} + +sub include { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + my $filename = File::Spec::_0_8::catpath(File::Spec::_0_8::splitpath(@_)); + if ($stack->{'dependencies'}) { + $stack->visit($filename); + } else { + main::include($stack, $filename); + } +} + +sub includesubst { + my ($stack, $filename) = @_; + return if $stack->disabled; + die "argument expected\n" unless $filename; + $filename =~ s/@(\w+)@/$stack->get($1, 1)/gose; + $filename = File::Spec::_0_8::catpath(File::Spec::_0_8::splitpath($filename)); + if ($stack->{'dependencies'}) { + $stack->visit($filename); + } else { + main::include($stack, $filename); + } +} + +sub filter { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + foreach (split(/\s/os, shift)) { + $stack->filter($_, 1); + } +} + +sub unfilter { + my $stack = shift; + return if $stack->disabled; + die "argument expected\n" unless @_; + foreach (split(/\s/os, shift)) { + $stack->filter($_, 0); + } +} + + +######################################################################## + +package filter; + +sub emptyLines { + my($stack, $text) = @_; + $text = "" if $text eq "\n"; + return $text; +} + +sub spaces { + my($stack, $text) = @_; + $text =~ s/ +/ /gos; # middle spaces + $text =~ s/^ //gos; # start spaces + $text =~ s/ (\n?)$/$1/gos; # end spaces + return $text; +} + +sub slashslash { + my($stack, $text) = @_; + $text =~ s|//.*?(\n?)$|$1|gos; + return $text; +} + +sub substitution { + my($stack, $text) = @_; + $text =~ s/@(\w+)@/$stack->get($1, 1)/gose; + return $text; +} + +sub attemptSubstitution { + my($stack, $text) = @_; + $text =~ s/@(\w+)@/$stack->get($1, 0)/gose; + return $text; +} + +######################################################################## + +######################################################################## +# This code is from File::Spec::Unix 0.8. +# It is not considered a part of the preprocessor.pl source file +# This code is licensed under the same license as File::Spec itself. + +package File::Spec::_0_8; + +use Cwd; + +sub rel2abs { + my ($path, $base) = @_; + if ( ! File::Spec->file_name_is_absolute( $path ) ) { + if ( !defined( $base ) || $base eq '' ) { + $base = cwd() ; + } elsif ( ! File::Spec->file_name_is_absolute( $base ) ) { + $base = rel2abs( $base ); + } else { + $base = File::Spec->canonpath( $base ); + } + $path = File::Spec->catdir( $base, $path ); + } + return File::Spec->canonpath( $path ); +} + +sub splitdir { + return split m|/|, $_[1], -1; # Preserve trailing fields +} + +sub splitpath { + my ($path, $nofile) = @_; + + my ($volume,$directory,$file) = ('','',''); + + if ( $nofile ) { + $directory = $path; + } + else { + $path =~ m|^ ( (?: .* / (?: \.\.?\Z(?!\n) )? )? ) ([^/]*) |xs; + $directory = $1; + $file = $2; + } + + return ($volume,$directory,$file); +} + +sub catpath { + my ($volume,$directory,$file) = @_; + + if ( $directory ne '' && + $file ne '' && + substr( $directory, -1 ) ne '/' && + substr( $file, 0, 1 ) ne '/' + ) { + $directory .= "/$file" ; + } + else { + $directory .= $file ; + } + + return $directory ; +} + +sub abs2rel { + my($path,$base) = @_; + + # Clean up $path + if ( ! File::Spec->file_name_is_absolute( $path ) ) { + $path = rel2abs( $path ) ; + } + else { + $path = File::Spec->canonpath( $path ) ; + } + + # Figure out the effective $base and clean it up. + if ( !defined( $base ) || $base eq '' ) { + $base = cwd(); + } + elsif ( ! File::Spec->file_name_is_absolute( $base ) ) { + $base = rel2abs( $base ) ; + } + else { + $base = File::Spec->canonpath( $base ) ; + } + + # Now, remove all leading components that are the same + my @pathchunks = File::Spec::_0_8::splitdir( $path); + my @basechunks = File::Spec::_0_8::splitdir( $base); + + while (@pathchunks && @basechunks && $pathchunks[0] eq $basechunks[0]) { + shift @pathchunks ; + shift @basechunks ; + } + + $path = CORE::join( '/', @pathchunks ); + $base = CORE::join( '/', @basechunks ); + + # $base now contains the directories the resulting relative path + # must ascend out of before it can descend to $path_directory. So, + # replace all names with $parentDir + $base =~ s|[^/]+|..|g ; + + # Glue the two together, using a separator if necessary, and preventing an + # empty result. + if ( $path ne '' && $base ne '' ) { + $path = "$base/$path" ; + } else { + $path = "$base$path" ; + } + + return File::Spec->canonpath( $path ) ; +} + +# End code from File::Spec::Unix 0.8. +######################################################################## diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth-nt.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth-nt.pl new file mode 100644 index 0000000..8853268 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth-nt.pl @@ -0,0 +1,48 @@ +#! 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 "/ns/config/fastcwd.pl"; + +$cur = &fastcwd; +chdir($ARGV[0]); +$newcur = &fastcwd; +$newcurlen = length($newcur); + +# Skip common separating / unless $newcur is "/" +$cur = substr($cur, $newcurlen + ($newcurlen > 1)); +print $cur; diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth.pl new file mode 100644 index 0000000..3ec4272 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/revdepth.pl @@ -0,0 +1,51 @@ +#! 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** + +unshift(@INC, '/usr/lib/perl'); +unshift(@INC, '/usr/local/lib/perl'); + +require "fastcwd.pl"; + +$cur = &fastcwd; +chdir($ARGV[0]); +$newcur = &fastcwd; +$newcurlen = length($newcur); + +# Skip common separating / unless $newcur is "/" +$cur = substr($cur, $newcurlen + ($newcurlen > 1)); +print $cur; diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/rules.mk b/tools/node_modules/expresso/deps/jscoverage/js/config/rules.mk new file mode 100644 index 0000000..6168216 --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/rules.mk @@ -0,0 +1,2269 @@ +# vim:set ts=8 sw=8 sts=8 noet: +# +# ***** 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 mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Chase Phillips <chase@mozilla.org> +# Benjamin Smedberg <benjamin@smedbergs.us> +# Jeff Walden <jwalden+code@mit.edu> +# +# Alternatively, the contents of this file may be used under the terms of +# either of 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 ***** +NO_DIST_INSTALL = 1 + +ifndef topsrcdir +topsrcdir = $(DEPTH) +endif + +ifndef MOZILLA_DIR +MOZILLA_DIR = $(topsrcdir) +endif + +ifndef INCLUDED_CONFIG_MK +include $(topsrcdir)/config/config.mk +endif + +ifndef INCLUDED_VERSION_MK +include $(topsrcdir)/config/version.mk +endif + +REPORT_BUILD = @echo $(notdir $<) + +ifeq ($(OS_ARCH),OS2) +EXEC = +else +EXEC = exec +endif + +# ELOG prints out failed command when building silently (gmake -s). +ifneq (,$(findstring -s,$(MAKEFLAGS))) + ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh +else + ELOG := +endif + +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) +ifndef GNU_CC +_LIBNAME_RELATIVE_PATHS=1 +endif +endif + +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) +PWD := $(shell pwd) +_VPATH_SRCS = $(if $(filter /%,$<),$<,$(PWD)/$<) +else +_VPATH_SRCS = $< +endif + +# Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed +VPATH += $(DIST)/lib +ifdef LIBXUL_SDK +VPATH += $(LIBXUL_SDK)/lib +endif + +# EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo) +# expands to foo.lib on platforms with import libs and -lfoo otherwise + +# EXPAND_LIBNAME_PATH - $(call EXPAND_LIBNAME_PATH,foo,dir) +# expands to dir/foo.lib on platforms with import libs and +# -Ldir -lfoo otherwise + +# EXPAND_MOZLIBNAME - $(call EXPAND_MOZLIBNAME,foo) +# expands to $(DIST)/lib/foo.lib on platforms with import libs and +# -lfoo otherwise + +ifdef _LIBNAME_RELATIVE_PATHS +EXPAND_LIBNAME = $(foreach lib,$(1),$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) +EXPAND_LIBNAME_PATH = $(foreach lib,$(1),$(2)/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) +EXPAND_MOZLIBNAME = $(foreach lib,$(1),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) +else +EXPAND_LIBNAME = $(addprefix -l,$(1)) +EXPAND_LIBNAME_PATH = -L$(2) $(addprefix -l,$(1)) +EXPAND_MOZLIBNAME = $(addprefix -l,$(1)) +endif + +ifdef EXTRA_DSO_LIBS +EXTRA_DSO_LIBS := $(call EXPAND_MOZLIBNAME,$(EXTRA_DSO_LIBS)) +endif + +# +# Library rules +# +# If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library. +# Otherwise, build a shared library. +# + +ifndef LIBRARY +ifdef LIBRARY_NAME +ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) +ifdef SHORT_LIBNAME +LIBRARY_NAME := $(SHORT_LIBNAME) +endif +endif +LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX) +endif +endif + +ifndef HOST_LIBRARY +ifdef HOST_LIBRARY_NAME +HOST_LIBRARY := $(LIB_PREFIX)$(HOST_LIBRARY_NAME).$(LIB_SUFFIX) +endif +endif + +ifdef LIBRARY +ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS)) +ifdef MKSHLIB + +ifdef LIB_IS_C_ONLY +MKSHLIB = $(MKCSHLIB) +endif + +ifdef MAKE_FRAMEWORK +SHARED_LIBRARY := $(LIBRARY_NAME) +else +SHARED_LIBRARY := $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX) +endif + +ifeq ($(OS_ARCH),OS2) +DEF_FILE := $(SHARED_LIBRARY:.dll=.def) +endif + +ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) +IMPORT_LIBRARY := $(LIB_PREFIX)$(LIBRARY_NAME).$(IMPORT_LIB_SUFFIX) +endif + +ifdef MOZ_ENABLE_LIBXUL +EMBED_MANIFEST_AT=2 +endif + +endif # MKSHLIB +endif # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS +endif # LIBRARY + +ifeq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB)) +LIBRARY := $(NULL) +endif + +ifeq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS)) +SHARED_LIBRARY := $(NULL) +DEF_FILE := $(NULL) +IMPORT_LIBRARY := $(NULL) +endif + +ifdef FORCE_STATIC_LIB +ifndef FORCE_SHARED_LIB +SHARED_LIBRARY := $(NULL) +DEF_FILE := $(NULL) +IMPORT_LIBRARY := $(NULL) +endif +endif + +ifdef FORCE_SHARED_LIB +ifndef FORCE_STATIC_LIB +LIBRARY := $(NULL) +endif +endif + +ifdef JAVA_LIBRARY_NAME +JAVA_LIBRARY := $(JAVA_LIBRARY_NAME).jar +endif + +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) +ifndef GNU_CC + +# +# All C++ files share a PDB file per directory. For parallel builds, this PDB +# file is shared and locked by MSPDBSRV.EXE, starting with MSVC8 SP1. If +# you're using MSVC 7.1 or MSVC8 without SP1, don't do parallel builds. +# +# The final PDB for libraries and programs is created by the linker and uses +# a different name from the single PDB file created by the compiler. See +# bug 462740. +# +COMPILE_PDBFILE = generated.pdb +LINK_PDBFILE = $(basename $(@F)).pdb +ifdef MOZ_DEBUG +CODFILE=$(basename $(@F)).cod +endif + +ifdef MOZ_MAPINFO +ifdef LIBRARY_NAME +MAPFILE=$(LIBRARY_NAME).map +else +MAPFILE=$(basename $(@F)).map +endif # LIBRARY_NAME +endif # MOZ_MAPINFO + +ifdef DEFFILE +OS_LDFLAGS += -DEF:$(DEFFILE) +EXTRA_DEPS += $(DEFFILE) +endif + +ifdef MAPFILE +OS_LDFLAGS += -MAP:$(MAPFILE) +#CFLAGS += -Fm$(MAPFILE) +#CXXFLAGS += -Fm$(MAPFILE) +endif + +#ifdef CODFILE +#CFLAGS += -Fa$(CODFILE) -FAsc +#CFLAGS += -Fa$(CODFILE) -FAsc +#endif + +endif # !GNU_CC + +ifdef ENABLE_CXX_EXCEPTIONS +ifdef GNU_CC +CXXFLAGS += -fexceptions +else +ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER))) +CXXFLAGS += -GX +else +CXXFLAGS += -EHsc +endif # _MSC_VER +endif # GNU_CC +endif # ENABLE_CXX_EXCEPTIONS +endif # WINNT + +ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH))) +HOST_PDBFILE=$(basename $(@F)).pdb +endif + +ifndef TARGETS +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(JAVA_LIBRARY) +endif + +ifndef OBJS +_OBJS = \ + $(JRI_STUB_CFILES) \ + $(addsuffix .$(OBJ_SUFFIX), $(JMC_GEN)) \ + $(CSRCS:.c=.$(OBJ_SUFFIX)) \ + $(patsubst %.cc,%.$(OBJ_SUFFIX),$(CPPSRCS:.cpp=.$(OBJ_SUFFIX))) \ + $(CMSRCS:.m=.$(OBJ_SUFFIX)) \ + $(CMMSRCS:.mm=.$(OBJ_SUFFIX)) \ + $(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)) +OBJS = $(strip $(_OBJS)) +endif + +ifndef HOST_OBJS +_HOST_OBJS = \ + $(addprefix host_,$(HOST_CSRCS:.c=.$(OBJ_SUFFIX))) \ + $(addprefix host_,$(patsubst %.cc,%.$(OBJ_SUFFIX),$(HOST_CPPSRCS:.cpp=.$(OBJ_SUFFIX)))) \ + $(addprefix host_,$(HOST_CMSRCS:.m=.$(OBJ_SUFFIX))) \ + $(addprefix host_,$(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX))) +HOST_OBJS = $(strip $(_HOST_OBJS)) +endif + +LIBOBJS := $(addprefix \", $(OBJS)) +LIBOBJS := $(addsuffix \", $(LIBOBJS)) + +ifndef MOZ_AUTO_DEPS +ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)) +MDDEPFILES = $(addprefix $(MDDEPDIR)/,$(OBJS:.$(OBJ_SUFFIX)=.pp)) +ifndef NO_GEN_XPT +MDDEPFILES += $(addprefix $(MDDEPDIR)/,$(XPIDLSRCS:.idl=.xpt)) \ + $(addprefix $(MDDEPDIR)/,$(SDK_XPIDLSRCS:.idl=.xpt)) +endif +endif +endif + +ALL_TRASH = \ + $(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \ + $(filter-out $(ASFILES),$(OBJS:.$(OBJ_SUFFIX)=.s)) $(OBJS:.$(OBJ_SUFFIX)=.ii) \ + $(OBJS:.$(OBJ_SUFFIX)=.i) \ + $(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\ + $(EXE_DEF_FILE) so_locations _gen _stubs $(wildcard *.res) $(wildcard *.RES) \ + $(wildcard *.pdb) $(CODFILE) $(MAPFILE) $(IMPORT_LIBRARY) \ + $(SHARED_LIBRARY:$(DLL_SUFFIX)=.exp) $(wildcard *.ilk) \ + $(PROGRAM:$(BIN_SUFFIX)=.exp) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.exp) \ + $(PROGRAM:$(BIN_SUFFIX)=.lib) $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.lib) \ + $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX)) \ + $(wildcard gts_tmp_*) $(LIBRARY:%.a=.%.timestamp) +ALL_TRASH_DIRS = \ + $(GARBAGE_DIRS) /no-such-file + +ifdef QTDIR +GARBAGE += $(MOCSRCS) +endif + +ifdef SIMPLE_PROGRAMS +GARBAGE += $(SIMPLE_PROGRAMS:%=%.$(OBJ_SUFFIX)) +endif + +ifdef HOST_SIMPLE_PROGRAMS +GARBAGE += $(HOST_SIMPLE_PROGRAMS:%=%.$(OBJ_SUFFIX)) +endif + +# +# the Solaris WorkShop template repository cache. it occasionally can get +# out of sync, so targets like clobber should kill it. +# +ifeq ($(OS_ARCH),SunOS) +ifeq ($(GNU_CXX),) +GARBAGE_DIRS += SunWS_cache +endif +endif + +ifeq ($(OS_ARCH),OpenVMS) +GARBAGE += $(wildcard *.*_defines) +ifdef SHARED_LIBRARY +VMS_SYMVEC_FILE = $(SHARED_LIBRARY:$(DLL_SUFFIX)=_symvec.opt) +ifdef MOZ_DEBUG +VMS_SYMVEC_FILE_MODULE = $(topsrcdir)/build/unix/vms/$(notdir $(SHARED_LIBRARY:$(DLL_SUFFIX)=_dbg_symvec.opt)) +else +VMS_SYMVEC_FILE_MODULE = $(topsrcdir)/build/unix/vms/$(notdir $(SHARED_LIBRARY:$(DLL_SUFFIX)=_symvec.opt)) +endif +VMS_SYMVEC_FILE_COMP = $(topsrcdir)/build/unix/vms/component_symvec.opt +GARBAGE += $(VMS_SYMVEC_FILE) +ifdef IS_COMPONENT +DSO_LDOPTS := $(filter-out -auto_symvec,$(DSO_LDOPTS)) $(VMS_SYMVEC_FILE) +endif +endif +endif + +XPIDL_GEN_DIR = _xpidlgen + +ifdef MOZ_UPDATE_XTERM +# Its good not to have a newline at the end of the titlebar string because it +# makes the make -s output easier to read. Echo -n does not work on all +# platforms, but we can trick sed into doing it. +UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str; +UPDATE_TITLE_export = sed -e "s!Y!export in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str; +UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str; +UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str; +endif + +LOOP_OVER_DIRS = \ + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true + +# we only use this for the makefiles target and other stuff that doesn't matter +LOOP_OVER_PARALLEL_DIRS = \ + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true + +LOOP_OVER_STATIC_DIRS = \ + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true + +LOOP_OVER_TOOL_DIRS = \ + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true + +ifdef PARALLEL_DIRS +# create a bunch of fake targets for order-only processing +PARALLEL_DIRS_export = $(addsuffix _export,$(PARALLEL_DIRS)) +PARALLEL_DIRS_libs = $(addsuffix _libs,$(PARALLEL_DIRS)) +PARALLEL_DIRS_tools = $(addsuffix _tools,$(PARALLEL_DIRS)) + +.PHONY: $(PARALLEL_DIRS_export) $(PARALLEL_DIRS_libs) $(PARALLEL_DIRS_tools) +endif + +# +# Now we can differentiate between objects used to build a library, and +# objects used to build an executable in the same directory. +# +ifndef PROGOBJS +PROGOBJS = $(OBJS) +endif + +ifndef HOST_PROGOBJS +HOST_PROGOBJS = $(HOST_OBJS) +endif + +# MAKE_DIRS: List of directories to build while looping over directories. +# A Makefile that needs $(MDDEPDIR) created but doesn't set any of these +# variables we know to check can just set NEED_MDDEPDIR explicitly. +ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR)) +MAKE_DIRS += $(CURDIR)/$(MDDEPDIR) +GARBAGE_DIRS += $(MDDEPDIR) +endif + +# +# Tags: emacs (etags), vi (ctags) +# TAG_PROGRAM := ctags -L - +# +TAG_PROGRAM = xargs etags -a + +# +# Turn on C++ linking if we have any .cpp or .mm files +# (moved this from config.mk so that config.mk can be included +# before the CPPSRCS are defined) +# +ifneq ($(CPPSRCS)$(CMMSRCS),) +CPP_PROG_LINK = 1 +endif + +# +# Make sure to wrap static libs inside linker specific flags to turn on & off +# inclusion of all symbols inside the static libs +# +ifndef NO_LD_ARCHIVE_FLAGS +ifdef SHARED_LIBRARY_LIBS +EXTRA_DSO_LDOPTS := $(MKSHLIB_FORCE_ALL) $(SHARED_LIBRARY_LIBS) $(MKSHLIB_UNFORCE_ALL) $(EXTRA_DSO_LDOPTS) +endif +endif + +# +# This will strip out symbols that the component should not be +# exporting from the .dynsym section. +# +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS) +endif # IS_COMPONENT + +# +# Enforce the requirement that MODULE_NAME must be set +# for components in static builds +# +ifdef IS_COMPONENT +ifdef EXPORT_LIBRARY +ifndef FORCE_SHARED_LIB +ifndef MODULE_NAME +$(error MODULE_NAME is required for components which may be used in static builds) +endif +endif +endif +endif + +# +# MacOS X specific stuff +# + +ifeq ($(OS_ARCH),Darwin) +ifdef SHARED_LIBRARY +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += -bundle +else +EXTRA_DSO_LDOPTS += -dynamiclib -install_name @executable_path/$(SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module +endif +endif +endif + +# +# On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be +# fatal symbol name clashes between components. +# +ifeq ($(OS_ARCH),NetBSD) +ifeq ($(DLL_SUFFIX),.so.1.0) +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic +endif +endif +endif + +ifeq ($(OS_ARCH),FreeBSD) +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic +endif +endif + +ifeq ($(OS_ARCH),NetBSD) +ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips,$(OS_TEST))) +ifeq ($(MODULE),layout) +OS_CFLAGS += -Wa,-xgot +OS_CXXFLAGS += -Wa,-xgot +endif +endif +endif + +ifeq ($(OS_ARCH),Linux) +ifneq (,$(filter mips mipsel,$(OS_TEST))) +ifeq ($(MODULE),layout) +OS_CFLAGS += -Wa,-xgot +OS_CXXFLAGS += -Wa,-xgot +endif +endif +endif + +# +# HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag +# which uses internal symbols first +# +ifeq ($(OS_ARCH),HP-UX) +ifdef IS_COMPONENT +ifeq ($(GNU_CC)$(GNU_CXX),) +EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic +ifneq ($(HAS_EXTRAEXPORTS),1) +MKSHLIB += -Wl,+eNSGetModule -Wl,+eerrno +MKCSHLIB += +eNSGetModule +eerrno +ifneq ($(OS_TEST),ia64) +MKSHLIB += -Wl,+e_shlInit +MKCSHLIB += +e_shlInit +endif # !ia64 +endif # !HAS_EXTRAEXPORTS +endif # non-gnu compilers +endif # IS_COMPONENT +endif # HP-UX + +ifeq ($(OS_ARCH),AIX) +ifdef IS_COMPONENT +ifneq ($(HAS_EXTRAEXPORTS),1) +MKSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall +MKCSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall +endif # HAS_EXTRAEXPORTS +endif # IS_COMPONENT +endif # AIX + +# +# OSF1: add -B symbolic flag for components +# +ifeq ($(OS_ARCH),OSF1) +ifdef IS_COMPONENT +ifeq ($(GNU_CC)$(GNU_CXX),) +EXTRA_DSO_LDOPTS += -B symbolic +endif +endif +endif + +# +# Linux: add -Bsymbolic flag for components +# +ifeq ($(OS_ARCH),Linux) +ifdef IS_COMPONENT +EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic +endif +endif + +# +# MINGW32 +# +ifeq ($(OS_ARCH),WINNT) +ifdef GNU_CC +ifndef IS_COMPONENT +DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) +endif +endif +endif + +ifeq ($(USE_TVFS),1) +IFLAGS1 = -rb +IFLAGS2 = -rb +else +IFLAGS1 = -m 644 +IFLAGS2 = -m 755 +endif + +ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) +OUTOPTION = -Fo# eol +else +OUTOPTION = -o # eol +endif # WINNT && !GNU_CC +ifneq (,$(filter WINCE,$(OS_ARCH))) +OUTOPTION = -Fo# eol +endif + +ifeq ($(OS_TARGET), WINCE) +OUTOPTION = -Fo# eol +HOST_OUTOPTION = -Fo# eol +else + +ifeq (,$(CROSS_COMPILE)) +HOST_OUTOPTION = $(OUTOPTION) +else +HOST_OUTOPTION = -o # eol +endif + +endif +################################################################################ + +# SUBMAKEFILES: List of Makefiles for next level down. +# This is used to update or create the Makefiles before invoking them. +SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS)) + +# The root makefile doesn't want to do a plain export/libs, because +# of the tiers and because of libxul. Suppress the default rules in favor +# of something else. Makefiles which use this var *must* provide a sensible +# default rule before including rules.mk +ifndef SUPPRESS_DEFAULT_RULES +ifdef TIERS + +DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs)) +STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs)) + +default all alldep:: + $(EXIT_ON_ERROR) \ + $(foreach tier,$(TIERS),$(MAKE) tier_$(tier); ) true + +else + +default all:: + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); ) true + $(MAKE) export + $(MAKE) libs + $(MAKE) tools + +# Do depend as well +alldep:: + $(MAKE) export + $(MAKE) depend + $(MAKE) libs + $(MAKE) tools + +endif # TIERS +endif # SUPPRESS_DEFAULT_RULES + +ifeq ($(filter s,$(MAKEFLAGS)),) +ECHO := echo +QUIET := +else +ECHO := true +QUIET := -q +endif + +MAKE_TIER_SUBMAKEFILES = +$(if $(tier_$*_dirs),$(MAKE) $(addsuffix /Makefile,$(tier_$*_dirs))) + +export_tier_%: + @$(ECHO) "$@" + @$(MAKE_TIER_SUBMAKEFILES) + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) export; ) true + +libs_tier_%: + @$(ECHO) "$@" + @$(MAKE_TIER_SUBMAKEFILES) + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) libs; ) true + +tools_tier_%: + @$(ECHO) "$@" + @$(MAKE_TIER_SUBMAKEFILES) + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(tier_$*_dirs),$(MAKE) -C $(dir) tools; ) true + +$(foreach tier,$(TIERS),tier_$(tier)):: + @$(ECHO) "$@: $($@_staticdirs) $($@_dirs)" + @$(EXIT_ON_ERROR) \ + $(foreach dir,$($@_staticdirs),$(MAKE) -C $(dir); ) true + $(MAKE) export_$@ + $(MAKE) libs_$@ + +# Do everything from scratch +everything:: + $(MAKE) clean + $(MAKE) alldep + +# Add dummy depend target for tinderboxes +depend:: + +ifdef ALL_PLATFORMS +all_platforms:: $(NFSPWD) + @d=`$(NFSPWD)`; \ + if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; else true; fi; \ + for h in $(PLATFORM_HOSTS); do \ + echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\ + rsh $$h -n "(chdir $$d; \ + $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \ + echo DONE) &" 2>&1 > LOGS/$$h.pid & \ + sleep 1; \ + done + +$(NFSPWD): + cd $(@D); $(MAKE) $(@F) +endif + +# Target to only regenerate makefiles +makefiles: $(SUBMAKEFILES) +ifneq (,$(DIRS)$(TOOL_DIRS)$(PARALLEL_DIRS)) + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) +endif + +ifdef PARALLEL_DIRS +export:: $(PARALLEL_DIRS_export) + +$(PARALLEL_DIRS_export): %_export: %/Makefile + +@$(UPDATE_TITLE_export) $(MAKE) -C $* export +endif + +export:: $(SUBMAKEFILES) $(MAKE_DIRS) $(if $(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),$(PUBLIC)) $(if $(SDK_HEADERS)$(SDK_XPIDLSRCS),$(SDK_PUBLIC)) $(if $(XPIDLSRCS),$(IDL_DIR)) $(if $(SDK_XPIDLSRCS),$(SDK_IDL_DIR)) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) + +ifdef PARALLEL_DIRS +tools:: $(PARALLEL_DIRS_tools) + +$(PARALLEL_DIRS_tools): %_tools: %/Makefile + +@$(UPDATE_TITLE_tools) $(MAKE) -C $* tools +endif + +tools:: $(SUBMAKEFILES) $(MAKE_DIRS) + +$(LOOP_OVER_DIRS) +ifdef TOOL_DIRS + @$(EXIT_ON_ERROR) \ + $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; ) true +endif + +# +# Rule to create list of libraries for final link +# +export:: +ifdef LIBRARY_NAME +ifdef EXPORT_LIBRARY +ifdef IS_COMPONENT +ifdef BUILD_STATIC_LIBS + @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMPS) $(LIBRARY_NAME) +ifdef MODULE_NAME + @$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME) +endif +endif +else + $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_LINK_LIBS) $(LIBRARY_NAME) +endif # IS_COMPONENT +endif # EXPORT_LIBRARY +endif # LIBRARY_NAME + +# Create dependencies on static (and shared EXTRA_DSO_LIBS) libraries +LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(LIBS)) +HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(HOST_LIBS)) +DSO_LDOPTS_DEPS = $(EXTRA_DSO_LIBS) $(filter %.$(LIB_SUFFIX), $(EXTRA_DSO_LDOPTS)) + +############################################## +ifdef PARALLEL_DIRS +libs:: $(PARALLEL_DIRS_libs) + +$(PARALLEL_DIRS_libs): %_libs: %/Makefile + +@$(UPDATE_TITLE_libs) $(MAKE) -C $* libs +endif + +libs:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(JAVA_LIBRARY) +ifndef NO_DIST_INSTALL +ifdef LIBRARY +ifdef EXPORT_LIBRARY # Stage libs that will be linked into a static build +ifdef IS_COMPONENT + $(INSTALL) $(IFLAGS1) $(LIBRARY) $(DEPTH)/staticlib/components +else + $(INSTALL) $(IFLAGS1) $(LIBRARY) $(DEPTH)/staticlib +endif +endif # EXPORT_LIBRARY +ifdef DIST_INSTALL +ifdef IS_COMPONENT + $(error Shipping static component libs makes no sense.) +else + $(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib +endif +endif # DIST_INSTALL +endif # LIBRARY +ifdef SHARED_LIBRARY +ifdef IS_COMPONENT + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components + $(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY) +ifdef BEOS_ADDON_WORKAROUND + ( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) +endif +else # ! IS_COMPONENT +ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) + $(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib +else + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib +endif + $(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET) +ifdef BEOS_ADDON_WORKAROUND + ( cd $(FINAL_TARGET) && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) ) +endif +endif # IS_COMPONENT +endif # SHARED_LIBRARY +ifdef PROGRAM + $(INSTALL) $(IFLAGS2) $(PROGRAM) $(FINAL_TARGET) +endif +ifdef SIMPLE_PROGRAMS + $(INSTALL) $(IFLAGS2) $(SIMPLE_PROGRAMS) $(FINAL_TARGET) +endif +ifdef HOST_PROGRAM + $(INSTALL) $(IFLAGS2) $(HOST_PROGRAM) $(DIST)/host/bin +endif +ifdef HOST_SIMPLE_PROGRAMS + $(INSTALL) $(IFLAGS2) $(HOST_SIMPLE_PROGRAMS) $(DIST)/host/bin +endif +ifdef HOST_LIBRARY + $(INSTALL) $(IFLAGS1) $(HOST_LIBRARY) $(DIST)/host/lib +endif +ifdef JAVA_LIBRARY +ifdef IS_COMPONENT + $(INSTALL) $(IFLAGS1) $(JAVA_LIBRARY) $(FINAL_TARGET)/components +else + $(INSTALL) $(IFLAGS1) $(JAVA_LIBRARY) $(FINAL_TARGET) +endif +endif # JAVA_LIBRARY +endif # !NO_DIST_INSTALL + +$(LOOP_OVER_DIRS) + +############################################## + +ifndef NO_PROFILE_GUIDED_OPTIMIZE +ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE)) +ifeq ($(OS_ARCH)_$(GNU_CC)$(INTERNAL_TOOLS), WINNT_) +# Force re-linking when building with PGO, since +# the MSVC linker does all the work. We force re-link +# in both stages so you can do depend builds with PGO. +ifdef SHARED_LIBRARY +$(SHARED_LIBRARY): FORCE +BINARY_BASENAME = $(SHARED_LIBRARY:$(DLL_SUFFIX)=) +endif +ifdef PROGRAM +$(PROGRAM): FORCE +BINARY_BASENAME = $(PROGRAM:$(BIN_SUFFIX)=) +endif + +ifdef MOZ_PROFILE_USE +# In the second pass, we need to merge the pgc files into the pgd file. +# The compiler would do this for us automatically if they were in the right +# place, but they're in dist/bin. +ifdef BINARY_BASENAME +export:: + $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \ + $(BINARY_BASENAME) $(DIST)/bin +endif +endif # MOZ_PROFILE_USE +endif # WINNT_ +endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE +endif # NO_PROFILE_GUIDED_OPTIMIZE + +############################################## + +checkout: + $(MAKE) -C $(topsrcdir) -f client.mk checkout + +run_viewer: $(FINAL_TARGET)/viewer + cd $(FINAL_TARGET); \ + MOZILLA_FIVE_HOME=`pwd` \ + LD_LIBRARY_PATH=".:$(LIBS_PATH):$$LD_LIBRARY_PATH" \ + viewer + +clean clobber realclean clobber_all:: $(SUBMAKEFILES) + -rm -f $(ALL_TRASH) + -rm -rf $(ALL_TRASH_DIRS) + +-$(LOOP_OVER_PARALLEL_DIRS) + +-$(LOOP_OVER_DIRS) + +-$(LOOP_OVER_STATIC_DIRS) + +-$(LOOP_OVER_TOOL_DIRS) + +distclean:: $(SUBMAKEFILES) + +-$(LOOP_OVER_PARALLEL_DIRS) + +-$(LOOP_OVER_DIRS) + +-$(LOOP_OVER_STATIC_DIRS) + +-$(LOOP_OVER_TOOL_DIRS) + -rm -rf $(ALL_TRASH_DIRS) + -rm -f $(ALL_TRASH) \ + Makefile .HSancillary \ + $(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) $(wildcard host_*.o*) \ + $(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \ + $(wildcard *.$(IMPORT_LIB_SUFFIX)) +ifeq ($(OS_ARCH),OS2) + -rm -f $(PROGRAM:.exe=.map) +endif + +alltags: + rm -f TAGS + find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM) + +# +# PROGRAM = Foo +# creates OBJS, links with LIBS to create Foo +# +$(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) Makefile Makefile.in +ifeq (WINCE,$(OS_ARCH)) + $(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) +else +ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) + $(LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) +ifdef MSMANIFEST_TOOL + @if test -f $@.manifest; then \ + if test -f "$(srcdir)/$@.manifest"; then \ + mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \ + else \ + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ + fi; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +else +ifeq ($(CPP_PROG_LINK),1) + $(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(EXE_DEF_FILE) +else # ! CPP_PROG_LINK + $(CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE) +endif # CPP_PROG_LINK +endif # WINNT && !GNU_CC +endif # WINCE + +ifdef ENABLE_STRIP + $(STRIP) $@ +endif +ifdef MOZ_POST_PROGRAM_COMMAND + $(MOZ_POST_PROGRAM_COMMAND) $@ +endif +ifeq ($(OS_ARCH),BeOS) +ifdef BEOS_PROGRAM_RESOURCE + xres -o $@ $(BEOS_PROGRAM_RESOURCE) + mimeset $@ +endif +endif # BeOS + +$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in +ifeq (WINCE,$(OS_ARCH)) + $(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) +else +ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH)) + $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) +ifdef MSMANIFEST_TOOL + @if test -f $@.manifest; then \ + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +else +ifeq ($(CPP_PROG_LINK),1) + $(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) +else + $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) +endif # CPP_PROG_LINK +endif +endif + +# +# This is an attempt to support generation of multiple binaries +# in one directory, it assumes everything to compile Foo is in +# Foo.o (from either Foo.c or Foo.cpp). +# +# SIMPLE_PROGRAMS = Foo Bar +# creates Foo.o Bar.o, links with LIBS to create Foo, Bar. +# +$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) Makefile Makefile.in +ifeq (WINCE,$(OS_ARCH)) + $(LD) -nologo -entry:main -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) +else +ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) + $(LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) +ifdef MSMANIFEST_TOOL + @if test -f $@.manifest; then \ + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ + rm -f $@.manifest; \ + fi +endif # MSVC with manifest tool +else +ifeq ($(CPP_PROG_LINK),1) + $(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS) +else + $(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS) +endif # CPP_PROG_LINK +endif # WINNT && !GNU_CC +endif # WINCE + +ifdef ENABLE_STRIP + $(STRIP) $@ +endif +ifdef MOZ_POST_PROGRAM_COMMAND + $(MOZ_POST_PROGRAM_COMMAND) $@ +endif + +$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in +ifeq (WINCE,$(OS_ARCH)) + $(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) +else +ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC)) + $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) +else +ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX)) + $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) +else + $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS) +endif +endif +endif + +# +# Purify target. Solaris/sparc only to start. +# Purify does not recognize "egcs" or "c++" so we go with +# "gcc" and "g++" for now. +# +pure: $(PROGRAM) +ifeq ($(CPP_PROG_LINK),1) + $(PURIFY) $(CCC) -o $^.pure $(CXXFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) +else + $(PURIFY) $(CC) -o $^.pure $(CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) +endif +ifndef NO_DIST_INSTALL + $(INSTALL) $(IFLAGS2) $^.pure $(FINAL_TARGET) +endif + +quantify: $(PROGRAM) +ifeq ($(CPP_PROG_LINK),1) + $(QUANTIFY) $(CCC) -o $^.quantify $(CXXFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) +else + $(QUANTIFY) $(CC) -o $^.quantify $(CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) +endif +ifndef NO_DIST_INSTALL + $(INSTALL) $(IFLAGS2) $^.quantify $(FINAL_TARGET) +endif + +# +# This allows us to create static versions of the shared libraries +# that are built using other static libraries. Confused...? +# +ifdef SHARED_LIBRARY_LIBS +ifeq (,$(GNU_LD)$(filter-out OS2 WINNT WINCE, $(OS_ARCH))) +ifneq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB)) +LOBJS += $(SHARED_LIBRARY_LIBS) +endif +else +ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Darwin,$(OS_ARCH))) +CLEANUP1 := | egrep -v '(________64ELEL_|__.SYMDEF)' +CLEANUP2 := rm -f ________64ELEL_ __.SYMDEF +else +CLEANUP2 := true +endif +SUB_LOBJS = $(shell for lib in $(SHARED_LIBRARY_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;) +endif +endif +ifdef MOZILLA_PROBE_LIBS +PROBE_LOBJS = $(shell for lib in $(MOZILLA_PROBE_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;) +endif +ifdef DTRACE_PROBE_OBJ +EXTRA_DEPS += $(DTRACE_PROBE_OBJ) +endif + +$(LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) Makefile Makefile.in + rm -f $@ +ifneq (,$(GNU_LD)$(filter-out OS2 WINNT WINCE, $(OS_ARCH))) +ifdef SHARED_LIBRARY_LIBS + @rm -f $(SUB_LOBJS) + @for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done +endif +endif + $(AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SUB_LOBJS) + $(RANLIB) $@ + @rm -f foodummyfilefoo $(SUB_LOBJS) + +ifeq (,$(filter-out WINNT WINCE, $(OS_ARCH))) +$(IMPORT_LIBRARY): $(SHARED_LIBRARY) +endif + +ifeq ($(OS_ARCH),OS2) +$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS) + rm -f $@ + echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@ + echo PROTMODE >> $@ + echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@ + echo EXPORTS >> $@ +ifeq ($(IS_COMPONENT),1) +ifeq ($(HAS_EXTRAEXPORTS),1) +ifndef MOZ_OS2_USE_DECLSPEC + $(FILTER) $(OBJS) $(SHARED_LIBRARY_LIBS) >> $@ +endif +else + echo _NSGetModule >> $@ +endif +else +ifndef MOZ_OS2_USE_DECLSPEC + $(FILTER) $(OBJS) $(SHARED_LIBRARY_LIBS) >> $@ +endif +endif + $(ADD_TO_DEF_FILE) + +ifdef MOZ_OS2_USE_DECLSPEC +$(IMPORT_LIBRARY): $(SHARED_LIBRARY) +else +$(IMPORT_LIBRARY): $(DEF_FILE) +endif + rm -f $@ + $(IMPLIB) $@ $^ + $(RANLIB) $@ +endif # OS/2 + +$(HOST_LIBRARY): $(HOST_OBJS) Makefile + rm -f $@ + $(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS) + $(HOST_RANLIB) $@ + +ifdef NO_LD_ARCHIVE_FLAGS +SUB_SHLOBJS = $(SUB_LOBJS) +endif + +ifdef HAVE_DTRACE +ifndef XP_MACOSX +ifdef DTRACE_PROBE_OBJ +ifndef DTRACE_LIB_DEPENDENT +$(DTRACE_PROBE_OBJ): $(OBJS) + dtrace -G -C -32 -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(OBJS) +endif +endif +endif +endif + +# On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files, +# so instead of deleting .o files after repacking them into a dylib, we make +# symlinks back to the originals. The symlinks are a no-op for stabs debugging, +# so no need to conditionalize on OS version or debugging format. + +$(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) Makefile Makefile.in +ifndef INCREMENTAL_LINKER + rm -f $@ +endif +ifeq ($(OS_ARCH),OpenVMS) + @if test ! -f $(VMS_SYMVEC_FILE); then \ + if test -f $(VMS_SYMVEC_FILE_MODULE); then \ + echo Creating specific component options file $(VMS_SYMVEC_FILE); \ + cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \ + fi; \ + fi +ifdef IS_COMPONENT + @if test ! -f $(VMS_SYMVEC_FILE); then \ + echo Creating generic component options file $(VMS_SYMVEC_FILE); \ + cp $(VMS_SYMVEC_FILE_COMP) $(VMS_SYMVEC_FILE); \ + fi +endif +endif # OpenVMS +ifdef NO_LD_ARCHIVE_FLAGS +ifdef SHARED_LIBRARY_LIBS + @rm -f $(SUB_SHLOBJS) + @for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done +ifeq ($(OS_ARCH),Darwin) + @echo Making symlinks to the original object files in the archive libraries $(SHARED_LIBRARY_LIBS) + @for lib in $(SHARED_LIBRARY_LIBS); do \ + libdir=`echo $$lib|sed -e 's,/[^/]*\.a,,'`; \ + ofiles=`$(AR_LIST) $${lib}`; \ + for ofile in $$ofiles; do \ + if [ -f $$libdir/$$ofile ]; then \ + rm -f $$ofile; \ + ln -s $$libdir/$$ofile $$ofile; \ + fi; \ + done; \ + done +endif +endif # SHARED_LIBRARY_LIBS +endif # NO_LD_ARCHIVE_FLAGS +ifdef DTRACE_LIB_DEPENDENT + @rm -f $(PROBE_LOBJS) + @for lib in $(MOZILLA_PROBE_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done +ifndef XP_MACOSX + dtrace -G -C -32 -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(PROBE_LOBJS) +endif + @for lib in $(MOZILLA_PROBE_LIBS); do \ + ofiles=`$(AR_LIST) $${lib}`; \ + $(AR_DELETE) $${lib} $$ofiles; \ + done + $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(PROBE_LOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) + @rm -f $(PROBE_LOBJS) + @rm -f $(DTRACE_PROBE_OBJ) + @for lib in $(MOZILLA_PROBE_LIBS); do \ + if [ -L $${lib} ]; then rm -f `readlink $${lib}`; fi; \ + done + @rm -f $(MOZILLA_PROBE_LIBS) + +else # ! DTRACE_LIB_DEPENDENT + $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(DTRACE_PROBE_OBJ) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) +endif # DTRACE_LIB_DEPENDENT + +ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) +ifdef MSMANIFEST_TOOL +ifdef EMBED_MANIFEST_AT + @if test -f $@.manifest; then \ + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \ + rm -f $@.manifest; \ + fi +endif # EMBED_MANIFEST_AT +endif # MSVC with manifest tool +endif # WINNT && !GCC +ifeq ($(OS_ARCH),Darwin) +else # non-Darwin + @rm -f $(SUB_SHLOBJS) +endif # Darwin + @rm -f foodummyfilefoo $(DELETE_AFTER_LINK) + chmod +x $@ +ifdef ENABLE_STRIP + $(STRIP) $@ +endif +ifdef MOZ_POST_DSO_LIB_COMMAND + $(MOZ_POST_DSO_LIB_COMMAND) $@ +endif + +ifdef MOZ_AUTO_DEPS +ifdef COMPILER_DEPEND +ifeq (__SunOS,$(GNU_CC)_$(GNU_CXX)_$(OS_ARCH)) +_MDDEPFILE = $(MDDEPDIR)/$(@F).pp + +define MAKE_DEPS_AUTO_CC +if test -d $(@D); then \ + echo "Building deps for $< using Sun Studio cc"; \ + $(CC) $(COMPILE_CFLAGS) -xM $< >$(_MDDEPFILE) ; \ +fi +endef +define MAKE_DEPS_AUTO_CXX +if test -d $(@D); then \ + echo "Building deps for $< using Sun Studio CC"; \ + $(CXX) $(COMPILE_CXXFLAGS) -xM $< >$(_MDDEPFILE) ; \ +fi +endef +endif # Sun Studio on Solaris +else # COMPILER_DEPEND +# +# Generate dependencies on the fly +# +_MDDEPFILE = $(MDDEPDIR)/$(@F).pp + +define MAKE_DEPS_AUTO +if test -d $(@D); then \ + echo "Building deps for $<"; \ + $(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f- $(DEFINES) $(ACDEFINES) $(INCLUDES) $< 2>/dev/null | sed -e "s|^[^ ]*/||" > $(_MDDEPFILE) ; \ +fi +endef + +MAKE_DEPS_AUTO_CC = $(MAKE_DEPS_AUTO) +MAKE_DEPS_AUTO_CXX = $(MAKE_DEPS_AUTO) + +endif # COMPILER_DEPEND + +endif # MOZ_AUTO_DEPS + +ifdef MOZ_MEMORY +ifeq ($(OS_ARCH),SunOS) +SOLARIS_JEMALLOC_LDFLAGS = $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib) +endif +endif + +# Rules for building native targets must come first because of the host_ prefix +host_%.$(OBJ_SUFFIX): %.c Makefile Makefile.in + $(REPORT_BUILD) + $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS) + +host_%.$(OBJ_SUFFIX): %.cpp Makefile Makefile.in + $(REPORT_BUILD) + $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS) + +host_%.$(OBJ_SUFFIX): %.cc Makefile Makefile.in + $(REPORT_BUILD) + $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS) + +host_%.$(OBJ_SUFFIX): %.m Makefile Makefile.in + $(REPORT_BUILD) + $(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS) + +host_%.$(OBJ_SUFFIX): %.mm Makefile Makefile.in + $(REPORT_BUILD) + $(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS) + +%: %.c Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CC) + $(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTOPTION)$@ $(_VPATH_SRCS) + +%.$(OBJ_SUFFIX): %.c Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CC) + $(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(_VPATH_SRCS) + +moc_%.cpp: %.h Makefile Makefile.in + $(MOC) $< $(OUTOPTION)$@ + +ifdef ASFILES +# The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept +# a '-c' flag. +%.$(OBJ_SUFFIX): %.$(ASM_SUFFIX) Makefile Makefile.in + $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS) +endif + +%.$(OBJ_SUFFIX): %.S Makefile Makefile.in + $(AS) -o $@ $(ASFLAGS) -c $< + +%: %.cpp Makefile Makefile.in + @$(MAKE_DEPS_AUTO_CXX) + $(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS) + +# +# Please keep the next two rules in sync. +# +%.$(OBJ_SUFFIX): %.cc Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) + +%.$(OBJ_SUFFIX): %.cpp Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) +ifdef STRICT_CPLUSPLUS_SUFFIX + echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc + $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc + rm -f t_$*.cc +else + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) +endif #STRICT_CPLUSPLUS_SUFFIX + +$(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS) + +$(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m Makefile Makefile.in + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CC) + $(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(_VPATH_SRCS) + +%.s: %.cpp + $(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) + +%.s: %.cc + $(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) + +%.s: %.c + $(CC) -S $(COMPILE_CFLAGS) $(_VPATH_SRCS) + +%.i: %.cpp + $(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i + +%.i: %.cc + $(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i + +%.i: %.c + $(CC) -C -E $(COMPILE_CFLAGS) $(_VPATH_SRCS) > $*.i + +%.i: %.mm + $(CCC) -C -E $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS) > $*.i + +%.res: %.rc + @echo Creating Resource file: $@ +ifeq ($(OS_ARCH),OS2) + $(RC) $(RCFLAGS:-D%=-d %) -i $(subst /,\,$(srcdir)) -r $< $@ +else +ifdef GNU_CC + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) $(OUTOPTION)$@ $(_VPATH_SRCS) +else + $(RC) $(RCFLAGS) -r $(DEFINES) $(INCLUDES) $(OUTOPTION)$@ $(_VPATH_SRCS) +endif +endif + +# need 3 separate lines for OS/2 +%: %.pl + rm -f $@ + cp $< $@ + chmod +x $@ + +%: %.sh + rm -f $@; cp $< $@; chmod +x $@ + +# Cancel these implicit rules +# +%: %,v + +%: RCS/%,v + +%: s.% + +%: SCCS/s.% + +############################################################################### +# Java rules +############################################################################### +ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) +SEP := ; +else +SEP := : +endif + +EMPTY := +SPACE := $(EMPTY) $(EMPTY) + +# Cygwin and MSYS have their own special path form, but javac expects the source +# and class paths to be in the DOS form (i.e. e:/builds/...). This function +# does the appropriate conversion on Windows, but is a noop on other systems. +ifeq (,$(filter-out WINNT WINCE, $(HOST_OS_ARCH))) +ifdef CYGWIN_WRAPPER +normalizepath = $(foreach p,$(1),$(shell cygpath -m $(p))) +else +# assume MSYS +# We use 'pwd -W' to get DOS form of the path. However, since the given path +# could be a file or a non-existent path, we cannot call 'pwd -W' directly +# on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W' +# on it, then merge with the rest of the path. +root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|") +non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|") +normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(shell cd $(call root-path,$(1)) && pwd -W)$(call non-root-path,$(1)),$(1))) +endif +else +normalizepath = $(1) +endif + +_srcdir = $(call normalizepath,$(srcdir)) +ifdef JAVA_SOURCEPATH +SP = $(subst $(SPACE),$(SEP),$(call normalizepath,$(strip $(JAVA_SOURCEPATH)))) +_JAVA_SOURCEPATH = ".$(SEP)$(_srcdir)$(SEP)$(SP)" +else +_JAVA_SOURCEPATH = ".$(SEP)$(_srcdir)" +endif + +ifdef JAVA_CLASSPATH +CP = $(subst $(SPACE),$(SEP),$(call normalizepath,$(strip $(JAVA_CLASSPATH)))) +_JAVA_CLASSPATH = ".$(SEP)$(CP)" +else +_JAVA_CLASSPATH = . +endif + +_JAVA_DIR = _java +$(_JAVA_DIR):: + $(NSINSTALL) -D $@ + +$(_JAVA_DIR)/%.class: %.java Makefile Makefile.in $(_JAVA_DIR) + $(CYGWIN_WRAPPER) $(JAVAC) $(JAVAC_FLAGS) -classpath $(_JAVA_CLASSPATH) \ + -sourcepath $(_JAVA_SOURCEPATH) -d $(_JAVA_DIR) $(_VPATH_SRCS) + +$(JAVA_LIBRARY): $(addprefix $(_JAVA_DIR)/,$(JAVA_SRCS:.java=.class)) Makefile Makefile.in + $(JAR) cf $@ -C $(_JAVA_DIR) . + +GARBAGE_DIRS += $(_JAVA_DIR) + +############################################################################### +# Update Makefiles +############################################################################### + +# In GNU make 3.80, makefiles must use the /cygdrive syntax, even if we're +# processing them with AS perl. See bug 232003 +ifdef AS_PERL +CYGWIN_TOPSRCDIR = -nowrap -p $(topsrcdir) -wrap +endif + +# Note: Passing depth to make-makefile is optional. +# It saves the script some work, though. +Makefile: Makefile.in + @$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) + +ifdef SUBMAKEFILES +# VPATH does not work on some machines in this case, so add $(srcdir) +$(SUBMAKEFILES): % : $(srcdir)/%.in + $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) $@ +endif + +ifdef AUTOUPDATE_CONFIGURE +$(topsrcdir)/configure: $(topsrcdir)/configure.in + (cd $(topsrcdir) && $(AUTOCONF)) && (cd $(DEPTH) && ./config.status --recheck) +endif + +############################################################################### +# Bunch of things that extend the 'export' rule (in order): +############################################################################### + +################################################################################ +# Copy each element of EXPORTS to $(PUBLIC) + +ifneq ($(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),) +$(SDK_PUBLIC) $(PUBLIC):: + $(NSINSTALL) -D $@ +endif + +ifdef MOZ_JAVAXPCOM +ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),) +$(JAVA_DIST_DIR):: + $(NSINSTALL) -D $@ +endif +endif + +ifneq ($(XPI_NAME),) +$(FINAL_TARGET): + $(NSINSTALL) -D $@ + +export:: $(FINAL_TARGET) +endif + +ifndef NO_DIST_INSTALL +ifneq ($(EXPORTS),) +export:: $(EXPORTS) $(PUBLIC) + $(INSTALL) $(IFLAGS1) $^ +endif + +ifneq ($(SDK_HEADERS),) +export:: $(SDK_HEADERS) $(SDK_PUBLIC) + $(INSTALL) $(IFLAGS1) $^ + +export:: $(SDK_HEADERS) $(PUBLIC) + $(INSTALL) $(IFLAGS1) $^ +endif +endif # NO_DIST_INSTALL + +################################################################################ +# Copy each element of PREF_JS_EXPORTS + +ifdef GRE_MODULE +PREF_DIR = greprefs +else +ifneq (,$(XPI_NAME)$(LIBXUL_SDK)) +PREF_DIR = defaults/preferences +else +PREF_DIR = defaults/pref +endif +endif + +ifneq ($(PREF_JS_EXPORTS),) +# on win32, pref files need CRLF line endings... see bug 206029 +ifeq (WINNT,$(OS_ARCH)) +PREF_PPFLAGS = --line-endings=crlf +endif + +ifndef NO_DIST_INSTALL +$(FINAL_TARGET)/$(PREF_DIR): + $(NSINSTALL) -D $@ + +libs:: $(FINAL_TARGET)/$(PREF_DIR) $(PREF_JS_EXPORTS) + $(EXIT_ON_ERROR) \ + for i in $(PREF_JS_EXPORTS); do \ + dest=$(FINAL_TARGET)/$(PREF_DIR)/`basename $$i`; \ + $(RM) -f $$dest; \ + $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \ + done +endif +endif + +################################################################################ +# Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig + +ifneq ($(AUTOCFG_JS_EXPORTS),) +$(FINAL_TARGET)/defaults/autoconfig:: + $(NSINSTALL) -D $@ + +ifndef NO_DIST_INSTALL +export:: $(AUTOCFG_JS_EXPORTS) $(FINAL_TARGET)/defaults/autoconfig + $(INSTALL) $(IFLAGS1) $^ +endif + +endif +################################################################################ +# Export the elements of $(XPIDLSRCS) & $(SDK_XPIDLSRCS), +# generating .h and .xpt files and moving them to the appropriate places. + +ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),) + +export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) + +ifndef XPIDL_MODULE +XPIDL_MODULE = $(MODULE) +endif + +ifeq ($(XPIDL_MODULE),) # we need $(XPIDL_MODULE) to make $(XPIDL_MODULE).xpt +export:: FORCE + @echo + @echo "*** Error processing XPIDLSRCS:" + @echo "Please define MODULE or XPIDL_MODULE when defining XPIDLSRCS," + @echo "so we have a module name to use when creating MODULE.xpt." + @echo; sleep 2; false +endif + +$(SDK_IDL_DIR) $(IDL_DIR):: + $(NSINSTALL) -D $@ + +# generate .h files from into $(XPIDL_GEN_DIR), then export to $(PUBLIC); +# warn against overriding existing .h file. +$(XPIDL_GEN_DIR)/.done: + @if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi + @touch $@ + +# don't depend on $(XPIDL_GEN_DIR), because the modification date changes +# with any addition to the directory, regenerating all .h files -> everything. + +$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done + $(REPORT_BUILD) + $(ELOG) $(XPIDL_COMPILE) -m header -w $(XPIDL_FLAGS) -o $(XPIDL_GEN_DIR)/$* $(_VPATH_SRCS) + @if test -n "$(findstring $*.h, $(EXPORTS) $(SDK_HEADERS))"; \ + then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi + +ifndef NO_GEN_XPT +# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link +# into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components. +$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done + $(REPORT_BUILD) + $(ELOG) $(XPIDL_COMPILE) -m typelib -w $(XPIDL_FLAGS) -e $@ -d $(MDDEPDIR)/$*.pp $(_VPATH_SRCS) + +# no need to link together if XPIDLSRCS contains only XPIDL_MODULE +ifneq ($(XPIDL_MODULE).idl,$(strip $(XPIDLSRCS))) +$(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS) $(SDK_XPIDLSRCS)) Makefile.in Makefile $(XPIDL_LINK) + $(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS) $(SDK_XPIDLSRCS)) +endif # XPIDL_MODULE.xpt != XPIDLSRCS + +libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt +ifndef NO_DIST_INSTALL + $(INSTALL) $(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(FINAL_TARGET)/components +endif + +endif # NO_GEN_XPT + +GARBAGE_DIRS += $(XPIDL_GEN_DIR) + +endif # XPIDLSRCS || SDK_XPIDLSRCS + +ifneq ($(XPIDLSRCS),) +# export .idl files to $(IDL_DIR) +ifndef NO_DIST_INSTALL +export:: $(XPIDLSRCS) $(IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ + +export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(PUBLIC) + $(INSTALL) $(IFLAGS1) $^ +endif # NO_DIST_INSTALL + +endif # XPIDLSRCS + + + +# +# General rules for exporting idl files. +# +# WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build. +# Bug to fix idl dependency problems w/o this extra build pass is +# http://bugzilla.mozilla.org/show_bug.cgi?id=145777 +# +$(IDL_DIR):: + $(NSINSTALL) -D $@ + +export-idl:: $(SUBMAKEFILES) $(MAKE_DIRS) + +ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),) +ifndef NO_DIST_INSTALL +export-idl:: $(XPIDLSRCS) $(SDK_XPIDLSRCS) $(IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ +endif +endif + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) + + + + +ifneq ($(SDK_XPIDLSRCS),) +# export .idl files to $(IDL_DIR) & $(SDK_IDL_DIR) +ifndef NO_DIST_INSTALL +export:: $(SDK_XPIDLSRCS) $(IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ + +export:: $(SDK_XPIDLSRCS) $(SDK_IDL_DIR) + $(INSTALL) $(IFLAGS1) $^ + +export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(SDK_XPIDLSRCS)) $(PUBLIC) + $(INSTALL) $(IFLAGS1) $^ + +export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(SDK_XPIDLSRCS)) $(SDK_PUBLIC) + $(INSTALL) $(IFLAGS1) $^ +endif + +endif # SDK_XPIDLSRCS + + + +ifdef MOZ_JAVAXPCOM +ifneq ($(XPIDLSRCS)$(SDK_XPIDLSRCS),) + +JAVA_XPIDLSRCS = $(XPIDLSRCS) $(SDK_XPIDLSRCS) + +# A single IDL file can contain multiple interfaces, which result in multiple +# Java interface files. So use hidden dependency files. +JAVADEPFILES = $(addprefix $(JAVA_GEN_DIR)/.,$(JAVA_XPIDLSRCS:.idl=.java.pp)) + +$(JAVA_GEN_DIR): + $(NSINSTALL) -D $@ +GARBAGE_DIRS += $(JAVA_GEN_DIR) + +# generate .java files into _javagen/[package name dirs] +_JAVA_GEN_DIR = $(JAVA_GEN_DIR)/$(JAVA_IFACES_PKG_NAME) +$(_JAVA_GEN_DIR): + $(NSINSTALL) -D $@ + +$(JAVA_GEN_DIR)/.%.java.pp: %.idl $(XPIDL_COMPILE) $(_JAVA_GEN_DIR) + $(REPORT_BUILD) + $(ELOG) $(XPIDL_COMPILE) -m java -w -I$(srcdir) -I$(IDL_DIR) -o $(_JAVA_GEN_DIR)/$* $(_VPATH_SRCS) + @touch $@ + +# "Install" generated Java interfaces. We segregate them based on the XPI_NAME. +# If XPI_NAME is not set, install into the "default" directory. +ifneq ($(XPI_NAME),) +JAVA_INSTALL_DIR = $(JAVA_DIST_DIR)/$(XPI_NAME) +else +JAVA_INSTALL_DIR = $(JAVA_DIST_DIR)/default +endif + +$(JAVA_INSTALL_DIR): + $(NSINSTALL) -D $@ + +export:: $(JAVA_DIST_DIR) $(JAVADEPFILES) $(JAVA_INSTALL_DIR) + (cd $(JAVA_GEN_DIR) && tar $(TAR_CREATE_FLAGS) - .) | (cd $(JAVA_INSTALL_DIR) && tar -xf -) + +endif # XPIDLSRCS || SDK_XPIDLSRCS +endif # MOZ_JAVAXPCOM + +################################################################################ +# Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components +ifdef EXTRA_COMPONENTS +libs:: $(EXTRA_COMPONENTS) +ifndef NO_DIST_INSTALL + $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components +endif + +endif + +ifdef EXTRA_PP_COMPONENTS +libs:: $(EXTRA_PP_COMPONENTS) +ifndef NO_DIST_INSTALL + $(EXIT_ON_ERROR) \ + $(NSINSTALL) -D $(FINAL_TARGET)/components; \ + for i in $^; do \ + dest=$(FINAL_TARGET)/components/`basename $$i`; \ + $(RM) -f $$dest; \ + $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \ + done +endif + +endif + +################################################################################ +# Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules +ifdef EXTRA_JS_MODULES +libs:: $(EXTRA_JS_MODULES) +ifndef NO_DIST_INSTALL + $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/modules +endif + +endif + +ifdef EXTRA_PP_JS_MODULES +libs:: $(EXTRA_PP_JS_MODULES) +ifndef NO_DIST_INSTALL + $(EXIT_ON_ERROR) \ + $(NSINSTALL) -D $(FINAL_TARGET)/modules; \ + for i in $^; do \ + dest=$(FINAL_TARGET)/modules/`basename $$i`; \ + $(RM) -f $$dest; \ + $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \ + done +endif + +endif + +################################################################################ +# SDK + +ifneq (,$(SDK_LIBRARY)) +$(SDK_LIB_DIR):: + $(NSINSTALL) -D $@ + +ifndef NO_DIST_INSTALL +libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR) + $(INSTALL) $(IFLAGS2) $^ +endif + +endif # SDK_LIBRARY + +ifneq (,$(SDK_BINARY)) +$(SDK_BIN_DIR):: + $(NSINSTALL) -D $@ + +ifndef NO_DIST_INSTALL +libs:: $(SDK_BINARY) $(SDK_BIN_DIR) + $(INSTALL) $(IFLAGS2) $^ +endif + +endif # SDK_BINARY + +################################################################################ +# CHROME PACKAGING + +JAR_MANIFEST := $(srcdir)/jar.mn + +chrome:: + $(MAKE) realchrome + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) + +$(FINAL_TARGET)/chrome: + $(NSINSTALL) -D $@ + +# libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome +# ifndef NO_DIST_INSTALL +# @$(EXIT_ON_ERROR) \ +# if test -f $(JAR_MANIFEST); then \ +# $(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \ +# $(QUIET) -j $(FINAL_TARGET)/chrome \ +# $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \ +# $(JAR_MANIFEST); \ +# fi +# endif + +ifneq ($(DIST_FILES),) +libs:: $(DIST_FILES) + @$(EXIT_ON_ERROR) \ + for f in $(DIST_FILES); do \ + dest=$(FINAL_TARGET)/`basename $$f`; \ + $(RM) -f $$dest; \ + $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \ + $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \ + $(srcdir)/$$f > $$dest; \ + done +endif + +ifneq ($(DIST_CHROME_FILES),) +libs:: $(DIST_CHROME_FILES) + @$(EXIT_ON_ERROR) \ + for f in $(DIST_CHROME_FILES); do \ + dest=$(FINAL_TARGET)/chrome/`basename $$f`; \ + $(RM) -f $$dest; \ + $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \ + $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \ + $(srcdir)/$$f > $$dest; \ + done +endif + +ifneq ($(XPI_PKGNAME),) +libs realchrome:: +ifdef STRIP_XPI +ifndef MOZ_DEBUG + @echo "Stripping $(XPI_PKGNAME) package directory..." + @echo $(FINAL_TARGET) + @cd $(FINAL_TARGET) && find . ! -type d \ + ! -name "*.js" \ + ! -name "*.xpt" \ + ! -name "*.gif" \ + ! -name "*.jpg" \ + ! -name "*.png" \ + ! -name "*.xpm" \ + ! -name "*.txt" \ + ! -name "*.rdf" \ + ! -name "*.sh" \ + ! -name "*.properties" \ + ! -name "*.dtd" \ + ! -name "*.html" \ + ! -name "*.xul" \ + ! -name "*.css" \ + ! -name "*.xml" \ + ! -name "*.jar" \ + ! -name "*.dat" \ + ! -name "*.tbl" \ + ! -name "*.src" \ + ! -name "*.reg" \ + $(PLATFORM_EXCLUDE_LIST) \ + -exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \; +endif +endif + @echo "Packaging $(XPI_PKGNAME).xpi..." + cd $(FINAL_TARGET) && $(ZIP) -qr ../$(XPI_PKGNAME).xpi * +endif + +ifdef INSTALL_EXTENSION_ID +ifndef XPI_NAME +$(error XPI_NAME must be set for INSTALL_EXTENSION_ID) +endif + +libs:: + $(RM) -rf "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" + $(NSINSTALL) -D "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" + cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - . | (cd "../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf -) + +endif + +ifneq (,$(filter flat symlink,$(MOZ_CHROME_FILE_FORMAT))) +_JAR_REGCHROME_DISABLE_JAR=1 +else +_JAR_REGCHROME_DISABLE_JAR=0 +endif + +REGCHROME = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \ + $(if $(filter gtk2,$(MOZ_WIDGET_TOOLKIT)),-x) \ + $(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(FINAL_TARGET)/chrome/installed-chrome.txt \ + $(_JAR_REGCHROME_DISABLE_JAR) + +REGCHROME_INSTALL = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \ + $(if $(filter gtk2,$(MOZ_WIDGET_TOOLKIT)),-x) \ + $(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(DESTDIR)$(mozappdir)/chrome/installed-chrome.txt \ + $(_JAR_REGCHROME_DISABLE_JAR) + + +################################################################################ +# Testing frameworks support +################################################################################ + +ifdef ENABLE_TESTS + +ifdef XPCSHELL_TESTS +ifndef MODULE +$(error Must define MODULE when defining XPCSHELL_TESTS.) +endif + +# Test file installation +libs:: + @$(EXIT_ON_ERROR) \ + for testdir in $(XPCSHELL_TESTS); do \ + $(INSTALL) \ + $(srcdir)/$$testdir/*.js \ + $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \ + done + +# Path formats on Windows are hard. We require a topsrcdir formatted so that +# it may be passed to nsILocalFile.initWithPath (in other words, an absolute +# path of the form X:\path\to\topsrcdir), which we store in NATIVE_TOPSRCDIR. +# We require a forward-slashed path to topsrcdir so that it may be combined +# with a relative forward-slashed path for loading scripts, both dynamically +# and statically for head/test/tail JS files. Of course, on non-Windows none +# of this matters, and things will work correctly because everything's +# forward-slashed, everywhere, always. +ifdef CYGWIN_WRAPPER +NATIVE_TOPSRCDIR := `cygpath -wa $(topsrcdir)` +FWDSLASH_TOPSRCDIR := `cygpath -ma $(topsrcdir)` +else +FWDSLASH_TOPSRCDIR := $(topsrcdir) +ifeq ($(HOST_OS_ARCH),WINNT) +NATIVE_TOPSRCDIR := $(subst /,\\,$(WIN_TOP_SRC)) +else +NATIVE_TOPSRCDIR := $(topsrcdir) +endif +endif # CYGWIN_WRAPPER + +# Test execution +check:: + @$(EXIT_ON_ERROR) \ + for testdir in $(XPCSHELL_TESTS); do \ + $(RUN_TEST_PROGRAM) \ + $(topsrcdir)/tools/test-harness/xpcshell-simple/test_all.sh \ + $(DIST)/bin/xpcshell \ + $(FWDSLASH_TOPSRCDIR) \ + $(NATIVE_TOPSRCDIR) \ + $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \ + done + +# Test execution +check-interactive:: + @$(EXIT_ON_ERROR) \ + $(RUN_TEST_PROGRAM) \ + $(topsrcdir)/tools/test-harness/xpcshell-simple/test_one.sh \ + $(DIST)/bin/xpcshell \ + $(FWDSLASH_TOPSRCDIR) \ + $(NATIVE_TOPSRCDIR) \ + $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \ + $(SOLO_FILE) 1; + +# Test execution +check-one:: + @$(EXIT_ON_ERROR) \ + $(RUN_TEST_PROGRAM) \ + $(topsrcdir)/tools/test-harness/xpcshell-simple/test_one.sh \ + $(DIST)/bin/xpcshell \ + $(FWDSLASH_TOPSRCDIR) \ + $(NATIVE_TOPSRCDIR) \ + $(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \ + $(SOLO_FILE) 0; + +endif # XPCSHELL_TESTS + +endif # ENABLE_TESTS + + +############################################################################# +# Dependency system +############################################################################# +ifdef COMPILER_DEPEND +depend:: + @echo "$(MAKE): No need to run depend target.\ + Using compiler-based depend." 1>&2 +ifeq ($(GNU_CC)$(GNU_CXX),) +# Non-GNU compilers + @echo "`echo '$(MAKE):'|sed 's/./ /g'`"\ + '(Compiler-based depend was turned on by "--enable-md".)' 1>&2 +else +# GNU compilers + @space="`echo '$(MAKE): '|sed 's/./ /g'`";\ + echo "$$space"'Since you are using a GNU compiler,\ + it is on by default.' 1>&2; \ + echo "$$space"'To turn it off, pass --disable-md to configure.' 1>&2 +endif + +else # ! COMPILER_DEPEND + +ifndef MOZ_AUTO_DEPS + +define MAKE_DEPS_NOAUTO + $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f- $(DEFINES) $(ACDEFINES) $(INCLUDES) $< 2>/dev/null | sed -e "s|^[^ ]*/||" > $@ +endef + +$(MDDEPDIR)/%.pp: %.c + $(REPORT_BUILD) + @$(MAKE_DEPS_NOAUTO) + +$(MDDEPDIR)/%.pp: %.cpp + $(REPORT_BUILD) + @$(MAKE_DEPS_NOAUTO) + +$(MDDEPDIR)/%.pp: %.s + $(REPORT_BUILD) + @$(MAKE_DEPS_NOAUTO) + +ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)) +depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MDDEPFILES) +else +depend:: $(SUBMAKEFILES) +endif + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) + +dependclean:: $(SUBMAKEFILES) + rm -f $(MDDEPFILES) + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) + +endif # MOZ_AUTO_DEPS + +endif # COMPILER_DEPEND + + +############################################################################# +# MDDEPDIR is the subdirectory where all the dependency files are placed. +# This uses a make rule (instead of a macro) to support parallel +# builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two +# processes could simultaneously try to create the same directory. +# +# We use $(CURDIR) in the rule's target to ensure that we don't find +# a dependency directory in the source tree via VPATH (perhaps from +# a previous build in the source tree) and thus neglect to create a +# dependency directory in the object directory, where we really need +# it. + +$(CURDIR)/$(MDDEPDIR): + @if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi + +ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS))) +ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)) +MDDEPEND_FILES := $(strip $(wildcard $(MDDEPDIR)/*.pp)) + +ifneq (,$(MDDEPEND_FILES)) +ifdef PERL +# The script mddepend.pl checks the dependencies and writes to stdout +# one rule to force out-of-date objects. For example, +# foo.o boo.o: FORCE +# The script has an advantage over including the *.pp files directly +# because it handles the case when header files are removed from the build. +# 'make' would complain that there is no way to build missing headers. +ifeq (,$(MAKE_RESTARTS)) +$(MDDEPDIR)/.all.pp: FORCE + @$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES) +endif +-include $(MDDEPDIR)/.all.pp +else +include $(MDDEPEND_FILES) +endif +endif + +endif +endif +############################################################################# + +-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-rules.mk +-include $(MY_RULES) + +# +# This speeds up gmake's processing if these files don't exist. +# +$(MY_CONFIG) $(MY_RULES): + @touch $@ + +# +# Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG) +# or in $(MY_RULES) +# +ifdef ETAGS +ifneq ($(CSRCS)$(CPPSRCS)$(HEADERS),) +all:: TAGS +TAGS:: $(CSRCS) $(CPPSRCS) $(HEADERS) + $(ETAGS) $(CSRCS) $(CPPSRCS) $(HEADERS) +endif +endif + +################################################################################ +# Special gmake rules. +################################################################################ + + +# +# Disallow parallel builds with MSVC < 8 +# +ifneq (,$(filter 1200 1300 1310,$(_MSC_VER))) +.NOTPARALLEL: +endif + +# +# 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: + +# +# Fake targets. Always run these rules, even if a file/directory with that +# name already exists. +# +.PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one + +# Used as a dependency to force targets to rebuild +FORCE: + +# Delete target if error occurs when building target +.DELETE_ON_ERROR: + +# Properly set LIBPATTERNS for the platform +.LIBPATTERNS = $(if $(IMPORT_LIB_SUFFIX),$(LIB_PREFIX)%.$(IMPORT_LIB_SUFFIX)) $(LIB_PREFIX)%.$(LIB_SUFFIX) $(DLL_PREFIX)%$(DLL_SUFFIX) + +tags: TAGS + +TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h) + -etags $(CSRCS) $(CPPSRCS) $(wildcard *.h) + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +echo-variable-%: + @echo $($*) + +echo-tiers: + @echo $(TIERS) + +echo-dirs: + @echo $(DIRS) + +echo-module: + @echo $(MODULE) + +echo-requires: + @echo $(REQUIRES) + +echo-requires-recursive:: +ifdef _REPORT_ALL_DIRS + @echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES) +else + @$(if $(REQUIRES),echo $(subst $(topsrcdir)/,,$(srcdir)): $(MODULE): $(REQUIRES)) +endif + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +echo-depth-path: + @$(topsrcdir)/build/unix/print-depth-path.sh + +echo-module-name: + @$(topsrcdir)/build/package/rpm/print-module-name.sh + +echo-module-filelist: + @$(topsrcdir)/build/package/rpm/print-module-filelist.sh + +showtargs: +ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS))) + @echo -------------------------------------------------------------------------------- + @echo "PROGRAM = $(PROGRAM)" + @echo "SIMPLE_PROGRAMS = $(SIMPLE_PROGRAMS)" + @echo "LIBRARY = $(LIBRARY)" + @echo "SHARED_LIBRARY = $(SHARED_LIBRARY)" + @echo "SHARED_LIBRARY_LIBS = $(SHARED_LIBRARY_LIBS)" + @echo "LIBS = $(LIBS)" + @echo "DEF_FILE = $(DEF_FILE)" + @echo "IMPORT_LIBRARY = $(IMPORT_LIBRARY)" + @echo "STATIC_LIBS = $(STATIC_LIBS)" + @echo "SHARED_LIBS = $(SHARED_LIBS)" + @echo "EXTRA_DSO_LIBS = $(EXTRA_DSO_LIBS)" + @echo "EXTRA_DSO_LDOPTS = $(EXTRA_DSO_LDOPTS)" + @echo "DEPENDENT_LIBS = $(DEPENDENT_LIBS)" + @echo -------------------------------------------------------------------------------- +endif + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +showbuild: + @echo "MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)" + @echo "MOZ_WIDGET_TOOLKIT = $(MOZ_WIDGET_TOOLKIT)" + @echo "CC = $(CC)" + @echo "CXX = $(CXX)" + @echo "CCC = $(CCC)" + @echo "CPP = $(CPP)" + @echo "LD = $(LD)" + @echo "AR = $(AR)" + @echo "IMPLIB = $(IMPLIB)" + @echo "FILTER = $(FILTER)" + @echo "MKSHLIB = $(MKSHLIB)" + @echo "MKCSHLIB = $(MKCSHLIB)" + @echo "RC = $(RC)" + @echo "CFLAGS = $(CFLAGS)" + @echo "OS_CFLAGS = $(OS_CFLAGS)" + @echo "COMPILE_CFLAGS = $(COMPILE_CFLAGS)" + @echo "CXXFLAGS = $(CXXFLAGS)" + @echo "OS_CXXFLAGS = $(OS_CXXFLAGS)" + @echo "COMPILE_CXXFLAGS = $(COMPILE_CXXFLAGS)" + @echo "COMPILE_CMFLAGS = $(COMPILE_CMFLAGS)" + @echo "COMPILE_CMMFLAGS = $(COMPILE_CMMFLAGS)" + @echo "LDFLAGS = $(LDFLAGS)" + @echo "OS_LDFLAGS = $(OS_LDFLAGS)" + @echo "DSO_LDOPTS = $(DSO_LDOPTS)" + @echo "OS_INCLUDES = $(OS_INCLUDES)" + @echo "OS_LIBS = $(OS_LIBS)" + @echo "EXTRA_LIBS = $(EXTRA_LIBS)" + @echo "BIN_FLAGS = $(BIN_FLAGS)" + @echo "INCLUDES = $(INCLUDES)" + @echo "DEFINES = $(DEFINES)" + @echo "ACDEFINES = $(ACDEFINES)" + @echo "BIN_SUFFIX = $(BIN_SUFFIX)" + @echo "LIB_SUFFIX = $(LIB_SUFFIX)" + @echo "DLL_SUFFIX = $(DLL_SUFFIX)" + @echo "IMPORT_LIB_SUFFIX = $(IMPORT_LIB_SUFFIX)" + @echo "INSTALL = $(INSTALL)" + +showhost: + @echo "HOST_CC = $(HOST_CC)" + @echo "HOST_CXX = $(HOST_CXX)" + @echo "HOST_CFLAGS = $(HOST_CFLAGS)" + @echo "HOST_LDFLAGS = $(HOST_LDFLAGS)" + @echo "HOST_LIBS = $(HOST_LIBS)" + @echo "HOST_EXTRA_LIBS = $(HOST_EXTRA_LIBS)" + @echo "HOST_EXTRA_DEPS = $(HOST_EXTRA_DEPS)" + @echo "HOST_PROGRAM = $(HOST_PROGRAM)" + @echo "HOST_OBJS = $(HOST_OBJS)" + @echo "HOST_PROGOBJS = $(HOST_PROGOBJS)" + @echo "HOST_LIBRARY = $(HOST_LIBRARY)" + +showbuildmods:: + @echo "Build Modules = $(BUILD_MODULES)" + @echo "Module dirs = $(BUILD_MODULE_DIRS)" + +zipmakes: +ifneq (,$(filter $(PROGRAM) $(SIMPLE_PROGRAMS) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS))) + zip $(DEPTH)/makefiles $(subst $(topsrcdir),$(MOZ_SRC)/mozilla,$(srcdir)/Makefile.in) +endif + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +documentation: + @cd $(DEPTH) + $(DOXYGEN) $(DEPTH)/config/doxygen.cfg + +check:: $(SUBMAKEFILES) $(MAKE_DIRS) + +$(LOOP_OVER_PARALLEL_DIRS) + +$(LOOP_OVER_DIRS) + +$(LOOP_OVER_TOOL_DIRS) diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/system-headers b/tools/node_modules/expresso/deps/jscoverage/js/config/system-headers new file mode 100644 index 0000000..9d61c0e --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/system-headers @@ -0,0 +1,1038 @@ +A4Stuff.h +activscp.h +AEDataModel.h +AEObjects.h +AEPackObject.h +AERegistry.h +AEUtils.h +afxcmn.h +afxcoll.h +afxcview.h +afxdisp.h +afxdtctl.h +afxext.h +afxmt.h +afxpriv.h +afxtempl.h +afxwin.h +algorithm +Aliases.h +all.h +alloca.h +alloc.h +alsa/asoundlib.h +alsa/pcm.h +alsa/mixer.h +ansi_parms.h +a.out.h +app/Cursor.h +Appearance.h +AppFileInfo.h +AppKit.h +AppleEvents.h +Application.h +app/Message.h +app/MessageRunner.h +arpa/inet.h +arpa/nameser.h +asm/sigcontext.h +asm/signal.h +ASRegistry.h +assert.h +atk/atk.h +atlbase.h +atlcom.h +atlconv.h +atlctl.cpp +atlctl.h +ATLCTL.H +atlhost.h +atlimpl.cpp +atlwin.cpp +ATSTypes.h +ATSUnicode.h +Balloons.h +base/pblock.h +base/PCR_Base.h +base/session.h +basetyps.h +be/app/Application.h +Beep.h +be/kernel/image.h +be/kernel/OS.h +bfd.h +Bitmap.h +bsd/libc.h +bsd/syscall.h +bstring.h +builtin.h +Button.h +byteswap.h +#if MOZ_ENABLE_LIBXUL!=1 +#define WRAP_CAIRO_HEADERS +#endif +#if MOZ_TREE_CAIRO!=1 +#define WRAP_CAIRO_HEADERS +#endif +#ifdef WRAP_CAIRO_HEADERS +cairo.h +cairo-atsui.h +cairo-beos.h +cairo-ft.h +cairo-glitz.h +cairo-os2.h +cairo-pdf.h +cairo-ps.h +cairo-quartz.h +cairo-win32.h +cairo-xlib.h +cairo-xlib-xrender.h +cairo-directfb.h +cairo-qpainter.h +#endif +dfiff.h +fusion/reactor.h +fusion/property.h +fusion/conf.h +fusion/build.h +fusion/hash.h +fusion/shm/shm.h +fusion/shm/shm_internal.h +fusion/shm/pool.h +fusion/ref.h +fusion/fusion_internal.h +fusion/lock.h +fusion/types.h +fusion/vector.h +fusion/call.h +fusion/shmalloc.h +fusion/protocol.h +fusion/fusion.h +fusion/arena.h +fusion/object.h +directfbgl.h +directfb_version.h +directfb.h +directfb_util.h +directfb_keynames.h +dgiff.h +direct/util.h +direct/memcpy.h +direct/interface.h +direct/conf.h +direct/tree.h +direct/signals.h +direct/build.h +direct/interface_implementation.h +direct/utf8.h +direct/serial.h +direct/hash.h +direct/direct.h +direct/clock.h +direct/types.h +direct/mem.h +direct/thread.h +direct/debug.h +direct/stream.h +direct/messages.h +direct/trace.h +direct/modules.h +direct/log.h +direct/system.h +direct/list.h +dfb_types.h +directfb_strings.h +directfb_keyboard.h +callconv.h +Carbon/Carbon.h +CarbonEvents.h +Carbon.h +cassert +c_asm.h +cctype +cderr.h +cerrno +cert.h +CFBase.h +CFBundle.h +CFData.h +CFDictionary.h +cf.h +CFNumber.h +CFPlugIn.h +CFPreferences.h +CFString.h +CFURL.h +CGAffineTransform.h +CheckBox.h +climits +Clipboard.h +cmplrs/stsupport.h +Cocoa/Cocoa.h +CodeFragments.h +comdef.h +commctrl.h +COMMCTRL.H +commdlg.h +compat.h +condapi.h +ConditionalMacros.h +config.h +conio.h +console.h +ControlDefinitions.h +Controls.h +CoreFoundation/CoreFoundation.h +CoreServices/CoreServices.h +CPalmRec.cpp +Cpalmrec.h +CPCatgry.cpp +CPDbBMgr.h +CPString.cpp +CPString.h +crtdbg.h +crt_externs.h +crypt.h +cstdio +cstdlib +cstring +ctime +ctype.h +curl/curl.h +curl/easy.h +curl/types.h +curses.h +cxxabi.h +DateTimeUtils.h +dbus/dbus.h +dbus/dbus-glib.h +dbus/dbus-glib-lowlevel.h +ddeml.h +Debug.h +dem.h +descrip.h +Devices.h +Dialogs.h +direct.h +dirent.h +DiskInit.h +dlfcn.h +dlgs.h +dl.h +docobj.h +dos/dosextens.h +dos.h +Drag.h +DriverServices.h +DriverSynchronization.h +DropInPanel.h +dvidef.h +elf.h +endian.h +Entry.h +errno.h +Errors.h +Events.h +exdisp.h +ExDisp.h +exe386.h +execinfo.h +extras.h +fabdef.h +fcntl.h +features.h +fibdef.h +File.h +filehdr.h +files.h +Files.h +FindDirectory.h +Finder.h +FinderRegistry.h +FixMath.h +float.h +Folders.h +fontconfig/fontconfig.h +fontconfig/fcfreetype.h +Font.h +Fonts.h +fp.h +fpieee.h +frame/log.h +frame/req.h +freetype/freetype.h +freetype/ftcache.h +freetype/ftglyph.h +freetype/ftsynth.h +freetype/ftoutln.h +freetype/ttnameid.h +freetype/tttables.h +freetype/t1tables.h +fribidi/fribidi.h +FSp_fopen.h +fstream.h +ft2build.h +gconf/gconf-client.h +Gdiplus.h +gdk/gdkevents.h +gdk/gdk.h +gdk/gdkkeysyms.h +gdk/gdkpango.h +gdk/gdkprivate.h +gdk/gdkscreen.h +gdk/gdkregion.h +gdk/gdkwindow.h +gdk/gdkx.h +gdk/gdkdirectfb.h +gdk-pixbuf/gdk-pixbuf.h +Gestalt.h +getopt.h +glibconfig.h +glib.h +glib-object.h +gmodule.h +gnome.h +gnu/libc-version.h +grp.h +gssapi_generic.h +gssapi/gssapi_generic.h +gssapi/gssapi.h +gssapi.h +gtk/gtkbindings.h +gtk/gtkbutton.h +gtk/gtkclipboard.h +gtk/gtkcontainer.h +gtk/gtkdialog.h +gtk/gtkentry.h +gtk/gtkfixed.h +gtk/gtk.h +gtk/gtkiconfactory.h +gtk/gtkimage.h +gtk/gtkimmulticontext.h +gtk/gtkinvisible.h +gtk/gtkmain.h +gtk/gtkmessagedialog.h +gtk/gtkobject.h +gtk/gtkprinter.h +gtk/gtkprintjob.h +gtk/gtkprintunixdialog.h +gtk/gtkprivate.h +gtk/gtkselection.h +gtk/gtksignal.h +gtk/gtksocket.h +gtk/gtkstock.h +gtk/gtkstyle.h +gtk/gtktextview.h +gtk/gtkvscrollbar.h +gtk/gtkwidget.h +gtk/gtkwindow.h +gtk/gtkversion.h +HIToolbox/HIToolbox.h +hlink.h +htiface.h +ia64/sys/inline.h +Icons.h +iconv.h +IDL.h +ieeefp.h +ifaddrs.h +image.h +imagehlp.h +imm.h +initguid.h +InterfaceDefs.h +InternetConfig.h +IntlResources.h +ints.h +intshcut.h +inttypes.h +iodef.h +io.h +IOKit/IOKitLib.h +IOKit/IOMessage.h +IOKit/pwr_mgt/IOPMLib.h +iomanip +iostream +iostream.h +jar.h +JavaControl.h +JavaEmbedding/JavaControl.h +JavaVM/jni.h +JManager.h +JNIEnvTests.h +jni.h +#if MOZ_NATIVE_JPEG==1 +jpeglib.h +#endif +JVMManagerTests.h +Kerberos/Kerberos.h +kernel/image.h +kernel/OS.h +key.h +keyt.h +keythi.h +LAction.h +langinfo.h +LApplication.h +LArray.h +LArrayIterator.h +LAttachable.h +LAttachment.h +LaunchServices.h +lber.h +LBroadcaster.h +LButton.h +lcache.h +LCaption.h +LCheckBox.h +LCicnButton.h +LClipboard.h +LCommander.h +LComparator.h +LControl.h +ldap.h +ldaplog.h +ldappr.h +ldap_ssl.h +LDataStream.h +ldfcn.h +LDialogBox.h +ldif.h +LDocApplication.h +LDocument.h +LDragAndDrop.h +LDragTask.h +LEditField.h +LEditText.h +LEventDispatcher.h +LFile.h +LFileStream.h +LFileTypeList.h +LFocusBox.h +LGrafPortView.h +LHandleStream.h +libc_r.h +libelf.h +libelf/libelf.h +libgen.h +libgnome/gnome-url.h +libgnome/libgnome.h +libgnomeui/gnome-icon-lookup.h +libgnomeui/gnome-icon-theme.h +libgnomeui/gnome-ui-init.h +libgnomevfs/gnome-vfs-application-registry.h +libgnomevfs/gnome-vfs-file-info.h +libgnomevfs/gnome-vfs.h +libgnomevfs/gnome-vfs-init.h +libgnomevfs/gnome-vfs-mime.h +libgnomevfs/gnome-vfs-mime-handlers.h +libgnomevfs/gnome-vfs-mime-info.h +libgnomevfs/gnome-vfs-mime-utils.h +libgnomevfs/gnome-vfs-ops.h +libgnomevfs/gnome-vfs-standard-callbacks.h +libIDL/IDL.h +lib$routines.h +limits +limits.h +link.h +linux/kernel.h +linux/limits.h +linux/rtc.h +linux/version.h +list +List.h +Lists.h +LiveConnectManagerTests.h +LListBox.h +LListener.h +LMenuBar.h +LMenu.h +LModelDirector.h +LModelObject.h +LModelProperty.h +loader.h +locale +locale.h +LOffscreenView.h +logkeys.h +logstrng.h +Looper.h +LowMem.h +LPane.h +LPeriodical.h +LPicture.h +LPlaceHolder.h +LPrintout.h +LProgressBar.h +LPushButton.h +LRadioGroup.h +LRadioGroupView.h +LRunArray.h +LScroller.h +LSharable.h +LSingleDoc.h +LStaticText.h +LStdControl.h +LStream.h +LString.h +LTabGroup.h +LTabGroupView.h +LTableArrayStorage.h +LTableMonoGeometry.h +LTableSingleSelector.h +LTableView.h +LTextEditView.h +LTextTableView.h +LUndoer.h +LVariableArray.h +LView.h +LWindow.h +m68881.h +MacErrors.h +MacHeadersCarbon.h +machine/ansi.h +machine/builtins.h +machine/clock.h +machine/endian.h +machine/frame.h +machine/inline.h +machine/limits.h +machine/signal.h +machine/trap.h +mach/mach_host.h +mach/mach_init.h +mach/mach_interface.h +mach/mach_port.h +mach-o/dyld.h +MacLocales.h +MacMemory.h +MacTCP.h +MacTypes.h +MacWindows.h +malloc.h +map +mapicode.h +mapidefs.h +mapiguid.h +mapi.h +mapitags.h +mapiutil.h +mapix.h +Math64.h +math.h +mbstring.h +mem.h +memory +memory.h +Memory.h +MenuBar.h +Menu.h +Menus.h +Message.h +Mime.h +MixedMode.h +mlang.h +mmsystem.h +model.h +Movies.h +mpw/errno.h +mshtmhst.h +mshtml.h +mswsock.h +Multiprocessing.h +mutex.h +Navigation.h +ncompat.h +ncurses.h +netCore.h +netdb.h +net/if.h +netinet/in.h +netinet/in_systm.h +netinet/tcp.h +new +newexe.h +new.h +nl_types.h +NodeInfo.h +nss.h +nssilock.h +objbase.h +objidl.h +Objsafe.h +ojiapitests.h +ole2.h +oleidl.h +OpenTptInternet.h +OpenTransport.h +os2.h +OS.h +osreldate.h +OSUtils.h +Packages.h +Palettes.h +PALM_CMN.H +pango-engine.h +pango-glyph.h +pango-modules.h +pango/pangocairo.h +pango/pangofc-decoder.h +pango/pangofc-font.h +pango/pangofc-fontmap.h +pango/pango-break.h +pango/pango-fontmap.h +pango/pango.h +pango/pangoxft.h +pango/pangox.h +pango/pango-utils.h +pango-types.h +pascal.h +Patches.h +Path.h +pcfs/pc_dir.h +Pgenerr.h +PGenErr.h +Ph.h +photon/Pg.h +photon/PhProto.h +photon/PhRender.h +photon/PpProto.h +photon/PtProgress.h +photon/PtServer.h +photon/PtWebClient.h +photon/PxImage.h +pk11func.h +pk11pub.h +pkcs11t.h +PLStringFuncs.h +PMApplication.h +pmddim.h +poll.h +Polygon.h +portable.h +Power.h +PP_ClassHeaders.cp +PP_Constants.h +PPCToolbox.h +PP_DebugHeaders.cp +PP_KeyCodes.h +PP_Macros.h +PP_Messages.h +PP_Prefix.h +PP_Resources.h +PP_Types.h +Printing.h +Print/PMPrintingDialogExtensions.h +private/qucomextra_p.h +Processes.h +process.h +Process.h +proto/dos.h +proto/exec.h +psap.h +Pt.h +pthread.h +pwd.h +Python.h +QDOffscreen.h +Quickdraw.h +QuickDraw.h +QuickTimeComponents.h +quipu/attr.h +rasdlg.h +raserror.h +ras.h +regex.h +Region.h +resolv.h +Resources.h +Retrace.h +rld_interface.h +rmsdef.h +Roster.h +rpc.h +rpcproxy.h +rpc/types.h +sane/sane.h +sane/sanei.h +sane/saneopts.h +Scrap.h +Screen.h +Script.h +ScrollBar.h +seccomon.h +sec.h +secmod.h +secmodt.h +secrng.h +security.h +secutil.h +semaphore.h +servprov.h +setjmp.h +SFNTLayoutTypes.h +SFNTTypes.h +share.h +shellapi.h +shlguid.h +shlobj.h +sigcontext.h +signal.h +SimpleGameSound.h +SIOUX.h +size_t.h +someincludefile.h +Sound.h +sqlite3.h +ssdef.h +sslerr.h +ssl.h +sslproto.h +sstream +stack +StandardFile.h +starlet.h +stat.h +statreg.cpp +statreg.h +stdarg.h +stdbool.h +stddef.h +stdint.h +stdio.h +stdlib.h +storage/FindDirectory.h +StorageKit.h +string +StringCompare.h +string.h +String.h +strings.h +Strings.h +StringView.h +stropts.h +strstrea.h +structs.h +stsdef.h +SupportDefs.h +support/String.h +support/SupportDefs.h +support/TLS.h +svrcore.h +symconst.h +sym.h +synch.h +syncmgr.h +sys/atomic_op.h +sys/bitypes.h +sys/byteorder.h +syscall.h +sys/cdefs.h +sys/cfgodm.h +sys/elf.h +sys/endian.h +sys/errno.h +sys/fault.h +sys/fcntl.h +sys/file.h +sys/filio.h +sys/frame.h +sys/immu.h +sys/inttypes.h +sys/ioccom.h +sys/ioctl.h +sys/ipc.h +sys/ldr.h +sys/link.h +sys/locking.h +syslog.h +sys/lwp.h +sys/machine.h +sys/mman.h +sys/mmu.h +sys/mount.h +sys/mpctl.h +sys/param.h +sys/pda.h +sys/poll.h +sys/ppc.h +sys/prctl.h +sys/priv.h +sys/procfs.h +sys/pstat.h +sys/ptrace.h +sys/queue.h +sys/reg.h +sys/regset.h +sys/resource.h +sys/sched.h +sys/select.h +sys/sem.h +sys/sendfile.h +sys/shm.h +sys/siginfo.h +sys/signal.h +sys/socket.h +sys/sockio.h +sys/sparc/frame.h +sys/stack.h +sys/statfs.h +sys/stat.h +sys/statvfs.h +sys/syscall.h +sys/sysctl.h +sys/sysinfo.h +sys/sysmp.h +sys/syssgi.h +sys/systeminfo.h +sys/timeb.h +sys/time.h +sys/times.h +sys/ttycom.h +sys/types.h +sys/ucontext.h +sys/uio.h +sys/un.h +sys/unistd.h +sys/utsname.h +sys/vfs.h +sys/wait.h +tables.h +TArray.h +TArrayIterator.h +task.h +tchar.h +TCHAR.H +termios.h +TextCommon.h +TextEdit.h +TextEncodingConverter.h +TextServices.h +TextUtils.h +TextView.h +th/PCR_Th.h +thread.h +ThreadManagerTests.h +Threads.h +time.h +Timer.h +tlhelp32.h +ToolUtils.h +trace.h +Traps.h +typeinfo +types.h +Types.h +UAppleEventsMgr.h +UAttachments.h +ucontext.h +uconv.h +UCursor.h +ucx$inetdef.h +UDebugging.h +UDesktop.h +UDrawingState.h +UDrawingUtils.h +UEnvironment.h +UEventMgr.h +UException.h +UExtractFromAEDesc.h +UGWorld.h +UKeyFilters.h +ulocks.h +ulserrno.h +UMemoryMgr.h +UModalDialogs.h +UNavServicesDialogs.h +UnicodeBlockObjects.h +UnicodeConverter.h +UnicodeUtilities.h +unidef.h +unikbd.h +unistd.h +unix.h +unixio.h +unixlib.h +unknwn.h +UPrinting.h +UQuickTime.h +UReanimator.h +URegions.h +URegistrar.h +UResourceMgr.h +urlhist.h +urlmon.h +UScrap.h +UScreenPort.h +UTCUtils.h +UTETextAction.h +UTEViewTextAction.h +UTextEdit.h +UTextTraits.h +utility +utime.h +UWindows.h +values.h +varargs.h +vcclr.h +vector +View.h +Volume.h +wab.h +wait.h +wchar.h +winbase.h +win/compobj.h +windef.h +Window.h +windows.h +Windows.h +windowsx.h +Wininet.h +winnls.h +winperf.h +winreg.h +Winreg.h +winsock2.h +winsock.h +winspool.h +winsvc.h +winuser.h +winver.h +wmem.h +workbench/startup.h +wtypes.h +wx/image.h +wx/listctrl.h +wx/log.h +wx/toolbar.h +wx/wx.h +wx/xrc/xmlres.h +X11/cursorfont.h +X11/extensions/Print.h +X11/extensions/shape.h +X11/extensions/XIElib.h +X11/extensions/XShm.h +X11/extensions/Xrender.h +X11/Intrinsic.h +X11/keysymdef.h +X11/keysym.h +X11/Shell.h +X11/StringDefs.h +X11/Xatom.h +X11/Xft/Xft.h +X11/Xfuncproto.h +X11/X.h +X11/XKBlib.h +X11/Xlib.h +X11/Xlibint.h +X11/Xlocale.h +X11/Xos.h +X11/Xutil.h +xpt_struct.h +xpt_xdr.h +zmouse.h +sslt.h +smime.h +cms.h +sechash.h +secoidt.h +certdb.h +secerr.h +nssb64.h +secasn1.h +secder.h +certt.h +ocsp.h +keyhi.h +cryptohi.h +crmf.h +pk11pqg.h +cmmf.h +base64.h +secdert.h +secitem.h +secmime.h +nssckbi.h +pkcs12.h +p12plcy.h +pk11sdr.h +nspr.h +pratom.h +prbit.h +prclist.h +prcmon.h +prcountr.h +prcvar.h +prdtoa.h +prenv.h +prerr.h +prerror.h +prinet.h +prinit.h +prinrval.h +prio.h +pripcsem.h +prlink.h +prlock.h +prlog.h +prlong.h +prmem.h +prmon.h +prmwait.h +prnetdb.h +prolock.h +prpdce.h +prprf.h +prproces.h +prrng.h +prrwlock.h +prshm.h +prshma.h +prsystem.h +prthread.h +prtime.h +prtpool.h +prtrace.h +prtypes.h +prvrsion.h +plbase64.h +plerror.h +plgetopt.h +plresolv.h +plstr.h +plarenas.h +plarena.h +plhash.h +#if MOZ_NATIVE_PNG==1 +png.h +#endif +#if MOZ_NATIVE_ZLIB==1 +zlib.h +#endif +#if MOZ_ENABLE_LIBXUL!=1 +#if BUILD_STATIC_LIBS!=1 +#define WRAP_LCMS_HEADERS +#endif +#endif +#if MOZ_NATIVE_LCMS==1 +#define WRAP_LCMS_HEADERS +#endif +#ifdef WRAP_LCMS_HEADERS +icc34.h +lcms.h +#endif +#ifdef MOZ_ENABLE_STARTUP_NOTIFICATION +libsn/sn.h +libsn/sn-common.h +libsn/sn-launchee.h +libsn/sn-launcher.h +libsn/sn-monitor.h +libsn/sn-util.h +#endif +#if MOZ_NATIVE_HUNSPELL==1 +hunspell.hxx +#endif +#if MOZ_NATIVE_BZ2==1 +bzlib.h +#endif diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/version.mk b/tools/node_modules/expresso/deps/jscoverage/js/config/version.mk new file mode 100644 index 0000000..3993b3f --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/version.mk @@ -0,0 +1,85 @@ +# ***** 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 Win32 Version System. +# +# The Initial Developer of the Original Code is Netscape Communications Corporation +# Portions created by the Initial Developer are Copyright (C) 2002 +# 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 INCLUDED_VERSION_MK +INCLUDED_VERSION_MK=1 + +# Windows gmake build: +# Build default .rc file if $(RESFILE) isn't defined. +# TODO: +# PBI : Private build info. Not used currently. +# Guessing the best way would be to set an env var. +# BINARY : Binary name. Not used currently. +ifeq ($(MOZ_WIDGET_TOOLKIT),windows) +ifndef RESFILE +RCFILE=./module.rc +RESFILE=./module.res +_RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(topsrcdir) -BITS $(MOZ_BITS) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) +ifneq ($(BUILD_OFFICIAL)_$(MOZILLA_OFFICIAL),_) +_RC_STRING += -OFFICIAL 1 +endif +ifdef MOZ_DEBUG +_RC_STRING += -DEBUG 1 +endif +ifdef MODULE +_RC_STRING += -MODNAME $(MODULE) +endif +ifdef PROGRAM +_RC_STRING += -BINARY $(PROGRAM) +else +ifdef _PROGRAM +_RC_STRING += -BINARY $(_PROGRAM) +else +ifdef SHARED_LIBRARY +_RC_STRING += -BINARY $(SHARED_LIBRARY) +endif +endif +endif +ifdef RCINCLUDE +_RC_STRING += -RCINCLUDE $(srcdir)/$(RCINCLUDE) +endif + +GARBAGE += $(RESFILE) $(RCFILE) + +#dummy target so $(RCFILE) doesn't become the default =P +all:: + +$(RCFILE): $(RCINCLUDE) $(topsrcdir)/config/version_win.pl + $(PERL) $(topsrcdir)/config/version_win.pl $(_RC_STRING) + +endif # RESFILE +endif # Windows + +endif diff --git a/tools/node_modules/expresso/deps/jscoverage/js/config/version_win.pl b/tools/node_modules/expresso/deps/jscoverage/js/config/version_win.pl new file mode 100644 index 0000000..094530e --- /dev/null +++ b/tools/node_modules/expresso/deps/jscoverage/js/config/version_win.pl @@ -0,0 +1,423 @@ +#!/usr/bin/perl -w + +# ***** 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 Win32 Version System. +# +# The Initial Developer of the Original Code is Brian Bober <netdemonz@yahoo.com> +# Portions created by the Initial Developer are Copyright (C) 2001 +# 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 ***** + +#use diagnostics; +require strict; +my $dir = $0; +$dir =~ s/[^\/]*$//; +push(@INC, "$dir"); +require "Moz/Milestone.pm"; +use Getopt::Long; +use Getopt::Std; +use POSIX; + +# Calculate the number of days since Jan. 1, 2000 from a buildid string +sub daysFromBuildID +{ + my ($buildid,) = @_; + + my ($y, $m, $d, $h) = ($buildid =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/); + $d || die("Unrecognized buildid string."); + + my $secondstodays = 60 * 60 * 24; + return (POSIX::mktime(00, 00, 00, $d, $m, $y - 1900) - + POSIX::mktime(00, 00, 00, 01, 01, 100)) / $secondstodays; +} + +#Creates version resource file + +#Paramaters are passed on the command line: + +#Example: -MODNAME nsToolkitCompsModule -DEBUG=1 + +# DEBUG - Mozilla's global debug variable - tells if its debug version +# OFFICIAL - tells Mozilla is building a milestone or nightly +# MSTONE - tells which milestone is being built; +# OBJDIR - Holds the object directory; +# MODNAME - tells what the name of the module is like nsBMPModule +# DEPTH - Holds the path to the root obj dir +# TOPSRCDIR - Holds the path to the root mozilla dir +# SRCDIR - Holds module.ver and source +# BINARY - Holds the name of the binary file +# DISPNAME - Holds the display name of the built application +# BITS - 16 or 32 bit +# RCINCLUDE - Holds the name of the RC File to include or "" +# QUIET - Turns off output + +#Description and Comment come from module.ver +#Bug 23560 +#http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/rc_7x2d.asp + +#Get next .ver file entry +sub getNextEntry +{ + while (<VERFILE>) + { + my $mline = $_; + ($mline) = split(/#/,$mline); + my ($entry, $value)=split(/=/,$mline,2); + if (defined($entry)) + { + if (defined($value)) + { + $entry =~ s/^\s*(.*?)\s*$/$1/; + $value =~ s/^\s*(.*?)\s*$/$1/; + return ($entry,$value); + } + } + } + return undef; +} + +my ($quiet,$objdir,$debug,$official,$milestone,$buildid,$module,$binary,$depth,$rcinclude,$bits,$srcdir,$fileversion,$productversion); + +GetOptions( "QUIET" => \$quiet, + "DEBUG=s" => \$debug, + "OFFICIAL=s" => \$official, + "MSTONE=s" => \$milestone, + "MODNAME=s" => \$module, + "BINARY=s" => \$binary, + "DISPNAME=s" => \$displayname, + "SRCDIR=s" => \$srcdir, + "TOPSRCDIR=s" => \$topsrcdir, + "DEPTH=s" => \$depth, + "RCINCLUDE=s" => \$rcinclude, + "OBJDIR=s" => \$objdir, + "BITS=s" => \$bits); +if (!defined($debug)) {$debug="";} +if (!defined($official)) {$official="";} +if (!defined($milestone)) {$milestone="";} +if (!defined($module)) {$module="";} +if (!defined($binary)) {$binary="";} +if (!defined($displayname)) {$displayname="Mozilla";} +if (!defined($depth)) {$depth=".";} +if (!defined($rcinclude)) {$rcinclude="";} +if (!defined($objdir)) {$objdir=".";} +if (!defined($srcdir)) {$srcdir=".";} +if (!defined($topsrcdir)) {$topsrcdir=".";} +if (!defined($bits)) {$bits="";} +my $mfversion = "Personal"; +my $mpversion = "Personal"; +my @fileflags = ("0"); +my $comment=""; +my $description=""; +if (!defined($module)) +{ + $module = $binary; + ($module) = split(/\./,$module); +} + +my $fileos = "VOS__WINDOWS32"; +if ($bits eq "16") { $fileos="VOS__WINDOWS16"; } + +my $bufferstr=" "; + +my $MILESTONE_FILE = "$topsrcdir/config/milestone.txt"; +my $BUILDID_FILE = "$depth/config/buildid"; + +#Read module.ver file +#Version file overrides for WIN32: +#WIN32_MODULE_COMMENT +#WIN32_MODULE_DESCRIPTION +#WIN32_MODULE_FILEVERSION +#WIN32_MODULE_COMPANYNAME +#WIN32_MODULE_FILEVERSION_STRING +#WIN32_MODULE_NAME +#WIN32_MODULE_COPYRIGHT +#WIN32_MODULE_TRADEMARKS +#WIN32_MODULE_ORIGINAL_FILENAME +#WIN32_MODULE_PRODUCTNAME +#WIN32_MODULE_PRODUCTVERSION +#WIN32_MODULE_PRODUCTVERSION_STRING + +#Override values obtained from the .ver file +my $override_comment; +my $override_description; +my $override_fileversion; +my $override_company; +my $override_mfversion; +my $override_module; +my $override_copyright; +my $override_trademarks; +my $override_filename; +my $override_productname; +my $override_productversion; +my $override_mpversion; +if (open(VERFILE, "<$srcdir/module.ver")) +{ + + my ($a,$b) = getNextEntry(); + while (defined($a)) + { + if ($a eq "WIN32_MODULE_COMMENT") { $override_comment = $b; } + if ($a eq "WIN32_MODULE_DESCRIPTION") { $override_description = $b; } + if ($a eq "WIN32_MODULE_FILEVERSION") { $override_fileversion = $b; } + if ($a eq "WIN32_MODULE_COMPANYNAME") { $override_company = $b; } + if ($a eq "WIN32_MODULE_FILEVERSION_STRING") { $override_mfversion = $b; } + if ($a eq "WIN32_MODULE_NAME") { $override_module = $b; } + if ($a eq "WIN32_MODULE_COPYRIGHT") { $override_copyright = $b; } + if ($a eq "WIN32_MODULE_TRADEMARKS") { $override_trademarks = $b; } + if ($a eq "WIN32_MODULE_ORIGINAL_FILENAME") { $override_filename = $b; } + if ($a eq "WIN32_MODULE_PRODUCTNAME") { $override_productname = $b; } + if ($a eq "WIN32_MODULE_PRODUCTVERSION") { $override_productversion = $b; } + if ($a eq "WIN32_MODULE_PRODUCTVERSION_STRING") { $override_mpversion = $b; } + ($a,$b) = getNextEntry(); + } + close(VERFILE) +} +else +{ + if (!$quiet || $quiet ne "1") { print "$bufferstr" . "WARNING: No module.ver file included ($module, $binary). Default values used\n"; } +} +#Get rid of trailing and leading whitespace +$debug =~ s/^\s*(.*)\s*$/$1/; +$comment =~ s/^\s*(.*)\s*$/$1/; +$official =~ s/^\s*(.*)\s*$/$1/; +$milestone =~ s/^\s*(.*)\s*$/$1/; +$description =~ s/^\s*(.*)\s*$/$1/; +$module =~ s/^\s*(.*)\s*$/$1/; +$depth =~ s/^\s*(.*)\s*$/$1/; +$binary =~ s/^\s*(.*)\s*$/$1/; +$displayname =~ s/^\s*(.*)\s*$/$1/; + +open(BUILDID, "<", $BUILDID_FILE) || die("Couldn't open buildid file: $BUILDID_FILE"); +$buildid = <BUILDID>; +$buildid =~ s/\s*$//; +close BUILDID; + +my $daycount = daysFromBuildID($buildid); + +if ($milestone eq "") { + $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE); +} + +$mfversion = $mpversion = $milestone; + +if ($debug eq "1") +{ + push @fileflags, "VS_FF_DEBUG"; + $mpversion .= " Debug"; + $mfversion .= " Debug"; +} + +if ($official ne "1") { + push @fileflags, "VS_FF_PRIVATEBUILD"; +} + +if ($milestone =~ /[a-z]/) { + push @fileflags, "VS_FF_PRERELEASE"; +} + +my @mstone = split(/\./,$milestone); +$mstone[1] =~s/\D.*$//; +if (!$mstone[2]) { + $mstone[2] = "0"; +} +else { + $mstone[2] =~s/\D.*$//; +} +$fileversion = $productversion="$mstone[0],$mstone[1],$mstone[2],$daycount"; + +my $copyright = "License: MPL 1.1/GPL 2.0/LGPL 2.1"; +my $company = "Mozilla Foundation"; +my $trademarks = "Mozilla"; +my $productname = $displayname; + + +if (defined($override_comment)){$override_comment =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $comment=$override_comment;} +if (defined($override_description)){$override_description =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $description=$override_description;} +if (defined($override_fileversion)){$fileversion=$override_fileversion;} +if (defined($override_mfversion)){$mfversion=$override_mfversion;} +if (defined($override_company)){$company=$override_company;} +if (defined($override_module)){$override_module =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $module=$override_module;} +if (defined($override_copyright)){$override_copyright =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $copyright=$override_copyright;} +if (defined($override_trademarks)){$override_trademarks =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $trademarks=$override_trademarks;} +if (defined($override_filename)){$binary=$override_filename;} +if (defined($override_productname)){$override_productname =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $productname=$override_productname;} +if (defined($override_productversion)){$productversion=$override_productversion;} +if (defined($override_mpversion)){$mpversion=$override_mpversion;} + + +#Override section + +open(RCFILE, ">$objdir/module.rc") || die("Can't edit module.rc - It must be locked.\n"); +print RCFILE qq{ +// ***** 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 Win32 Version System. +// +// The Initial Developer of the Original Code is Brian Bober <netdemonz\@yahoo.com> +// Portions created by the Initial Developer are Copyright (C) 2001 +// 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<winver.h> + +// Note: if you contain versioning information in an included +// RC script, it will be discarded +// Use module.ver to explicitly set these values + +// Do not edit this file. Changes won't affect the build. + +}; + +my $versionlevel=0; +my $insideversion=0; +if (open(RCINCLUDE, "<$rcinclude")) +{ + print RCFILE "// From included resource $rcinclude\n"; +# my $mstring=""; + while (<RCINCLUDE>) + { + $_ =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; + print RCFILE $_; +# my $instr=$_; +# chomp($instr); +# $mstring .= "$instr\;"; + } + close(RCINCLUDE); +# $mstring =~ s/\/\*.*\*\///g; +# my @mlines = split(/\;/,$mstring); +# for(@mlines) +# { +# my ($nocomment)=split(/\/\//,$_); +# if (defined($nocomment) && $nocomment ne "") +# { +# my ($firststring,$secondstring) = split(/\s+/,$nocomment); +# if (!defined($firststring)) {$firststring="";} +# if (!defined($secondstring)) {$secondstring="";} +# if ($secondstring eq "VERSIONINFO") +# { +#if (!$quiet || $quiet ne "1") { +# print "$bufferstr" . "WARNING: Included RC file ($rcinclude, $module, $binary)\n"; +# print "$bufferstr" . "WARNING: contains versioning information that will be discarded\n"; +# print "$bufferstr" . "WARNING: Remove it and use relevant overrides (in module.ver)\n"; +#} +# $versionlevel = 0; +# $insideversion = 1; +# } +# if ($firststring eq "BEGIN") { $versionlevel++; } +# if ($secondstring eq "END") +# { +# $versionlevel--; +# if ($insideversion==1 && $versionlevel==0) {$versionlevel=0;} +# } +# my $includecheck = $firststring . $secondstring; +# $includecheck =~ s/<|>/"/g; +# $includecheck = lc($includecheck); +# if ($includecheck ne "#include\"winver.h\"") +# { +# if ($insideversion == 0 && $versionlevel == 0) +# { +# print RCFILE "$nocomment\n"; +# } +# } +# } +# } + +} + +my $fileflags = join(' | ', @fileflags); + +print RCFILE qq{ + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +1 VERSIONINFO + FILEVERSION $fileversion + PRODUCTVERSION $productversion + FILEFLAGSMASK 0x3fL + FILEFLAGS $fileflags + FILEOS $fileos + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "Comments", "$comment" + VALUE "LegalCopyright", "$copyright" + VALUE "CompanyName", "$company" + VALUE "FileDescription", "$description" + VALUE "FileVersion", "$mfversion" + VALUE "ProductVersion", "$mpversion" + VALUE "InternalName", "$module" + VALUE "LegalTrademarks", "$trademarks" + VALUE "OriginalFilename", "$binary" + VALUE "ProductName", "$productname" + VALUE "BuildID", "$buildid" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + +}; +close(RCFILE); |