3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # Configuration information for building in the NSPR source module
9 # Define an include-at-most-once-flag
13 # The variable definitions in this file are inputs to NSPR's
14 # build system. This file, if present, is included at the
15 # beginning of config.mk.
24 topsrcdir
=$(MOD_DEPTH
)
31 NFSPWD
= $(MOD_DEPTH
)/config
/nfspwd
33 CFLAGS
= $(VISIBILITY_FLAGS
) $(CC_ONLY_FLAGS
) $(OPTIMIZER
)\
34 $(OS_CFLAGS
) $(XP_DEFINE
) $(DEFINES
) $(INCLUDES
) $(XCFLAGS
)
35 CCCFLAGS
= $(VISIBILITY_FLAGS
) $(CCC_ONLY_FLAGS
) $(OPTIMIZER
)\
36 $(OS_CFLAGS
) $(XP_DEFINE
) $(DEFINES
) $(INCLUDES
) $(XCFLAGS
)
38 NOMD_CFLAGS
= $(CC_ONLY_FLAGS
) $(OPTIMIZER
) $(NOMD_OS_CFLAGS
)\
39 $(XP_DEFINE
) $(DEFINES
) $(INCLUDES
) $(XCFLAGS
)
40 NOMD_CCFLAGS
= $(CCC_ONLY_FLAGS
) $(OPTIMIZER
) $(NOMD_OS_CFLAGS
)\
41 $(XP_DEFINE
) $(DEFINES
) $(INCLUDES
) $(XCFLAGS
)
43 LDFLAGS
= $(OS_LDFLAGS
)
45 # Enable profile-guided optimization
46 ifndef NO_PROFILE_GUIDED_OPTIMIZE
47 ifdef MOZ_PROFILE_GENERATE
48 CFLAGS
+= $(PROFILE_GEN_CFLAGS
)
49 LDFLAGS
+= $(PROFILE_GEN_LDFLAGS
)
50 DLLFLAGS
+= $(PROFILE_GEN_LDFLAGS
)
51 ifeq (WINNT
,$(OS_ARCH
))
54 endif # MOZ_PROFILE_GENERATE
57 CFLAGS
+= $(PROFILE_USE_CFLAGS
)
58 LDFLAGS
+= $(PROFILE_USE_LDFLAGS
)
59 DLLFLAGS
+= $(PROFILE_USE_LDFLAGS
)
60 ifeq (WINNT
,$(OS_ARCH
))
63 endif # MOZ_PROFILE_USE
64 endif # NO_PROFILE_GUIDED_OPTIMIZE
67 if
test ! -d
$(@D
); then
rm -rf
$(@D
); $(NSINSTALL
) -D
$(@D
); fi
70 LINK_DLL
= $(LD
) $(OS_DLLFLAGS
) $(DLLFLAGS
)
72 ifeq ($(OS_ARCH
),Darwin
)
76 ifeq (,$(CROSS_COMPILE
)$(filter-out WINNT OS2
, $(OS_ARCH
)))
77 INSTALL
= $(NSINSTALL
)
79 ifeq ($(NSDISTMODE
),copy
)
80 # copy files, but preserve source mtime
81 INSTALL
= $(NSINSTALL
) -t
83 ifeq ($(NSDISTMODE
),absolute_symlink
)
84 # install using absolute symbolic links
85 ifeq ($(OS_ARCH
),Darwin
)
86 INSTALL
= $(NSINSTALL
) -L
$(PWD
)
88 INSTALL
= $(NSINSTALL
) -L
`$(NFSPWD)`
91 # install using relative symbolic links
92 INSTALL
= $(NSINSTALL
) -R
95 endif # (WINNT || OS2) && !CROSS_COMPILE
97 DEPENDENCIES
= $(OBJDIR
)/.md
100 DEFINES
+= -DDEBUG_GC
103 GARBAGE
+= $(DEPENDENCIES
) core
$(wildcard core.
[0-9]*)
105 DIST_GARBAGE
+= Makefile
107 ####################################################################
109 # The NSPR-specific configuration
111 ####################################################################
113 DEFINES
+= -DFORCE_PR_LOG
115 ifeq ($(_PR_NO_CLOCK_TIMER
),1)
116 DEFINES
+= -D_PR_NO_CLOCK_TIMER
119 ifeq ($(USE_PTHREADS
), 1)
120 DEFINES
+= -D_PR_PTHREADS
-UHAVE_CVAR_BUILT_ON_SEM
123 ifeq ($(PTHREADS_USER
), 1)
124 DEFINES
+= -DPTHREADS_USER
-UHAVE_CVAR_BUILT_ON_SEM
128 DEFINES
+= -D_PR_INET6
131 ifeq ($(MOZ_UNICODE
),1)
132 DEFINES
+= -DMOZ_UNICODE
135 ####################################################################
137 # Configuration for the release process
139 ####################################################################
142 ifeq ($(OS_ARCH
),WINNT
)
143 MDIST
= //helium
/dist
144 MDIST_DOS
= $(subst /,\\,$(MDIST
))
147 # RELEASE_DIR is ns/dist/<module name>
149 RELEASE_DIR
= $(MOD_DEPTH
)/dist/release
/$(MOD_NAME
)
151 RELEASE_INCLUDE_DIR
= $(RELEASE_DIR
)/$(BUILD_NUMBER
)/$(OBJDIR_NAME
)/include
152 RELEASE_BIN_DIR
= $(RELEASE_DIR
)/$(BUILD_NUMBER
)/$(OBJDIR_NAME
)/bin
153 RELEASE_LIB_DIR
= $(RELEASE_DIR
)/$(BUILD_NUMBER
)/$(OBJDIR_NAME
)/lib
155 # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
157 OBJ_SUFFIX
:= $(_OBJ_SUFFIX
)
159 # PGO builds with GCC build objects with instrumentation in a first pass,
160 # then objects optimized, without instrumentation, in a second pass. If
161 # we overwrite the ojects from the first pass with those from the second,
162 # we end up not getting instrumentation data for better optimization on
163 # incremental builds. As a consequence, we use a different object suffix
164 # for the first pass.
165 ifdef MOZ_PROFILE_GENERATE