Other Setting CFLAGS for X11 libraries

To start off, I am very inexperienced with modifying makefiles or CFLAGS or anything of the sort. This may have a simple solution, but I haven't found documentation yet that points me in the right direction. I am still looking, but am asking here at the same time.

I am trying to do a basic compile of progman - https://github.com/jcs/progman. It appears the program was developed with OpenBSD in mind, and the video tutorial that vermaden linked to was using OpenBSD. Running make returns an error that X11/Xutil.h could not be found. Checking the makefile, it has a prefix and x11BASE set:

Code:
PREFIX?=    /usr/local
X11BASE?=    /usr/X11R6

I tried exporting CFLAGS as mentioned in the tutorial, adjusting for the location difference in FreeBSD
export CFLAGS="-I/usr/local/include/X11 -I/usr/local/include/freetype2"

Running make, it looks like that is used, but I still get the error about the missing library. I have verified the file is in /usr/local/include/X11

I suppose it would be simple to change the "X11BASE?=" to the appropriate location in FreeBSD, but since the files are distributed amongst several different folders, I'm not sure which one to choose. Or simply remove it and allow make to determine? Or is there something in how CFLAGS are set that is different in FreeBSD from OpenBSD that means I have to change the options there?
 
PREFIX and X11BASE typically determine where the executable (or library) gets installed (often it ends up in ${PREFIX}/bin for example), it has very little to do with the location of the include headers and/or libraries.


I tried exporting CFLAGS as mentioned in the tutorial, adjusting for the location difference in FreeBSD
export CFLAGS="-I/usr/local/include/X11 -I/usr/local/include/freetype2"
Almost correct. It's looking for X11/Xutil.h, so the first include directory should be /usr/local/include because the full path of the header file is /usr/local/include/X11/Xutil.h. Many ports install their header files in /usr/local/include, so that's always good to add. There are some libraries/includes that have a slightly different directory though, they're deliberately installed in a separate include/lib directory (like your /usr/local/include/freetype2).

I suppose it would be simple to change the "X11BASE?=" to the appropriate location in FreeBSD
No, don't. It used to exist and was set to /usr/X11R6 but nowadays it's simply set to LOCALBASE (/usr/local/), same as PREFIX.
 
PREFIX and X11BASE typically determine where the executable (or library) gets installed (often it ends up in ${PREFIX}/bin for example), it has very little to do with the location of the include headers and/or libraries.



Almost correct. It's looking for X11/Xutil.h, so the first include directory should be /usr/local/include because the full path of the header file is /usr/local/include/X11/Xutil.h. Many ports install their header files in /usr/local/include, so that's always good to add. There are some libraries/includes that have a slightly different directory though, they're deliberately installed in a separate include/lib directory (like your /usr/local/include/freetype2).


No, don't. It used to exist and was set to /usr/X11R6 but nowadays it's simply set to LOCALBASE (/usr/local/), same as PREFIX.
Thanks!
I set the CFLAG to -I/usr/local/include, and it got past that error. There's another file it can't find now, but I should be able to work from here. I'll report back on what I find.
 
Back
Top