dos33fsprogs
dos33fsprogs copied to clipboard
utils/{gr,hgr}-utils/Makefile: Use pkg-config for compile/link flags
Calls to $(CC) assumed that png.h, -lpng etc. were all in the default paths used by the compiler. However, this is not the case on some systems, such as MacOS using the MacPorts package system.
Add calls to pkg-config to add the appropriate paths to CFLAGS if necessary, and introduce LDFLAGS for linker library paths.
This assumes that pkg-config is available; it usually is (particularly on systems using GCC), but further work may be required if this is required to run on systems where it's not.
This also assumes Gnu Make; again further work may be required if this needs to be made compatible with Berkeley Make.
This has been tested on Debian 11 and on MacOS 10.14.6 with MacPorts 2.8.1
Just checking in to see if this can get merged.