bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make: /usr/local/include is wrong priority in default include_dirs


From: Jonathan Nieder
Subject: Re: make: /usr/local/include is wrong priority in default include_dirs
Date: Mon, 14 Feb 2011 22:02:27 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]