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 2015/07/30 18:12:57 UTC

Re: svn commit: r1693159 - /subversion/trunk/build/ac-macros/apache.m4

philip@apache.org wrote on Tue, Jul 28, 2015 at 20:53:05 -0000:
> Author: philip
> Date: Tue Jul 28 20:53:04 2015
> New Revision: 1693159
> 
> URL: http://svn.apache.org/r1693159
> Log:
> * build/ac-macros/apache.m4 (SVN_FIND_APACHE): Extract version with two
>    simpler sed commands to support Solaris and OSX sed.
> 
> Modified:
>     subversion/trunk/build/ac-macros/apache.m4
> 
> Modified: subversion/trunk/build/ac-macros/apache.m4
> URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/apache.m4?rev=1693159&r1=1693158&r2=1693159&view=diff
> ==============================================================================
> --- subversion/trunk/build/ac-macros/apache.m4 (original)
> +++ subversion/trunk/build/ac-macros/apache.m4 Tue Jul 28 20:53:04 2015
> @@ -97,9 +97,9 @@ fi
>  # PR 55397: https://issues.apache.org/bugzilla/show_bug.cgi?id=55397
>  if test -n "$APXS" && test "$APXS" != "no"; then
>    AC_MSG_CHECKING([mod_dav version])
> -  HTTPD_MAJOR=`$SED -ne '/^#define AP_SERVER_MAJORVERSION_NUMBER/{s/^.*NUMBER *//;p}' "$APXS_INCLUDE/ap_release.h"`
> -  HTTPD_MINOR=`$SED -ne '/^#define AP_SERVER_MINORVERSION_NUMBER/{s/^.*NUMBER *//;p}' "$APXS_INCLUDE/ap_release.h"`
> -  HTTPD_PATCH=`$SED -ne '/^#define AP_SERVER_PATCHLEVEL_NUMBER/{s/^.*NUMBER *//;p}' "$APXS_INCLUDE/ap_release.h"`
> +  HTTPD_MAJOR=`$SED -ne '/^#define AP_SERVER_MAJORVERSION_NUMBER/p' "$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`
> +  HTTPD_MINOR=`$SED -ne '/^#define AP_SERVER_MINORVERSION_NUMBER/p' "$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`
> +  HTTPD_PATCH=`$SED -ne '/^#define AP_SERVER_PATCHLEVEL_NUMBER/p' "$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`

If we want to avoid parsing the header file, I think we could use
AC_TRY_COMPILE() and check the values of the macros via preprocessor
#if/#error/#endif directives.