On Fri, Jan 29, 2021 at 05:27:11PM +0100, Thomas Monjalon wrote: > 29/01/2021 17:05, Bruce Richardson: > > On Fri, Jan 29, 2021 at 04:04:18PM +0000, Burakov, Anatoly wrote: > > > On 29-Jan-21 3:55 PM, Bruce Richardson wrote: > > > > On Fri, Jan 29, 2021 at 04:47:35PM +0100, Thomas Monjalon wrote: > > > > > 19/01/2021 14:03, Bruce Richardson: > > > > > > Since the examples are designed to be built by end-users using > > > > > > Make, we > > > > > > can detect and warn about broken pkg-config on the user's system as > > > > > > part > > > > > > of the build process. > > > > > > > > > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > [...] > > > > > > 56 files changed, 455 insertions(+), 3 deletions(-) > > > > > > > > > > That's a lot of duplicated code that may need some extension in > > > > > future. > > > > > What about having a file examples/common.mk to include? > > > > > With the special syntax -include there will be no error in case > > > > > ../common.mk does not exist. Deal? > > > > > > > > > > ref: https://www.gnu.org/software/make/manual/html_node/Include.html > > > > > > > > > > > > > Yes, and no. There is far more boilerplate already in these files which > > > > needs to be consolidated, so I see little point in just trying to > > > > extract > > > > this part out alone. Therefore, what I'd like to see done (if ever > > > > someone > > > > has the time) is to extract all the boilerplate out to a common > > > > makefile, > > > > but also add a postinstall script to flatten out the makefile on > > > > install, > > > > so that each example is once again self-contained. > > > > > > > > I've been thinking about this for a while, just haven't got time for it. > > > > > > > > /Bruce > > > > > > > > > > These makefiles are supposed to be examples. Meaning, it should be > > > possible > > > to just take the example app and compile it as is. That means we can't > > > rely > > > on external makefiles, they're supposed to be self-contained. > > > > > Exactly. Hence the need to "flatten" out the makefiles, by changing the > > include to be the actual contents. > > My proposal is just for pkg-config check, which doesn't serve as an example. > If this check is not there, it still works. > That's what -include is for: include optional stuff which can be missing. >
Yes, but given the number of times I've had queries about the static builds being broken on RHEL7, I think it's quite important that this check be there to flag it. Therefore, I'd rather not have it in a common file that could be missed.