diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc index 9d93cfc..13274c3 100644 --- a/build/linux.gcc.inc +++ b/build/linux.gcc.inc @@ -32,29 +32,29 @@ DYLIB_KEY = -shared EXPORT_KEY = -Wl,--version-script, LIBDL = -ldl -CPLUS = g++ -CONLY = gcc +CPLUS = $(CXX) +CONLY = $(CC) LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY) LIBS += -lpthread -lrt LINK_FLAGS = -Wl,-rpath-link=. -rdynamic C_FLAGS = $(CPLUS_FLAGS) # gcc 4.4 and higher support -std=c++0x -ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[4-9]|[5-9])")) +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[4-9]|[5-9])")) CPP11_FLAGS = -std=c++0x -D_TBB_CPP0X endif # gcc 4.2 and higher support OpenMP -ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[2-9]|[5-9])")) +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[2-9]|[5-9])")) OPENMP_FLAG = -fopenmp endif # gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them -ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[8-9]|[5-9])")) - RTM_KEY = -mrtm -endif +#ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[8-9]|[5-9])")) +# RTM_KEY = -mrtm +#endif ifeq ($(cfg), release) - CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD + CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -DNDEBUG -DUSE_PTHREAD endif ifeq ($(cfg), debug) CPLUS_FLAGS = -DTBB_USE_DEBUG $(ITT_NOTIFY) -g -O0 -DUSE_PTHREAD diff --git a/build/linux.icc.inc b/build/linux.icc.inc index 4d1da05..6fd4353 100644 --- a/build/linux.icc.inc +++ b/build/linux.icc.inc @@ -35,7 +35,7 @@ CONLY = icc ITT_NOTIFY = -DDO_ITT_NOTIFY ifeq (release,$(cfg)) -CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -g -DUSE_PTHREAD +CPLUS_FLAGS = $(ITT_NOTIFY) -O2 -DNDEBUG -DUSE_PTHREAD else CPLUS_FLAGS = $(ITT_NOTIFY) -O0 -g -DUSE_PTHREAD -DTBB_USE_DEBUG endif diff --git a/build/linux.inc b/build/linux.inc index 0fae348..81de9c0 100644 --- a/build/linux.inc +++ b/build/linux.inc @@ -57,7 +57,7 @@ ifndef arch endif ifndef runtime - gcc_version:=$(shell gcc -dumpversion) + gcc_version:=$(shell $(CC) -dumpversion) os_version:=$(shell uname -r) os_kernel_version:=$(shell uname -r | sed -e 's/-.*$$//') export os_glibc_version_full:=$(shell getconf GNU_LIBC_VERSION | grep glibc | sed -e 's/^glibc //') @@ -65,8 +65,8 @@ ifndef runtime export runtime:=cc$(gcc_version)_libc$(os_glibc_version)_kernel$(os_kernel_version) endif -native_compiler := gcc -export compiler ?= gcc +native_compiler := $(CC) +export compiler ?= $(CC) debugger ?= gdb CMD=sh -c diff --git a/build/version_info_linux.sh b/build/version_info_linux.sh index 5df78af..1e0de4f 100644 --- a/build/version_info_linux.sh +++ b/build/version_info_linux.sh @@ -24,7 +24,7 @@ echo '#N": BUILD_HOST'"\t\t"`hostname -s`" ("`uname -m`")"'" ENDL \' # find OS name in *-release and issue* files by filtering blank lines and lsb-release content out echo '#N": BUILD_OS'"\t\t"`lsb_release -sd 2>/dev/null | grep -ih '[a-z] ' - /etc/*release /etc/issue 2>/dev/null | head -1 | sed -e 's/["\\\\]//g'`'" ENDL \' echo '#N": BUILD_KERNEL'"\t"`uname -srv`'" ENDL \' -echo '#N": BUILD_GCC'"\t\t"`g++ --version &1 | grep 'g++'`'" ENDL \' +echo '#N": BUILD_GCC'"\t\t"`${CXX} --version &1 | grep 'g++'`'" ENDL \' [ -z "$COMPILER_VERSION" ] || echo '#N": BUILD_COMPILER'"\t"$COMPILER_VERSION'" ENDL \' echo '#N": BUILD_LIBC'"\t"`getconf GNU_LIBC_VERSION | grep glibc | sed -e 's/^glibc //'`'" ENDL \' echo '#N": BUILD_LD'"\t\t"`ld -v 2>&1 | grep 'version'`'" ENDL \' diff --git a/build/windows.gcc.inc b/build/windows.gcc.inc index 2a6d000..e6bc75d 100644 --- a/build/windows.gcc.inc +++ b/build/windows.gcc.inc @@ -20,7 +20,11 @@ # Overriding settings from windows.inc #------------------------------------------------------------------------------ -SLASH= $(strip \) +AR=x86_64-w64-mingw32-ar + +export compiler ?= $(CC) +debugger ?= gdb + OBJ = o LIBEXT = dll # MinGW allows linking with DLLs directly @@ -43,13 +47,15 @@ LINK_TBB.LIB = $(TBB.LIB) # no TBB proxy for the configuration PROXY.LIB = +TEST_LAUNCHER = $(subst /,\,$(tbb_root))/build/test_launcher.bat $(largs) + #------------------------------------------------------------------------------ # End of overridden settings #------------------------------------------------------------------------------ # Compiler-specific variables #------------------------------------------------------------------------------ -CPLUS = g++ +CPLUS = $(CXX) COMPILE_ONLY = -c -MMD PREPROC_ONLY = -E -x c++ INCLUDE_KEY = -I @@ -75,17 +81,17 @@ LIBS = -lpsapi LINK_FLAGS = -Wl,--enable-auto-import LIB_LINK_FLAGS = $(DYLIB_KEY) # gcc 4.4 and higher support -std=c++0x -ifeq (ok,$(call detect_js,/minversion gcc 4.4)) +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[4-9]|[5-9])")) CPP11_FLAGS = -std=c++0x -D_TBB_CPP0X endif # gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them -ifeq (ok,$(call detect_js,/minversion gcc 4.8)) +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[8-9]|[5-9])")) RTM_KEY = -mrtm endif ifeq ($(cfg), release) - CPLUS_FLAGS = -g -O2 + CPLUS_FLAGS = -O2 -DNDEBUG endif ifeq ($(cfg), debug) CPLUS_FLAGS = -g -O0 -DTBB_USE_DEBUG @@ -95,13 +101,13 @@ ifneq (00,$(lambdas)$(cpp0x)) CXX_ONLY_FLAGS += $(CPP11_FLAGS) endif -CPLUS_FLAGS += -DUSE_WINTHREAD +CPLUS_FLAGS += -DUSE_WIN32_API -DUSE_WINTHREAD CPLUS_FLAGS += -D_WIN32_WINNT=$(_WIN32_WINNT) # MinGW specific CPLUS_FLAGS += -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -CONLY = gcc +CONLY = $(CC) debugger = gdb C_FLAGS = $(CPLUS_FLAGS) @@ -124,7 +130,7 @@ export UNIXMODE = 1 # Setting assembler data #------------------------------------------------------------------------------ -ASM= +ASM=x86_64-w64-mingw32-as ASM_FLAGS= TBB_ASM.OBJ= ASSEMBLY_SOURCE=$(arch)-gas diff --git a/build/windows.inc b/build/windows.inc index 0ada045..309fbda 100644 --- a/build/windows.inc +++ b/build/windows.inc @@ -16,8 +16,6 @@ # by the GNU General Public License. This exception does not however invalidate any other # reasons why the executable file might be covered by the GNU General Public License. -export SHELL = cmd - ifdef tbb_build_dir test_dir:=$(tbb_build_dir) else @@ -41,21 +39,22 @@ native_compiler := cl export compiler ?= cl debugger ?= devenv /debugexe -CMD=cmd /C -CWD=$(shell cmd /C echo %CD%) -RM=cmd /C del /Q /F -RD=cmd /C rmdir -MD=cmd /c mkdir -SLASH=\\ -NUL = nul +CMD=sh -c +CWD=$(shell pwd) +CP=cp +RM?=rm -f +RD?=rmdir +MD?=mkdir -p +SLASH=/ +NUL = /dev/null AR=lib AR_OUTPUT_KEY=/out: AR_FLAGS=/nologo /nodefaultlib -OBJ = obj +OBJ = o DLL = dll -LIBEXT = lib +LIBEXT = a ASMEXT = asm def_prefix = $(if $(findstring intel64,$(arch)),win64,win32) @@ -103,8 +102,8 @@ ifneq ($(filter vc8 vc9,$(runtime)),) RML.MANIFEST = tbbmanifest.exe.manifest endif -MAKE_VERSIONS = cmd /C cscript /nologo /E:jscript $(subst \,/,$(tbb_root))/build/version_info_windows.js $(compiler) $(arch) $(subst \,/,"$(VERSION_FLAGS)") > version_string.ver -MAKE_TBBVARS = cmd /C "$(subst /,\,$(tbb_root))\build\generate_tbbvars.bat" +MAKE_VERSIONS=sh $(tbb_root)/build/version_info_linux.sh $(VERSION_FLAGS) >version_string.ver +MAKE_TBBVARS=sh $(tbb_root)/build/generate_tbbvars.sh TEST_LAUNCHER = $(subst /,\,$(tbb_root))\build\test_launcher.bat $(largs)