[zeromq-dev] Add build-information to ZMQ headers
Patric Schmitz
bzk0711 at aol.com
Tue Jan 14 10:57:26 CET 2014
On Tue, 14 Jan 2014 09:55:51 +0100
Goswin von Brederlow <goswin-v-b at web.de> wrote:
> On Tue, Jan 14, 2014 at 01:21:18AM +0100, Patric Schmitz wrote:
> > Dear zeromq developers,
> >
> > in our project using zeromq, we depend on the PGM features which we use
> > for multicast synchronisation in our cluster environment. I would like
> > to be able to compile-time test, when building against zeromq, wether
> > that specific build has PGM support enabled or not, in order to abort
> > or warn the user if he tries to use a 'wrongly' configured build.
> > However, having looked at the zmq headers, I see, as of now, no way of
> > doing so.
>
> Is that realy a compile time feature? What if I compile an app against
> libzmq without pgm and then replace libzmq with a recompiled version
> that has pgm? Does that require everything to be recompiled for pgm to
> work? If so then the pgm feature would have to be part of the soname
> too and things get ugly.
True. I had thought about that but didn't get it sorted clearly. If it
is indented that available transports are not part of the ABI this
would indeed make versioning pretty much impossible especially if
several optional transports are there to choose from. Out of interest,
how would I go about this if I _need_ to be able to decide at
compile-time wether some feature is available for some reason? Probably
refactor every independent optional feature in a separate .so with its
own ABI version?
> ...
>
> The define would maybe prevent some accidental mishaps telling you
> earlier that pgm support is missing. But they wouldn't prevent a non
> pgm libzmq from being used later on. On the other hand the define
> would prevent compiling against a libzmq without pgm but later use it
> with one with pgm. So I'm not sure that define would be all that
> usefull.
Agreed.
>
> > diff --git a/configure.ac b/configure.ac
> > index a258bf0..28af2d2 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -456,6 +456,11 @@ if test "x$with_system_pgm_ext" != "xno"; then
> > [AC_MSG_ERROR([--with-system-pgm requires a working pkg-config installation])])
> > fi
> >
> > +pgm_available=0
> > +if test "x$with_system_pgm_ext" != "xno" -o "x$with_pgm_ext" != "xno" ; then
> > + pgm_available=1
> > +fi
> > +AC_SUBST(pgm_available)
> > AC_SUBST(pgm_basename)
> >
> > # Set -Wall, -Werror and -pedantic
> > @@ -530,5 +535,6 @@ AC_CONFIG_FILES([Makefile \
> > tools/Makefile \
> > builds/msvc/Makefile \
> > foreign/openpgm/Makefile \
> > - builds/redhat/zeromq.spec])
> > + builds/redhat/zeromq.spec \
> > + include/zmq.h])
> > AC_OUTPUT
>
> @@ -530,5 +535,7 @@ AC_CONFIG_FILES([Makefile \
> tools/Makefile \
> builds/msvc/Makefile \
> foreign/openpgm/Makefile \
> - builds/redhat/zeromq.spec])
> + builds/redhat/zeromq.spec \
> + include/zmq.h \
> + ])
> AC_OUTPUT
>
> That way future changes will only add lines, not replace old ones just
> to add the "\" to the end. But that might be just my preference.
Good point. Thanks for your input!
Best regards
--
Patric Schmitz <bzk0711 at aol.com>
More information about the zeromq-dev
mailing list