Hola!
Thank you for considering this small patch and for your fast reply!
> though ${PREFIX}/lib and ${PREFIX}/include
> actually depends on user-provided path (PREFIX),
> I'm not sure that's what you actually want.
That's correct, my mistake. I should of just written /usr/local/
instead.
> Also, if I understand your objective here,
Sorry, I might not have been clear enough with my mail. My objective is
to respect OpenBSD's and FreeBSD's hierarchy as documented in their
hier(7) manual.
> it seems that /usr/(local/)lib and include
> would already be part of the system compiler
> internal path lookup, wouldn't it?
I do not think so as on FreeBSD and OpenBSD, /usr/local/ is for non
system libraries, programs and files.
The default compiler on FreeBSD is clang and here is the internal path
lookup :
$ cc -print-search-dirs
programs: =/usr/bin
libraries: =/usr/lib/clang/16:/usr/lib
The same goes for gcc :
$ gcc -print-search-dirs
install: /usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/
programs:
=/usr/local/libexec/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/libexec/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/libexec/gcc13/gcc/x86_64-portbld-freebsd14.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../../../x86_64-portbld-freebsd14.0/bin/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../../../x86_64-portbld-freebsd14.0/bin/
libraries:
=/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../../../x86_64-portbld-freebsd14.0/lib/x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../../../x86_64-portbld-freebsd14.0/lib/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../x86_64-portbld-freebsd14.0/13.2.0/:/usr/local/lib/gcc13/gcc/x86_64-portbld-freebsd14.0/13.2.0/../../../:/lib/x86_64-portbld-freebsd14.0/13.2.0/:/lib/:/usr/lib/x86_64-portbld-freebsd14.0/13.2.0/:/usr/lib/
If this is correct, users should manually include /usr/local/lib.
Here is the pertinent FreeBSD hier(7) entry
---
/usr/ contains the majority of user utilities and applications
[...]
include/ standard C include files
lib/ shared and archive ar(1)-type libraries
[...]
local/ local executables, libraries, etc. Also used
as the default destination for the ports(7)
framework. Within local/, the general layout
sketched out by hier for /usr should be used.
Exceptions are the ports documentation (in
share/doc/<port>/), and /usr/local/etc (mimics
/etc).
---
(https://man.freebsd.org/cgi/man.cgi?query=hier)
And here is the pertinent OpenBSD hier(7) entry
---
/usr/
Contains the majority of user utilities and applications.
[...]
include/
Standard C include files.
[...]
lib/
System libraries. See intro(3) for a description of
library types.
[...]
local/
Local executables, libraries, etc.
---
(https://man.openbsd.org/hier)
But, I might be mistaken if there is another way to see the system
compiler internal path lookup.
> So, maybe we could just have a shared entry
> between Open and Free (and Net) BSDs, for
> #FREETYPEINC = $(X11INC)/freetype2
Yes, this should be good for the BSDs. Although X11LIB and X11INC
should still be added for FreeBSD and NetBSD.
FreeBSD's X11LIB is /usr/local/lib (/usr/loca/lib/X11)
FreeBSD's X11INC is /usr/local/include (/usr/local/include/X11/)
As I only use OpenBSD and FreeBSD, I have never tried any suckless
software on NetBSD, but after looking through its hier(7) manual, it
does seem to differ as well.
NetBSD's hier(7) does not seem to use /usr/X11R6/ nor /usr/local/.
---
/usr/ Contains the majority of the system utilities and files.
X11R7/ X11 files (for X11 revision 7).
----
(https://man.netbsd.org/hier.7)
So, given the hier(7) man page :
NetBSD's X11LIB might be /usr/X11R7/lib
NetBSD's X11INC might be /usr/X11R7/include
I can try it and confirm it.
OpenBSD should be ok without redefining X11LIB and X11INC as it does
use /usr/X11R6/ and I remember some discussion about no interest in
renaming X11R6 to X11R7.
---
/usr/
Contains the majority of user utilities and applications.
X11R6/
Files required for the X11 window system.
[...]
include/
X11-specific C include files.
lib/
X11 archive libraries.
---
(https://man.openbsd.org/hier)
Sorry for the long email, I did not think that it would be so long.
Let me know what you think :)