[Csync2] csync2 without gnutls-openssl?

Lars Ellenberg lars.ellenberg at linbit.com
Wed Jul 28 18:58:50 CEST 2010


On Wed, Jul 28, 2010 at 04:47:51PM +0200, Giampaolo Tomassoni wrote:
> > > Lars, AM_PATH_LIBGNUTLS was completely undefined, so the
> > > pkg-config/gnutls-config isn't that much relevant with respect to the
> > > autogen.sh failure.
> > 
> > Yes, it is undefined, because it should be (or used to be) in the dev
> > package of libgnutls, but no longer is, because they apparently decided
> > they had a better approach.
> 
> It seems to me they simply discontinued support of that m4 macro.

That's what I meant.
They ship a .pc since at least 1.4.
They dropped the .m4 with 2.8 (or so).

> I think they switched to pkg-config and they supposed that the "stock"
> PKG_CHECK_MODULES was then enough to detect their package.

It is.

> So, you may use the PKG_CHECK_MODULES macro offered by the pkg-config
> package. Which means you have to put a copy of the pkg.m4 file into the m4/
> dir of the csync2 package.

No, I would not. Nothing of that is in version control.
In release tarball, configure would be provided (all macros expanded).

If someone insists on building from scratch using autofoo,
he is supposed to have an autofoo capable environment, where pkg.m4
would reside in /usr/share/aclocal/pkg.m4 (or where ever it belongs).

> Unfortunately, there possibly is people running
> systems with a pre-2.8.x version of libgnutls,

pre 1.4 ?

> or even with no pkg-config support.

Is that so.

> If you go straight with a pkg-config -only solution you're going to
> cut 'em out.

I don't really care for debian potato anymore.

> Isn't it easier to ship the m4/libgnutls.m4 script, which covers both
> the pkg-config and gnutls-config cases, instead of the m4/pkg.m4 one,
> which only covers the first one?

Isn't it easier to rely on whatever libgnutls-dev ships
for integration with autofoo.

I don't like to include compatibility cruft just because we can,
or adding new files to version control if a one-line diff would be
sufficient.

Anyways, if you insist, how about:

diff --git a/configure.ac b/configure.ac
index a3ef7ee..3aa600c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,7 +78,14 @@ AC_ARG_ENABLE([gnutls],
 if test "$enable_gnutls" != no
 then
 	# Check for gnuTLS.
-	AM_PATH_LIBGNUTLS(1.0.0, , [ AC_MSG_ERROR([[gnutls not found; install gnutls, gnutls-openssl and libtasn1 packages for your system or run configure with --disable-gnutls]]) ])
+	PKG_CHECK_MODULES(LIBGNUTLS, gnutls >= 1.0.0,, [
+		ifdef([AM_PATH_LIBGNUTLS],
+			[AM_PATH_LIBGNUTLS(1.0.0, , AC_MSG_ERROR([[gnutls not found; install gnutls and libtasn1 packages for your system or run configure with --disable-gnutls]]))],
+			[AC_MSG_ERROR([
+***  Neither pkg-config nor older .m4 macros found for libgnutls.
+***  Install libgnutls development packages and rerun autogen.sh,
+***  or --disable-gnutls])])
+	])
 
 	## This is a bloody hack for fedora core
 	CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"


More information about the Csync2 mailing list