Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe.
authorBernd Edlinger <edlinger@gcc.gnu.org>
Mon, 20 Feb 2017 18:19:54 +0000 (18:19 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Mon, 20 Feb 2017 18:19:54 +0000 (18:19 +0000)
2017-02-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe.
        (LIMITS_H_TEST, if_multiarch, stmp-fixinc): Use BUILD_SYSTEM_HEADER_DIR
        instead of SYSTEM_HEADER_DIR.

From-SVN: r245613

gcc/ChangeLog
gcc/Makefile.in

index c098201d29490d72e84c9bddca97b2a7b252191a..f710536d5d337aa0ad27532195e616f6fc4601b9 100644 (file)
@@ -1,4 +1,10 @@
-2017-02-18  Gerald Pfeifer  <gerald@pfeifer.com>
+2017-02-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe.
+       (LIMITS_H_TEST, if_multiarch, stmp-fixinc): Use BUILD_SYSTEM_HEADER_DIR
+       instead of SYSTEM_HEADER_DIR.
+
+2017-02-20  Gerald Pfeifer  <gerald@pfeifer.com>
            Martin Liška  <mliska@suse.cz>
 
        * doc/invoke.texi (use-after-scope-direct-emission-threshold):
index 0cde1aeb1a3217f74938bf752c295e77d89e86ae..8648d681fece269c02ecce58516d3f160bfa5ff1 100644 (file)
@@ -517,11 +517,18 @@ CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
 # macro is also used in a double-quoted context.
 SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
 
+# Path to the system headers on the build machine
+ifeq ($(build),$(host))
+BUILD_SYSTEM_HEADER_DIR = $(SYSTEM_HEADER_DIR)
+else
+BUILD_SYSTEM_HEADER_DIR = `echo $(CROSS_SYSTEM_HEADER_DIR) | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
+endif
+
 # Control whether to run fixincludes.
 STMP_FIXINC = @STMP_FIXINC@
 
 # Test to see whether <limits.h> exists in the system header files.
-LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+LIMITS_H_TEST = [ -f $(BUILD_SYSTEM_HEADER_DIR)/limits.h ]
 
 # Directory for prefix to system directories, for
 # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
@@ -572,7 +579,7 @@ ifeq ($(enable_multiarch),yes)
 else
   ifeq ($(enable_multiarch),auto)
     # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
-    if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+    if_multiarch = $(if $(wildcard $(shell echo $(BUILD_SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
   else
     if_multiarch =
   endif
@@ -2990,11 +2997,11 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
            sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
            multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
            fix_dir=include-fixed$${multi_dir}; \
-           if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
+           if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \
              echo The directory that should contain system headers does not exist: >&2 ; \
-             echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
+             echo "  ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \
              tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
-             if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
+             if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
              then sleep 1; else exit 1; fi; \
            fi; \
            $(mkinstalldirs) $${fix_dir}; \
@@ -3005,7 +3012,7 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
              export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
              cd $(build_objdir)/fixincludes && \
              $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
-               $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
+               $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
            rm -f $${fix_dir}/syslimits.h; \
            if [ -f $${fix_dir}/limits.h ]; then \
              mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \