Skip to content

Commit 47fb04d

Browse files
committed
Update build scripts.
1 parent 96bc456 commit 47fb04d

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

src/tbb/build/Makefile.tbb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
tbb_root ?= "$(TBBROOT)"
2424
BUILDING_PHASE=1
2525
include $(tbb_root)/build/common.inc
26+
CPLUS_FLAGS += $(SDL_FLAGS)
2627
DEBUG_SUFFIX=$(findstring _debug,_$(cfg))
2728

2829
#------------------------------------------------------------
@@ -36,12 +37,7 @@ default_tbb: $(TBB.DLL)
3637

3738
VPATH = $(tbb_root)/src/tbb/$(ASSEMBLY_SOURCE) $(tbb_root)/src/tbb $(tbb_root)/src/old $(tbb_root)/src/rml/client
3839

39-
CPLUS_FLAGS += $(PIC_KEY) $(DEFINE_KEY)__TBB_BUILD=1
40-
41-
# suppress warnings for build of itt_notify by GCC3
42-
ifneq (,$(findstring gcc_cc3., $(compiler)_$(runtime)))
43-
KNOWN_WARNINGS += itt_notify.$(OBJ)
44-
endif
40+
CPLUS_FLAGS += $(PIC_KEY) $(DSE_KEY) $(DEFINE_KEY)__TBB_BUILD=1
4541

4642
# Object files (that were compiled from C++ code) that gmake up TBB
4743
TBB_CPLUS.OBJ = concurrent_hash_map.$(OBJ) \
@@ -79,7 +75,7 @@ TBB_CPLUS.OBJ = concurrent_hash_map.$(OBJ) \
7975
tbb_main.$(OBJ)
8076

8177
# OLD/Legacy object files for backward binary compatibility
82-
ifeq (,$(findstring $(DEFINE_KEY)TBB_NO_LEGACY,$(CXXFLAGS)))
78+
ifeq (,$(findstring $(DEFINE_KEY)TBB_NO_LEGACY,$(CPLUS_FLAGS)))
8379
TBB_CPLUS_OLD.OBJ = \
8480
concurrent_vector_v2.$(OBJ) \
8581
concurrent_queue_v2.$(OBJ) \
@@ -118,5 +114,5 @@ endif
118114
#clean:
119115
# $(RM) *.$(OBJ) *.$(DLL) *.res *.map *.ilk *.pdb *.exp *.manifest *.tmp *.d core core.*[0-9][0-9] *.ver
120116

121-
# Include automatically generated dependences
117+
# Include automatically generated dependencies
122118
-include *.d

src/tbb/build/Makefile.tbbmalloc

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,39 +54,43 @@ PROXY.OBJ := proxy.$(OBJ) tbb_function_replacement.$(OBJ)
5454
M_CPLUS_FLAGS := $(subst $(WARNING_KEY),,$(M_CPLUS_FLAGS)) $(DEFINE_KEY)__TBBMALLOC_BUILD=1
5555
M_INCLUDES := $(INCLUDES) $(INCLUDE_KEY)$(MALLOC_ROOT) $(INCLUDE_KEY)$(MALLOC_SOURCE_ROOT)
5656

57-
# Suppress superfluous warnings for TBBmalloc compilation
57+
# Suppress superfluous warnings for TBBMalloc compilation
5858
$(MALLOC.OBJ): M_CPLUS_FLAGS += $(WARNING_SUPPRESS)
59+
# Suppress superfluous warnings for TBBMalloc proxy compilation
60+
$(PROXY.OBJ): CPLUS_FLAGS += $(WARNING_SUPPRESS)
5961

6062
frontend.$(OBJ): frontend.cpp version_string.ver
61-
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(M_INCLUDES) $(INCLUDE_KEY). $<
63+
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(DSE_KEY) $(M_INCLUDES) $(INCLUDE_KEY). $<
6264

6365
$(PROXY.OBJ): %.$(OBJ): %.cpp
64-
$(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(PIC_KEY) $(DEFINE_KEY)__TBBMALLOC_BUILD=1 $(M_INCLUDES) $<
66+
$(CPLUS) $(COMPILE_ONLY) $(CPLUS_FLAGS) $(PIC_KEY) $(DSE_KEY) $(DEFINE_KEY)__TBBMALLOC_BUILD=1 $(M_INCLUDES) $<
6567

6668
$(MALLOC_CPLUS.OBJ): %.$(OBJ): %.cpp
67-
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(M_INCLUDES) $<
69+
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(DSE_KEY) $(M_INCLUDES) $<
6870

6971
itt_notify_malloc.$(OBJ): itt_notify.cpp
70-
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(OUTPUTOBJ_KEY)$@ $(INCLUDES) $<
72+
$(CPLUS) $(COMPILE_ONLY) $(M_CPLUS_FLAGS) $(PIC_KEY) $(DSE_KEY) $(OUTPUTOBJ_KEY)$@ $(INCLUDES) $<
7173

7274
MALLOC_LINK_FLAGS = $(LIB_LINK_FLAGS)
7375
PROXY_LINK_FLAGS = $(LIB_LINK_FLAGS)
7476

7577
ifneq (,$(MALLOC.DEF))
7678
tbbmalloc.def: $(MALLOC.DEF)
77-
$(CPLUS) $(PREPROC_ONLY) $< $(M_CPLUS_FLAGS) $(INCLUDES) > $@
79+
$(CPLUS) $(PREPROC_ONLY) $< $(M_CPLUS_FLAGS) $(WARNING_SUPPRESS) $(INCLUDES) > $@
7880

7981
MALLOC_LINK_FLAGS += $(EXPORT_KEY)tbbmalloc.def
8082
$(MALLOC.DLL): tbbmalloc.def
8183
endif
8284

85+
$(MALLOC.DLL) $(MALLOCPROXY.DLL): CPLUS_FLAGS += $(SDL_FLAGS)
86+
$(MALLOC.DLL) $(MALLOCPROXY.DLL): M_CPLUS_FLAGS += $(SLD_FLAGS)
8387
$(MALLOC.DLL): BUILDING_LIBRARY = $(MALLOC.DLL)
8488
$(MALLOC.DLL): $(MALLOC.OBJ) $(MALLOC.RES) $(MALLOC_NO_VERSION.DLL)
8589
$(subst $(CPLUS),$(CONLY),$(LIB_LINK_CMD)) $(LIB_OUTPUT_KEY)$(MALLOC.DLL) $(MALLOC.OBJ) $(MALLOC.RES) $(LIB_LINK_LIBS) $(MALLOC_LINK_FLAGS)
8690

8791
ifneq (,$(MALLOCPROXY.DEF))
8892
tbbmallocproxy.def: $(MALLOCPROXY.DEF)
89-
$(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(INCLUDES) > $@
93+
$(CPLUS) $(PREPROC_ONLY) $< $(CPLUS_FLAGS) $(WARNING_SUPPRESS) $(INCLUDES) > $@
9094

9195
PROXY_LINK_FLAGS += $(EXPORT_KEY)tbbmallocproxy.def
9296
$(MALLOCPROXY.DLL): tbbmallocproxy.def
@@ -141,6 +145,7 @@ MALLOC_TESTS += test_malloc_overload.$(TEST_EXT) \
141145
test_malloc_atexit.$(TEST_EXT)
142146
endif
143147
# -----------------------------------------------------
148+
144149
# ------------ Set test specific variables ------------
145150
ifeq (windows.gcc,$(tbb_os).$(compiler))
146151
test_malloc_overload.$(TEST_EXT): LIBS += $(MALLOCPROXY.LIB)
@@ -154,13 +159,17 @@ MALLOC_LINK_PROXY_TESTS = test_malloc_overload_proxy.$(TEST_EXT)
154159
MALLOC_ADD_DLL_TESTS = test_malloc_lib_unload.$(TEST_EXT) test_malloc_used_by_lib.$(TEST_EXT) \
155160
test_malloc_atexit.$(TEST_EXT)
156161

162+
# TODO: implement accurate warning suppression for tests to unify with Makefile.test.
163+
157164
$(MALLOC_M_CPLUS_TESTS): CPLUS_FLAGS=$(M_CPLUS_FLAGS)
158165
$(MALLOC_M_CPLUS_TESTS): INCLUDES=$(M_INCLUDES)
159166
$(MALLOC_NO_LIB_TESTS): LINK_MALLOC.LIB=
160167
$(MALLOC_NO_LIB_TESTS): LINK_FLAGS+=$(LIBDL)
161168
$(MALLOC_LINK_PROXY_TESTS): LINK_MALLOC.LIB=$(LINK_MALLOCPROXY.LIB)
169+
ifneq (,$(DYLIB_KEY))
162170
$(MALLOC_ADD_DLL_TESTS): %.$(TEST_EXT): %_dll.$(DLL)
163171
$(MALLOC_ADD_DLL_TESTS): TEST_LIBS+=$(@:.$(TEST_EXT)=_dll.$(LIBEXT))
172+
endif
164173

165174
test_malloc_over%.$(TEST_EXT): CPLUS_FLAGS=$(subst /MT,/MD,$(M_CPLUS_FLAGS))
166175
test_malloc_over%.$(TEST_EXT): INCLUDES=$(M_INCLUDES)
@@ -169,13 +178,13 @@ test_malloc_overload_proxy.$(TEST_EXT): LINK_FLAGS+=$(LIBDL)
169178
test_malloc_atexit_dll.$(DLL): CPLUS_FLAGS=$(subst /MT,/MD,$(M_CPLUS_FLAGS))
170179
test_malloc_atexit.$(TEST_EXT): CPLUS_FLAGS=$(subst /MT,/MD,$(M_CPLUS_FLAGS))
171180
test_malloc_atexit.$(TEST_EXT): LINK_FLAGS+=$(LIBDL)
172-
# on Ubuntu 11.10 linker called with --as-needed, so dependence on libtbbmalloc_proxy
181+
# on Ubuntu 11.10 linker called with --as-needed, so dependency on libtbbmalloc_proxy
173182
# is not created, and malloc overload via linking with -ltbbmalloc_proxy is not working.
174183
# Overcome with --no-as-needed.
175184
ifeq (linux.gcc,$(tbb_os).$(compiler))
176185
test_malloc_atexit.$(TEST_EXT): MALLOCPROXY.LIB := -Wl,--no-as-needed $(MALLOCPROXY.LIB)
177186
endif
178-
# The test doesn't added to MALLOC_LINK_PROXY_TESTS, because we need both
187+
# The test isn't added to MALLOC_LINK_PROXY_TESTS, because we need both
179188
# tbbmalloc and proxy libs. For platforms other than Android it's enough
180189
# to modify LINK_MALLOC.LIB for TEST_EXT target only. But under Android build
181190
# of DLL and TEST_EXT can be requested independently, so there is no chance
@@ -196,6 +205,7 @@ test_malloc_used_by_lib_dll.$(DLL): CPLUS_FLAGS=$(subst /MT,/LD,$(M_CPLUS_FLAGS)
196205
test_malloc_used_by_lib_dll.$(DLL): LINK_FILES+=$(ORIG_LINK_MALLOC.LIB)
197206
test_malloc_used_by_lib_dll.$(DLL): LIBDL=
198207
# -----------------------------------------------------
208+
199209
# ---- The list of TBBMalloc test running commands ----
200210
# run_cmd is usually empty
201211
malloc_test: $(MALLOC.DLL) malloc_test_no_depends
@@ -222,5 +232,5 @@ endif
222232
# End of rules for making the TBBMalloc unit tests
223233
#------------------------------------------------------
224234

225-
# Include automatically generated dependences
235+
# Include automatically generated dependencies
226236
-include *.d

src/tbb/build/generate_tbbvars.bat

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ set fslash_bin_dir=%bin_dir:\=/%
2626
set _INCLUDE=INCLUDE& set _LIB=LIB
2727
if not x%UNIXMODE%==x set _INCLUDE=CPATH& set _LIB=LIBRARY_PATH
2828

29-
if exist tbbvars.bat goto skipbat
3029
echo Generating local tbbvars.bat
3130
echo @echo off>tbbvars.bat
3231
echo SET TBBROOT=%actual_root%>>tbbvars.bat
@@ -36,9 +35,7 @@ echo SET %_INCLUDE%=%%TBBROOT%%\include;%%%_INCLUDE%%%>>tbbvars.bat
3635
echo SET %_LIB%=%bin_dir%;%%%_LIB%%%>>tbbvars.bat
3736
echo SET PATH=%bin_dir%;%%PATH%%>>tbbvars.bat
3837
if not x%UNIXMODE%==x echo SET LD_LIBRARY_PATH=%bin_dir%;%%LD_LIBRARY_PATH%%>>tbbvars.bat
39-
:skipbat
4038

41-
if exist tbbvars.sh goto skipsh
4239
echo Generating local tbbvars.sh
4340
echo #!/bin/sh>tbbvars.sh
4441
echo export TBBROOT="%fslash_root%">>tbbvars.sh
@@ -48,9 +45,7 @@ echo export %_INCLUDE%="${TBBROOT}/include;$%_INCLUDE%">>tbbvars.sh
4845
echo export %_LIB%="%fslash_bin_dir%;$%_LIB%">>tbbvars.sh
4946
echo export PATH="%fslash_bin_dir%;$PATH">>tbbvars.sh
5047
if not x%UNIXMODE%==x echo export LD_LIBRARY_PATH="%fslash_bin_dir%;$LD_LIBRARY_PATH">>tbbvars.sh
51-
:skipsh
5248

53-
if exist tbbvars.csh goto skipcsh
5449
echo Generating local tbbvars.csh
5550
echo #!/bin/csh>tbbvars.csh
5651
echo setenv TBBROOT "%actual_root%">>tbbvars.csh
@@ -60,10 +55,11 @@ echo setenv %_INCLUDE% "${TBBROOT}\include;$%_INCLUDE%">>tbbvars.csh
6055
echo setenv %_LIB% "%bin_dir%;$%_LIB%">>tbbvars.csh
6156
echo setenv PATH "%bin_dir%;$PATH">>tbbvars.csh
6257
if not x%UNIXMODE%==x echo setenv LD_LIBRARY_PATH "%bin_dir%;$LD_LIBRARY_PATH">>tbbvars.csh
63-
:skipcsh
6458

65-
REM Workaround for copying Android* specific libgnustl_shared.so library to work folder
66-
if not x%LIB_GNU_STL_ANDROID%==x copy /Y "%LIB_GNU_STL_ANDROID%"\libgnustl_shared.so
59+
if not x%LIB_STL_ANDROID%==x (
60+
REM Workaround for copying Android* specific stl shared library to work folder
61+
copy /Y "%LIB_STL_ANDROID:/=\%" .
62+
)
6763

6864
endlocal
6965
exit

src/tbb/build/generate_tbbvars.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bin_dir="$PWD" #
2323
cd "$tbb_root" # keep this comments here
2424
tbb_root="$PWD" # to make it unsensible
2525
cd "$bin_dir" # to EOL encoding
26-
[ -f ./tbbvars.sh ] || cat >./tbbvars.sh <<EOF
26+
cat >./tbbvars.sh <<EOF
2727
#!/bin/bash
2828
export TBBROOT="${tbb_root}" #
2929
tbb_bin="${bin_dir}" #
@@ -44,7 +44,7 @@ else #
4444
fi #
4545
${TBB_CUSTOM_VARS_SH} #
4646
EOF
47-
[ -f ./tbbvars.csh ] || cat >./tbbvars.csh <<EOF
47+
cat >./tbbvars.csh <<EOF
4848
#!/bin/csh
4949
setenv TBBROOT "${tbb_root}" #
5050
setenv tbb_bin "${bin_dir}" #
@@ -65,7 +65,7 @@ else #
6565
endif #
6666
${TBB_CUSTOM_VARS_CSH} #
6767
EOF
68-
# Workaround for copying Android* specific libgnustl_shared.so library to "."
69-
if [ ! -z "${LIB_GNU_STL_ANDROID}" ]; then #
70-
cp ${LIB_GNU_STL_ANDROID}/libgnustl_shared.so . #
68+
# Workaround for copying Android* specific stl shared library to "."
69+
if [ ! -z "${LIB_STL_ANDROID}" ]; then #
70+
cp ${LIB_STL_ANDROID} . #
7171
fi #

0 commit comments

Comments
 (0)