Hi Alex,

Alex Samad wrote:

> make -p -f/dev/null | grep -i include
> make: *** No targets.  Stop.
> .INCLUDE_DIRS = /usr/include /usr/local/include /usr/include
>
> show me the default INCLUDE_DIRS and /usr/include is included twice.

This is from read.c:

        static const char *default_include_directories[] =
          {
            INCLUDEDIR,
            "/usr/gnu/include",
            "/usr/local/include",
            "/usr/include",
            0
          };

INCLUDEDIR is set by configure to ${prefix}/include, and any
directory that does not exist gets pruned from the list.

> But I think the more important problem is it is before the
> /usr/local/include

Yes, I agree.  Would it make sense to remove the first instance
of any repeated directory in the list?  That way:

 - if prefix=/usr/local, the list would be:

        /usr/local/include
        /usr/include

 - if prefix=/usr, the list would be:

        /usr/local/include
        /usr/include

 - if prefix=/home/alex, the list would be

        /home/alex/include
        /usr/local/include
        /usr/include

In this case, would it make sense to allow a MAKE_INCLUDE_PATH
environment variable to add to the default search path (overridden by
-I)?  Otherwise unprivileged users on a typical multiuser system would
have no place to put rule collections for that purpose.

An alternative would be to discourage use of the include file
search path and point in the documentation to some better methods if
they exist.  Thoughts welcome.

Thanks for reporting,
Jonathan

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to