Bug 596580: fix versioning on mozJSSubScriptLoader. (r=sayrer,brendan)
[mozilla-central.git] / nsprpub / config / config.mk
blobf47d8fee805f383f94abb0d4d0a031fdd74254fb
1 #! gmake
2 #
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
16 # The Original Code is the Netscape Portable Runtime (NSPR).
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998-2000
21 # the Initial Developer. All Rights Reserved.
23 # Contributor(s):
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 # Configuration information for building in the NSPR source module
41 # Define an include-at-most-once-flag
42 NSPR_CONFIG_MK = 1
45 # The variable definitions in this file are inputs to NSPR's
46 # build system. This file, if present, is included at the
47 # beginning of config.mk.
49 # For example:
51 # MOZ_OPTIMIZE=1
52 # USE_PTHREADS=1
53 # NS_USE_GCC=
55 ifndef topsrcdir
56 topsrcdir=$(MOD_DEPTH)
57 endif
59 ifndef srcdir
60 srcdir=.
61 endif
63 NFSPWD = $(MOD_DEPTH)/config/nfspwd
65 CFLAGS = $(VISIBILITY_FLAGS) $(CC_ONLY_FLAGS) $(OPTIMIZER)\
66 $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
67 CCCFLAGS = $(VISIBILITY_FLAGS) $(CCC_ONLY_FLAGS) $(OPTIMIZER)\
68 $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
69 # For purify
70 NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
71 $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
72 NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
73 $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
75 LDFLAGS = $(OS_LDFLAGS)
77 # Enable profile-guided optimization
78 ifdef MOZ_PROFILE_GENERATE
79 CFLAGS += $(PROFILE_GEN_CFLAGS)
80 LDFLAGS += $(PROFILE_GEN_LDFLAGS)
81 endif # MOZ_PROFILE_GENERATE
83 ifdef MOZ_PROFILE_USE
84 CFLAGS += $(PROFILE_USE_CFLAGS)
85 LDFLAGS += $(PROFILE_USE_LDFLAGS)
86 endif # MOZ_PROFILE_USE
88 define MAKE_OBJDIR
89 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
90 endef
92 LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
94 ifeq ($(OS_ARCH),Darwin)
95 PWD := $(shell pwd)
96 endif
98 ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
99 INSTALL = $(NSINSTALL)
100 else
101 ifeq ($(NSDISTMODE),copy)
102 # copy files, but preserve source mtime
103 INSTALL = $(NSINSTALL) -t
104 else
105 ifeq ($(NSDISTMODE),absolute_symlink)
106 # install using absolute symbolic links
107 ifeq ($(OS_ARCH),Darwin)
108 INSTALL = $(NSINSTALL) -L $(PWD)
109 else
110 INSTALL = $(NSINSTALL) -L `$(NFSPWD)`
111 endif
112 else
113 # install using relative symbolic links
114 INSTALL = $(NSINSTALL) -R
115 endif
116 endif
117 endif # (WINNT || OS2) && !CROSS_COMPILE
119 DEPENDENCIES = $(OBJDIR)/.md
121 ifdef BUILD_DEBUG_GC
122 DEFINES += -DDEBUG_GC
123 endif
125 GARBAGE += $(DEPENDENCIES) core $(wildcard core.[0-9]*)
127 DIST_GARBAGE += Makefile
129 ####################################################################
131 # The NSPR-specific configuration
133 ####################################################################
135 DEFINES += -DFORCE_PR_LOG
137 ifeq ($(_PR_NO_CLOCK_TIMER),1)
138 DEFINES += -D_PR_NO_CLOCK_TIMER
139 endif
141 ifeq ($(USE_PTHREADS), 1)
142 DEFINES += -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM
143 endif
145 ifeq ($(PTHREADS_USER), 1)
146 DEFINES += -DPTHREADS_USER -UHAVE_CVAR_BUILT_ON_SEM
147 endif
149 ifeq ($(USE_IPV6),1)
150 DEFINES += -D_PR_INET6
151 endif
153 ifeq ($(MOZ_UNICODE),1)
154 DEFINES += -DMOZ_UNICODE
155 endif
157 ####################################################################
159 # Configuration for the release process
161 ####################################################################
163 MDIST = /m/dist
164 ifeq ($(OS_ARCH),WINNT)
165 MDIST = //helium/dist
166 MDIST_DOS = $(subst /,\\,$(MDIST))
167 endif
169 # RELEASE_DIR is ns/dist/<module name>
171 RELEASE_DIR = $(MOD_DEPTH)/dist/release/$(MOD_NAME)
173 RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
174 RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
175 RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib