The attached patch implements the automatic appending of the appropriate flags on CPPFLAGS and LDFLAGS if x11-dev is found on the BuildDepends. Note that we don't seem to have a special routine yet to check for the presence of a specific package on Depends or BuildDepends. The current patch places the test that sets the $BD_on_x11_dev in the resolve_altspec(). Tested on 10.10 fink by checking the CPPFLAGS set with and without x11-dev being present on the BuildDepends line.
This patch will make fink robust to removal of the X11 and X11R6 convenience symlinks and should make the usage of "--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" unnecessary. That construct is extremely problematic to retain if we don't insure the presence of the convenience symlinks.
Initial implementation of automatic appending of X11 flags to CPPFLAGS/LDFLAGS on detection of x11-dev in the BuildDepends field.
For folks who want to try this quickly and easily, download the zip file from https://github.com/fink/fink/tree/auto_append_x11_flags and use ./inject.pl from the unpacked directory.
Pull request open at
https://github.com/fink/fink/pull/117