Hans-Peter Nilsson wrote: > > > So, ISTM we should change --with-headers (=yes) to either look > > > in sys-include or in include. Setting it to sys-include > > > wouldn't help you or anyone else as it's already the default... > > > > On the other hand, the current docs appear to imply that the > > intent was for --with-headers (=yes) to look into a pre-existing > > sys-include directory for headers. > > Right. So, if you'd prefer to align the implementation with > that, I don't mind. But, these are odd cases as-is, so current > use and users matter when aligning the documentation and > implementation and I wouldn't be surprised if the entire > usage-space is between ours...
So overall, I now this is probably the best way forward: 1) Fix --with-headers to work just like no argument does now, i.e. look in sys-include. This is a simple bugfix that brings behavior in line with documentation. It does imply that everybody has to use sys-include, but that seems to be accepted practice anyway. (For me, it just means adding a symlink.) If at some point we do want to make things work without sys-include, I see two options: 2a) Change <no argument> to not look into sys-include, but include. This would be a change in existing behavior that would affect some users. (They could get the old behavior back by simply adding --with-headers to their configure line, however.) --or-- 2b) Change target_header_dir from a single directory to a list of directories, and check all of these for header files. This list would typically include both sys-include and include. This should not change behavior for any existing user, and would bring the header search at configure time in line with the actual search order used by the compiler at run time, which will probably be the least surprise to users anyway ... For 1), something like the following should probably suffice: Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 228530) +++ gcc/configure.ac (working copy) @@ -1993,7 +1993,7 @@ elif test "x$TARGET_SYSTEM_ROOT" != x; t fi if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then - if test "x$with_headers" != x; then + if test "x$with_headers" != x && test "x$with_headers" != xyes; then target_header_dir=$with_headers elif test "x$with_sysroot" = x; then target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include" I'll probably not spend any more time right now to try to implement either of the 2) variants; I can live with using sys-include for now. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain ulrich.weig...@de.ibm.com