summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/tools/src')
-rw-r--r--openmp/runtime/tools/src/common-checks.mk28
-rw-r--r--openmp/runtime/tools/src/common-defs.mk6
-rw-r--r--openmp/runtime/tools/src/common-tools.mk32
3 files changed, 52 insertions, 14 deletions
diff --git a/openmp/runtime/tools/src/common-checks.mk b/openmp/runtime/tools/src/common-checks.mk
index 08c246f0954..0959fc63ebc 100644
--- a/openmp/runtime/tools/src/common-checks.mk
+++ b/openmp/runtime/tools/src/common-checks.mk
@@ -19,17 +19,27 @@
# Check tools versions.
#
ifeq "$(clean)" "" # Do not check tools if clean goal specified.
- ifeq "$(c)" "gcc"
- curr_tools := $(strip $(shell $(perl) $(tools_dir)check-tools.pl $(oa-opts) --no-intel --gnu-fortran --make))
- ifneq "$(findstring N/A,$(curr_tools))" ""
- curr_tools := $(strip $(shell $(perl) $(tools_dir)check-tools.pl $(oa-opts) --make))
- fort = ifort
- else
- fort = gfortran
- endif
+
+ check_tools_flags = --make
+
+ # determine if fortran check is required from goals
+ # MAKECMDGOALS is like argv for gnu make
+ ifneq "$(filter mod all,$(MAKECMDGOALS))" ""
+ check_tools_flags += --fortran
else
- curr_tools := $(strip $(shell $(perl) $(tools_dir)check-tools.pl $(oa-opts) --make))
+ ifeq "$(MAKECMDGOALS)" "" # will default to all if no goals specified on command line
+ check_tools_flags += --fortran
+ endif
endif
+ ifneq "$(filter gcc clang,$(c))" "" # if build compiler is gcc or clang
+ check_tools_flags += --no-intel
+ endif
+ ifeq "$(c)" "clang"
+ check_tools_flags += --clang
+ endif
+
+ curr_tools := $(strip $(shell $(perl) $(tools_dir)check-tools.pl $(oa-opts) $(check_tools_flags)))
+
ifeq "$(curr_tools)" ""
$(error check-tools.pl failed)
endif
diff --git a/openmp/runtime/tools/src/common-defs.mk b/openmp/runtime/tools/src/common-defs.mk
index 1c164bcea4a..ebd1922c7a5 100644
--- a/openmp/runtime/tools/src/common-defs.mk
+++ b/openmp/runtime/tools/src/common-defs.mk
@@ -45,7 +45,7 @@ endif
# Description:
# The function return printable name of specified architecture, IA-32 architecture or Intel(R) 64.
#
-legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(error Bad architecture specified: $(1))))))
+legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(if $(filter arm,$(1)),ARM,$(error Bad architecture specified: $(1))))))
# Synopsis:
# var_name = $(call check_variable,var,list)
@@ -128,9 +128,9 @@ endif
# --------------------------------------------------------------------------------------------------
os := $(call check_variable,os,lin lrb mac win)
-arch := $(call check_variable,arch,32 32e 64)
+arch := $(call check_variable,arch,32 32e 64 arm)
platform := $(os)_$(arch)
-platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lrb_32e mac_32 mac_32e win_32 win_32e win_64)
+platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64)
# oa-opts means "os and arch options". They are passed to almost all perl scripts.
oa-opts := --os=$(os) --arch=$(arch)
diff --git a/openmp/runtime/tools/src/common-tools.mk b/openmp/runtime/tools/src/common-tools.mk
index 65bc92e87e9..a9c9fbcee65 100644
--- a/openmp/runtime/tools/src/common-tools.mk
+++ b/openmp/runtime/tools/src/common-tools.mk
@@ -33,6 +33,10 @@
# on Windows* OS generates such a dependency: "kmp_runtime.obj: .\kmp_i18n.inc", and make complains
# "No rule to build .\kmp_i18n.inc". Using "./" solves the problem.
cpp-flags += -I ./
+# For non-x86 architecture
+ifeq "$(filter 32 32e 64,$(arch))" ""
+ cpp-flags += $(shell pkg-config --cflags libffi)
+endif
# Add all VPATH directories to path for searching include files.
cpp-flags += $(foreach i,$(VPATH),-I $(i))
@@ -60,6 +64,9 @@ ifneq "$(filter lin lrb mac,$(os))" ""
ifeq "$(c)" "gcc"
cxx = g++
endif
+ ifeq "$(c)" "clang"
+ cxx = clang++
+ endif
# Output file flag.
c-out = -o$(space)
cxx-out = -o$(space)
@@ -70,7 +77,9 @@ ifneq "$(filter lin lrb mac,$(os))" ""
c-flags-m += -M -MG
cxx-flags-m += -M -MG
# Enable C99 language.
- c-flags += -std=c99
+ ifneq "$(CPLUSPLUS)" "on"
+ c-flags += -std=gnu99
+ endif
# Generate position-independent code (a must for shared objects).
ifeq "$(LINK_TYPE)" "dyna"
c-flags += -fPIC
@@ -118,12 +127,24 @@ ifneq "$(filter lin lrb mac,$(os))" ""
ifeq "$(c)" "gcc"
as = gcc
endif
+ ifeq "$(c)" "clang"
+ as = clang
+ endif
as-out = -o$(space)
as-flags += $(cpp-flags)
# Compile only, no link.
as-flags += -c
as-flags += -x assembler-with-cpp
# --- Fortran ---
+ ifeq "$(c)" "icc"
+ fort = ifort
+ endif
+ ifeq "$(c)" "gcc"
+ fort = gfortran
+ endif
+ ifeq "$(c)" "clang"
+ fort = gfortran
+ endif
ifeq "$(fort)" ""
fort = ifort
endif
@@ -148,6 +169,11 @@ ifeq "$(os)" "lin"
cxx-flags += -mia32
endif
endif
+ ifeq "$(c)" "gcc"
+ ifeq "$(arch)" "arm"
+ c-flags += -marm
+ endif
+ endif
# --- Librarian ---
ar = ar
ar-out = $(empty)
@@ -298,7 +324,9 @@ ifeq "$(os)" "win"
c-flags-m += -QM -QMM -QMG
cxx-flags-m += -QM -QMM -QMG
# Enable C99 language.
- c-flags += -Qstd=c99
+ ifneq "$(CPLUSPLUS)" "on"
+ c-flags += -Qstd=gnu99
+ endif
# Enable C++ exception handling.
# ??? Why we disable it on Linux* OS?
cxx-flags += -EHsc
OpenPOWER on IntegriCloud