[PATCH] Add pkg-config support

Niels Möller nisse at lysator.liu.se
Tue Aug 30 17:56:39 UTC 2016


Michael Catanzaro <mcatanzaro at gnome.org> writes:

> Right... using AC_CHECK_LIB has been considered primitive for a long
> time now. I was really surprised to see GMP doesn't already have pkg-
> config file. I can't imagine why you wouldn't want to support it, since
> it's just one file to install.

I don't say we don't want to support it, even if I'm not as enthusiastic
about it as you are.

Also, in my opinion, the main reason to have pkg-config is to make
things simpler for projects which are *not* using autoconf, but just want
to add CFLAGS=`pkg-config bla bla` directly in their Makefile or build
script.

> I took a quick peek at the documentation format but it doesn't look
> straightforward to update, 

Source format is texinfo, in the file doc/gmp.texi. If you want to work
with GNU packages, you should get at least somewhat familiar with it.

> It's optional. One popular convention is that you never break API
> without changing the name of the pkg-config file, and adding an API
> version there accomplishes that.

Are conventions and best practices documented somewhere?

> I like it since it's a nice way to ensure
> application developers know an API break has occurred, if API breaks
> are rare (as they seem to be for GMP).

That's tricky to make useful, you have to think carefully about what the
number means. There's ABI breaks, API breaks, and compatible extensions,
all tricky to capture in a single number. I think I'd prefer to not have
any version number here. And if a program needs to test for a particular
gmp feature, I *strongly* recommend doing traditional autoconf-style
functional tests for the features that are actually needed.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list