aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerikj <none@none>2013-05-02 15:56:39 +0200
committererikj <none@none>2013-05-02 15:56:39 +0200
commit3966109b439f50c3e479d868029f37e161020a75 (patch)
treea32157e994849097235b01a7e3e3a82275242c05
parentfc85d7ed76f07092c3b747cd99657e633f574dbd (diff)
8011687: Support correct dependencies from header files on windows and solarisjdk8-b88
Reviewed-by: tbell
-rw-r--r--common/autoconf/generated-configure.sh4
-rw-r--r--common/autoconf/spec.gmk.in1
-rw-r--r--common/autoconf/toolchain.m41
-rw-r--r--common/makefiles/NativeCompilation.gmk20
4 files changed, 24 insertions, 2 deletions
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index a7c9e7a..832b641 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -681,6 +681,7 @@ LIBRARY_PREFIX
STATIC_LIBRARY
SHARED_LIBRARY
OBJ_SUFFIX
+COMPILER_NAME
LIPO
ac_ct_OBJDUMP
OBJDUMP
@@ -3774,7 +3775,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1367502345
+DATE_WHEN_GENERATED=1367502949
###############################################################################
#
@@ -28805,6 +28806,7 @@ fi
+
# The (cross) compiler is now configured, we can now test capabilities
# of the target platform.
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 14a8ad3..2172ee8 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -300,6 +300,7 @@ MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
# CC is gcc and others behaving reasonably similar.
# CL is cl.exe only.
COMPILER_TYPE:=@COMPILER_TYPE@
+COMPILER_NAME:=@COMPILER_NAME@
COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index a486abc..779f861 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -573,6 +573,7 @@ else
fi
fi
+AC_SUBST(COMPILER_NAME)
AC_SUBST(OBJ_SUFFIX)
AC_SUBST(SHARED_LIBRARY)
AC_SUBST(STATIC_LIBRARY)
diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk
index 838a62c..a7b41ab 100644
--- a/common/makefiles/NativeCompilation.gmk
+++ b/common/makefiles/NativeCompilation.gmk
@@ -95,10 +95,28 @@ define add_native_source
$$($1_$2_OBJ) : $2
ifeq ($(COMPILER_TYPE),CC)
$$(call COMPILING_MSG,$2,$$($1_TARGET))
+ # The Sun studio compiler doesn't output the full path to the object file in the
+ # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
+ ifeq ($(COMPILER_NAME)$$(filter %.s,$2),ossc)
+ $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
+ $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
+ else
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
endif
+ endif
+ # The Visual Studio compiler lacks a feature for generating make dependencies, but by
+ # setting -showIncludes, all included files are printed. These are filtered out and
+ # parsed into make dependences.
ifeq ($(COMPILER_TYPE),CL)
- $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
+ $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:"
+ ($(ECHO) $$@: \\ \
+ && $(SED) -e '/^Note: including file:/!d' \
+ -e 's|Note: including file: *||' \
+ -e 's|\\|/|g' \
+ -e 's|^\([a-zA-Z]\):|/cygdrive/\1|g' \
+ -e '/$(subst /,\/,$(TOPDIR))/!d' \
+ -e 's|$$$$| \\|g' \
+ $$($1_$2_DEP).raw) > $$($1_$2_DEP)
endif
endif
endef