]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
improve error when /usr/include isn't found [PR90835]
authorEric Gallager <egallager@gcc.gnu.org>
Wed, 25 May 2022 16:45:33 +0000 (12:45 -0400)
committerEric Gallager <egallager@gcc.gnu.org>
Sun, 20 Aug 2023 03:57:01 +0000 (23:57 -0400)
This is a pretty simple patch that ought to help Darwin users understand
better why their build is failing when they forget to pass the
--with-sysroot= flag to configure.

gcc/ChangeLog:

PR target/90835
* Makefile.in: improve error message when /usr/include is
missing

gcc/Makefile.in

index 5f4dc4874952106ac8de2e719e43cc6f96beb0d4..78779546459f965f55ba59b04fd637b112e69ca0 100644 (file)
@@ -55,6 +55,7 @@ MAKEOVERRIDES =
 # -------------------------------
 
 build=@build@
+build_os=@build_os@
 host=@host@
 host_noncanonical=@host_noncanonical@
 host_os=@host_os@
@@ -3333,8 +3334,13 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
            multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
            fix_dir=include-fixed$${multi_dir}; \
            if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \
-             echo The directory that should contain system headers does not exist: >&2 ; \
+             echo "The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does not exist:" >&2 ; \
              echo "  ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \
+             case ${build_os} in \
+               darwin*) \
+                 echo "(on Darwin this usually means you need to pass the --with-sysroot= flag to point to a valid MacOS SDK)" >&2; \
+                 ;; \
+             esac; \
              tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
              if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
              then sleep 1; else exit 1; fi; \