Wijnand Wiersma wrote on Wed, Apr 25, 2007 at 09:49:25PM +0200:
> 2007/4/25, steven mestdagh <[EMAIL PROTECTED]>:
>> Ingo Schwarze [2007-04-24, 01:29:52]:
>>> steven mestdagh wrote:
>>>> Ingo Schwarze wrote:

>>>>> jabber server, original implementation in C/C++
>>>>
>>>> it looks like configure does not test for snprintf, and it
>>>> decides to compile its own version.  can you avoid that and
>>>> use the function in libc?
>>>
>>> Yes, that seems possible.  Thanks for the suggestion!
>>>
>>> The updated tarball contains two additional patches:
>>>   patch-jabberd_lib_Makefile_in (to leave snprintf.o out of libjabberd)
>>>   patch-jabberd_lib_jabberdlib_h (to not alias snprintf to ap_snprintf)
>>
>> that works, but it's probably more interesting to fix configure.ac to
>> check for snprintf/vsnprintf, since snprintf.c and jabberdlib.h already
>> have the necessary #if !defined(HAVE_SNPRINTF) etc. such a fix will be
>> easier to get included upstream, and the port will be easier for you to
>> maintain.

I decided not to patch configure.ac for two reasons:
 - I was trying to avoid CONFIGURE_STYLE=autoconf.
 - Matthias told me that he is removing snprintf.c from his codebase,
   anyway, see http://svn.jabberd.org/trunk/jabberd14/jabberd/lib/.

> True, so I want to step in now and provide this updated version of the
> 'b3' version Ingo posted initially. This version patches configure.ac
> to make sure HAVE_SNPRINTF and HAVE_VSNPRINTF  will be defined.  I
> also changed CONFIGURE_STYLE=gnu to autoconf and made sure autoconf
> 2.60 is being used.

I redid the tests with Wijnand's patch (on i386-current):
 - all flavor combinations still compile, install and deinstall
 - the server still appears to be working with filespool and mysql
 - changes to the build logs look reasonable
 - binary changes (checked using nm):
    * bin/jabberd14 now has "U snprintf" instead of "U ap_snprintf"
    * lib/libjabberd.so.1.0 now has "U snprintf" and "U vsnprintf",
      but lost "T ap_snprintf", "T ap_vsnprintf", etc.  It still
      contains a reference to "F snprintf.c", but no symbols from it,
      jabberd/lib/.libs/snprintf.o now being empty.

> I am not sure this change is complete now so please review.

Let's pick one nit: ${PATCHDIR}/patch-configure_ac.orig
should be trashed.

>From my point of view, both Wijnand's version b5 and my version b4
are ok.  So choose whichever you like better.  :)

Reply via email to