diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index a7c9e7a8f77692e77f8ef911f0696b6d69e1a963..832b6410016b14c37753c84329e71f5ce8f7e3d7 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 14a8ad344050c97fdf081000f1ed1cc49a441b6a..2172ee8ef6807281e5fc21756869f3c229d4cb23 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 a486abcb7cc0572819f5e77ca012ec688f54a530..779f86117abdc227397f396d66aaca32e678f6b6 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 838a62ce11157f063e493e348c68704bc1a2e825..a7b41abc1d01952d42c788dd6cb0186c98131773 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