2017-04-14 Bernd Edlinger * configure.ac (SYSTEM_HEADER_DIR, BUILD_SYSTEM_HEADER_DIR, target_header_dir): Set correctly. * configure: Regenerated. * Makefile.in (BUILD_SYSTEM_HEADER_DIR): Use directly. Index: gcc/configure =================================================================== --- gcc/configure (revision 246899) +++ gcc/configure (working copy) @@ -719,6 +719,7 @@ BUILD_CFLAGS CXX_FOR_BUILD CC_FOR_BUILD inhibit_libc +BUILD_SYSTEM_HEADER_DIR SYSTEM_HEADER_DIR ALL CROSS @@ -12214,14 +12215,15 @@ done CROSS= ALL=all.internal SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' +BUILD_SYSTEM_HEADER_DIR=$SYSTEM_HEADER_DIR if test "x$with_build_sysroot" != x; then - build_system_header_dir=$with_build_sysroot'$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' -else + BUILD_SYSTEM_HEADER_DIR=$with_build_sysroot'$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' +elif test x$host != x$target; then # This value is used, even on a native system, because # CROSS_SYSTEM_HEADER_DIR is just # $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR). - build_system_header_dir='$(CROSS_SYSTEM_HEADER_DIR)' + BUILD_SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' fi if test x$host != x$target @@ -12228,7 +12230,7 @@ if test x$host != x$target then CROSS="-DCROSS_DIRECTORY_STRUCTURE" ALL=all.cross - SYSTEM_HEADER_DIR=$build_system_header_dir + SYSTEM_HEADER_DIR=$BUILD_SYSTEM_HEADER_DIR case $target in *-*-mingw*) if test "x$with_headers" = x; then @@ -12239,16 +12241,17 @@ then ;; esac elif test "x$TARGET_SYSTEM_ROOT" != x; then - SYSTEM_HEADER_DIR=$build_system_header_dir + SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' fi -if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then +if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x || + test x$build != x$host || test "x$with_build_sysroot" != x; then if test "x$with_headers" != x && test "x$with_headers" != xyes; then target_header_dir=$with_headers + elif test "x$with_build_sysroot" != "x"; then + target_header_dir="${with_build_sysroot}${native_system_header_dir}" elif test "x$with_sysroot" = x; then target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include" - elif test "x$with_build_sysroot" != "x"; then - target_header_dir="${with_build_sysroot}${native_system_header_dir}" elif test "x$with_sysroot" = xyes; then target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}" else @@ -18433,7 +18436,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18436 "configure" +#line 18439 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18539,7 +18542,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18542 "configure" +#line 18545 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 246899) +++ gcc/configure.ac (working copy) @@ -1998,14 +1998,15 @@ done CROSS= AC_SUBST(CROSS) ALL=all.internal AC_SUBST(ALL) SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' AC_SUBST(SYSTEM_HEADER_DIR) +BUILD_SYSTEM_HEADER_DIR=$SYSTEM_HEADER_DIR AC_SUBST(BUILD_SYSTEM_HEADER_DIR) if test "x$with_build_sysroot" != x; then - build_system_header_dir=$with_build_sysroot'$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' -else + BUILD_SYSTEM_HEADER_DIR=$with_build_sysroot'$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' +elif test x$host != x$target; then # This value is used, even on a native system, because # CROSS_SYSTEM_HEADER_DIR is just # $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR). - build_system_header_dir='$(CROSS_SYSTEM_HEADER_DIR)' + BUILD_SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' fi if test x$host != x$target @@ -2012,7 +2013,7 @@ if test x$host != x$target then CROSS="-DCROSS_DIRECTORY_STRUCTURE" ALL=all.cross - SYSTEM_HEADER_DIR=$build_system_header_dir + SYSTEM_HEADER_DIR=$BUILD_SYSTEM_HEADER_DIR case $target in *-*-mingw*) if test "x$with_headers" = x; then @@ -2023,16 +2024,17 @@ then ;; esac elif test "x$TARGET_SYSTEM_ROOT" != x; then - SYSTEM_HEADER_DIR=$build_system_header_dir + SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' fi -if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then +if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x || + test x$build != x$host || test "x$with_build_sysroot" != x; then if test "x$with_headers" != x && test "x$with_headers" != xyes; then target_header_dir=$with_headers + elif test "x$with_build_sysroot" != "x"; then + target_header_dir="${with_build_sysroot}${native_system_header_dir}" elif test "x$with_sysroot" = x; then target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include" - elif test "x$with_build_sysroot" != "x"; then - target_header_dir="${with_build_sysroot}${native_system_header_dir}" elif test "x$with_sysroot" = xyes; then target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}" else Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 246899) +++ gcc/Makefile.in (working copy) @@ -518,11 +518,7 @@ CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR 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 +BUILD_SYSTEM_HEADER_DIR = `echo @BUILD_SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` # Control whether to run fixincludes. STMP_FIXINC = @STMP_FIXINC@