You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2010/08/23 11:28:26 UTC

Re: svn commit: r987956 - /subversion/trunk/build/ac-macros/serf.m4

jerenkrantz@apache.org wrote on Sun, Aug 22, 2010 at 22:57:26 -0000:
> Author: jerenkrantz
> Date: Sun Aug 22 22:57:26 2010
> New Revision: 987956
> 
> URL: http://svn.apache.org/viewvc?rev=987956&view=rev
> Log:
> Add a compile-time version check for serf so we can reject old versions.
> 
> * build/ac-macros/serf.m4
>   (SVN_LIB_SERF): Set minimum version to 0.3.1 and ensure we see at least that.
> 
> Modified:
>     subversion/trunk/build/ac-macros/serf.m4
> 
> Modified: subversion/trunk/build/ac-macros/serf.m4
> URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/serf.m4?rev=987956&r1=987955&r2=987956&view=diff
> ==============================================================================
> --- subversion/trunk/build/ac-macros/serf.m4 (original)
> +++ subversion/trunk/build/ac-macros/serf.m4 Sun Aug 22 22:57:26 2010
> @@ -27,6 +27,10 @@ AC_DEFUN(SVN_LIB_SERF,
>  [
>    serf_found=no
>  
> +  serf_check_major=0
> +  serf_check_minor=3
> +  serf_check_patch=1
> +
>    AC_ARG_WITH(serf,AS_HELP_STRING([--with-serf=PREFIX],
>                                    [Serf WebDAV client library]),
>    [
> @@ -40,7 +44,16 @@ AC_DEFUN(SVN_LIB_SERF,
>        AC_CHECK_HEADERS(serf.h,[
>          save_ldflags="$LDFLAGS"
>          LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
> -        AC_CHECK_LIB(serf-0, serf_context_create,[serf_found="yes"], ,
> +        AC_CHECK_LIB(serf-0, serf_context_create,[
> +          AC_TRY_COMPILE([
> +#include <stdlib.h>
> +#include "serf.h"
> +],[
> +#if ! SERF_VERSION_AT_LEAST($serf_check_major, $serf_check_minor, $serf_check_patch)
> +#error Serf version too old: want $serf_check_major.$serf_check_minor.$serf_check_patch, got SERF_VERSION_STRING

Does this actually expand SERF_VERSION_STRING?  A quick independent test
indicates it wouldn't...

> +#endif
> +], [serf_found=yes], [AC_MSG_WARN([Serf version too old: need $serf_check_major.$serf_check_minor.$serf_check_patch])
> +        serf_found=no])], ,
>            $SVN_APRUTIL_LIBS $SVN_APR_LIBS -lz)
>          LDFLAGS="$save_ldflags"])
>        CPPFLAGS="$save_cppflags"
> 
> 

Re: svn commit: r987956 - /subversion/trunk/build/ac-macros/serf.m4

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Justin Erenkrantz wrote on Mon, Aug 23, 2010 at 06:18:14 -0700:
> On Mon, Aug 23, 2010 at 4:28 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Does this actually expand SERF_VERSION_STRING?  A quick independent test
> > indicates it wouldn't...
> 
> Ah, you're right.  Hmm.  Any ideas?  -- justin

Just drop the macro from the #error and, instead, include the path to
the used serf.h in the error message?

grep the version-number-tuple macros from serf.h manually?

Re: svn commit: r987956 - /subversion/trunk/build/ac-macros/serf.m4

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Justin Erenkrantz wrote on Mon, Aug 23, 2010 at 06:18:14 -0700:
> On Mon, Aug 23, 2010 at 4:28 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Does this actually expand SERF_VERSION_STRING?  A quick independent test
> > indicates it wouldn't...
> 
> Ah, you're right.  Hmm.  Any ideas?  -- justin

Just drop the macro from the #error and, instead, include the path to
the used serf.h in the error message?

grep the version-number-tuple macros from serf.h manually?

Re: svn commit: r987956 - /subversion/trunk/build/ac-macros/serf.m4

Posted by Justin Erenkrantz <je...@apache.org>.
On Mon, Aug 23, 2010 at 4:28 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Does this actually expand SERF_VERSION_STRING?  A quick independent test
> indicates it wouldn't...

Ah, you're right.  Hmm.  Any ideas?  -- justin