[syslog-ng] [PATCH] afmongodb: Support system-installed libmongo-client at configure time.

Gergely Nagy algernon at madhouse-project.org
Tue Sep 6 09:40:07 CEST 2011


Gergely Nagy <algernon at balabit.hu> writes:

>>> Done. libmongo-client 0.1.3 has been released as of an hour or so ago,
>>> tagged in git and all that. It removes the need for glib >= 2.16, and
>>> will work with 2.12 and up. When building with < 2.16, OpenSSL becomes a
>>> requirement, as I use its MD5 functions to emulate GChecksum.
>>
>> It turns out this is not entirely true. HEAD of 3.3 does not compile on RHEL5, 
>> which has glib 2.12, because those 3 examples: 
>>
>> modules/afmongodb/libmongo-client/examples/mongo-dump.c
>> modules/afmongodb/libmongo-client/examples/gridfs.c
>> modules/afmongodb/libmongo-client/examples/bson-inspect.c
>>
>> use g_option_context_get_help(), which - according to documentation at 
>> http://developer.gimp.org/api/2.0/glib/ix09.html - is new in 2.14.
>>
>> I've replaced g_option_context_get_help() occurences with simple static
>> gchar *help = "You must specify --this and --that\n";
>> and it seems to build fine.
>
> Thanks for catching this! I'll fix the examples accordingly.

Done in my git repo. I solved the problem by calling
g_option_context_parse() again, with an explicitly constructed argv,
that contains "--help", in case the help needs to be displayed.

This is a gross and ugly hack, but has the advantage of working on 2.12
aswell as anything newer, and will display the correct help output
without manually having to keep the 2.12 and post-2.12 version in sync.

Bazsi, can you update the internal libmongo-client to my latest master?
(only documentation & packaging related changes since 0.1.3 + the above
hack)

-- 
|8]


More information about the syslog-ng mailing list