debian: build against PCRE v2 when available
Decide which PCRE version to use at build time based on which -dev
package is installed. This is the usual way in a Debian package to
gracefully handle a build-time dependency that has changed API.
It would be nice to offer a build profile to allow explicitly using
libpcre3-dev when libpcre2-dev is also installed, but build profiles
in Build-Depends are a relatively recent feature, so that would hurt
backports. Anyway, libpcre2-dev is what upstream wants to migrate
to so it's best that end-users start using it and reporting bugs.
This change has already been well tested in Debian experimental since
2017-06-26.
Requested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>