Author: svn-role
Date: Mon Dec 25 04:00:08 2017
New Revision: 1819229

URL: http://svn.apache.org/viewvc?rev=1819229&view=rev
Log:
Merge the r1818651 group from trunk:

  * r1818651, r1818662, r1818727, r1818801, r1818803, r1818807, r1818868, 
r1818871, r1819162
    Improve lz4,utf8proc configure behavior, and print the lz4 version in 
--version -v
    Justification:
      Correctly detect, note and print dependencies for builders/packagers.
    Votes:
     +1: stefan2, astieger, jamessan

Modified:
    subversion/branches/1.10.x/   (props changed)
    subversion/branches/1.10.x/INSTALL
    subversion/branches/1.10.x/STATUS
    subversion/branches/1.10.x/build/ac-macros/lz4.m4
    subversion/branches/1.10.x/build/ac-macros/utf8proc.m4
    subversion/branches/1.10.x/subversion/include/private/svn_subr_private.h
    subversion/branches/1.10.x/subversion/libsvn_subr/compress_lz4.c
    subversion/branches/1.10.x/subversion/libsvn_subr/sysinfo.c

Propchange: subversion/branches/1.10.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec 25 04:00:08 2017
@@ -99,4 +99,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1817837,1817856
+/subversion/trunk:1817837,1817856,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819162

Modified: subversion/branches/1.10.x/INSTALL
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/INSTALL?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/INSTALL (original)
+++ subversion/branches/1.10.x/INSTALL Mon Dec 25 04:00:08 2017
@@ -527,6 +527,19 @@ I.    INTRODUCTION
 
       $ ./get-dep.sh gmock
 
+      22. LZ4 (OPTIONAL)
+
+      Subversion uses LZ4 compression libary version r129 or above. Configure
+      will attempt to locate the system library by default using pkg-config
+      and known paths.
+
+      If it is installed in a non-standard location, then use:
+
+        --with-lz4=/path/to/liblz4
+
+      If configure should use the version bundled with the sources, use:
+        --with-lz4=internal
+
   D. Documentation
 
       The primary documentation for Subversion is the free book

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Mon Dec 25 04:00:08 2017
@@ -53,13 +53,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
-  * r1818651, r1818662, r1818727, r1818801, r1818803, r1818807, r1818868, 
r1818871, r1819162
-    Improve lz4,utf8proc configure behavior, and print the lz4 version in 
--version -v
-    Justification:
-      Correctly detect, note and print dependencies for builders/packagers.
-    Votes:
-     +1: stefan2, astieger, jamessan
-
  * r1819093
    Introduce a new global option: --password-from-stdin
    Justification:
@@ -69,4 +62,3 @@ Approved changes:
      of their work in a release.
    Votes:
      +1: stsp, stefan2, jamessan
-

Modified: subversion/branches/1.10.x/build/ac-macros/lz4.m4
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/build/ac-macros/lz4.m4?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/build/ac-macros/lz4.m4 (original)
+++ subversion/branches/1.10.x/build/ac-macros/lz4.m4 Mon Dec 25 04:00:08 2017
@@ -28,7 +28,15 @@ AC_DEFUN(SVN_LZ4,
   AC_ARG_WITH([lz4],
     [AS_HELP_STRING([--with-lz4=PREFIX|internal],
                     [look for lz4 in PREFIX or use the internal code])],
-    [lz4_prefix="$withval"],
+    [
+      if test "$withval" = internal; then
+        lz4_prefix=internal
+      elif test "$withval" = yes; then
+        lz4_prefix=std
+      else
+        lz4_prefix="$withval"
+      fi
+    ],
     [lz4_prefix=std])
 
   if test "$lz4_prefix" = "internal"; then
@@ -42,28 +50,36 @@ AC_DEFUN(SVN_LZ4,
       SVN_LZ4_PREFIX
     fi
     if test "$lz4_found" != "yes"; then
-      AC_MSG_ERROR([Subversion requires LZ4])
+      AC_MSG_ERROR([Subversion requires LZ4 >= r129, or use 
--with-lz4=internal])
     fi
   fi
   AC_SUBST(SVN_LZ4_INCLUDES)
   AC_SUBST(SVN_LZ4_LIBS)
 ])
 
+dnl LZ4 changed versioning schemes after r131, the next version being 1.7.3, so
+dnl we need to check for both schemes.  We can't use "--atleast-version=1.7.3"
+dnl because that will result in a >= 1 check for the older versioning scheme.
+dnl Instead, fallback to --max-version=3 if the old scheme fails.  This gives a
+dnl little room for major version changes, but won't falsely identify old
+dnl versions as supported.
 AC_DEFUN(SVN_LZ4_STD,
 [
   if test -n "$PKG_CONFIG"; then
     AC_MSG_CHECKING([for lz4 library via pkg-config])
-    if $PKG_CONFIG liblz4 --exists; then
+    if $PKG_CONFIG liblz4 --atleast-version=129 || $PKG_CONFIG liblz4 
--max-version=3; then
       AC_MSG_RESULT([yes])
       lz4_found=yes
       SVN_LZ4_INCLUDES=`$PKG_CONFIG liblz4 --cflags`
       SVN_LZ4_LIBS=`$PKG_CONFIG liblz4 --libs`
       SVN_LZ4_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($SVN_LZ4_LIBS)`"
+    else
+      AC_MSG_RESULT([no])
     fi
-  else
+  fi
+  if test "$lz4_found" != "yes"; then
     AC_MSG_NOTICE([lz4 configuration without pkg-config])
-    AC_CHECK_LIB(lz4, LZ4_decompress_safe, [
-      AC_MSG_RESULT([yes])
+    AC_CHECK_LIB(lz4, LZ4_compress_default, [
       lz4_found=yes
       SVN_LZ4_LIBS="-llz4"
     ])
@@ -77,8 +93,7 @@ AC_DEFUN(SVN_LZ4_PREFIX,
   CPPFLAGS="$CPPFLAGS -I$lz4_prefix/include"
   save_ldflags="$LDFLAGS"
   LDFLAGS="$LDFLAGS -L$lz4_prefix/lib"
-  AC_CHECK_LIB(lz4, LZ4_decompress_safe, [
-    AC_MSG_RESULT([yes])
+  AC_CHECK_LIB(lz4, LZ4_compress_default, [
     lz4_found=yes
     SVN_LZ4_INCLUDES="-I$lz4_prefix/include"
     SVN_LZ4_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS(-L$lz4_prefix/lib)` -llz4"

Modified: subversion/branches/1.10.x/build/ac-macros/utf8proc.m4
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/build/ac-macros/utf8proc.m4?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/build/ac-macros/utf8proc.m4 (original)
+++ subversion/branches/1.10.x/build/ac-macros/utf8proc.m4 Mon Dec 25 04:00:08 
2017
@@ -28,7 +28,15 @@ AC_DEFUN(SVN_UTF8PROC,
   AC_ARG_WITH([utf8proc],
     [AS_HELP_STRING([--with-utf8proc=PREFIX|internal],
                     [look for utf8proc in PREFIX or use the internal code])],
-    [utf8proc_prefix="$withval"],
+    [
+      if test "$withval" = internal; then
+        utf8proc_prefix=internal
+      elif test "$withval" = yes; then
+        utf8proc_prefix=std
+      else
+        utf8proc_prefix="$withval"
+      fi
+    ],
     [utf8proc_prefix=std])
 
   if test "$utf8proc_prefix" = "internal"; then
@@ -53,7 +61,6 @@ AC_DEFUN(SVN_UTF8PROC_STD,
 [
   AC_MSG_NOTICE([utf8proc configuration without pkg-config])
   AC_CHECK_LIB(utf8proc, utf8proc_version, [
-    AC_MSG_RESULT([yes])
      utf8proc_found=yes
      SVN_UTF8PROC_LIBS="-lutf8proc"
   ])
@@ -67,7 +74,6 @@ AC_DEFUN(SVN_UTF8PROC_PREFIX,
   save_ldflags="$LDFLAGS"
   LDFLAGS="$LDFLAGS -L$utf8proc_prefix/lib"
   AC_CHECK_LIB(utf8proc, utf8proc_version, [
-    AC_MSG_RESULT([yes])
     utf8proc_found=yes
     SVN_UTF8PROC_INCLUDES="-I$utf8proc_prefix/include"
     SVN_UTF8PROC_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS(-L$utf8proc_prefix/lib)` 
-lutf8proc"

Modified: 
subversion/branches/1.10.x/subversion/include/private/svn_subr_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/include/private/svn_subr_private.h?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/subversion/include/private/svn_subr_private.h 
(original)
+++ subversion/branches/1.10.x/subversion/include/private/svn_subr_private.h 
Mon Dec 25 04:00:08 2017
@@ -738,6 +738,14 @@ const char *svn_zlib__compiled_version(v
 /* Return the zlib version we run against. */
 const char *svn_zlib__runtime_version(void);
 
+/* Return the lz4 version we compiled against. */
+const char *svn_lz4__compiled_version(void);
+
+/* Return the lz4 version we run against as a composed value:
+ * major * 100 * 100 + minor * 100 + release
+ */
+int svn_lz4__runtime_version(void);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/1.10.x/subversion/libsvn_subr/compress_lz4.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/libsvn_subr/compress_lz4.c?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/subversion/libsvn_subr/compress_lz4.c (original)
+++ subversion/branches/1.10.x/subversion/libsvn_subr/compress_lz4.c Mon Dec 25 
04:00:08 2017
@@ -126,3 +126,19 @@ svn__decompress_lz4(const void *data, ap
 
   return SVN_NO_ERROR;
 }
+
+const char *
+svn_lz4__compiled_version(void)
+{
+  static const char lz4_version_str[] = APR_STRINGIFY(LZ4_VERSION_MAJOR) "." \
+                                        APR_STRINGIFY(LZ4_VERSION_MINOR) "." \
+                                        APR_STRINGIFY(LZ4_VERSION_RELEASE);
+
+  return lz4_version_str;
+}
+
+int
+svn_lz4__runtime_version(void)
+{
+  return LZ4_versionNumber();
+}

Modified: subversion/branches/1.10.x/subversion/libsvn_subr/sysinfo.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/libsvn_subr/sysinfo.c?rev=1819229&r1=1819228&r2=1819229&view=diff
==============================================================================
--- subversion/branches/1.10.x/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/1.10.x/subversion/libsvn_subr/sysinfo.c Mon Dec 25 
04:00:08 2017
@@ -127,7 +127,8 @@ const apr_array_header_t *
 svn_sysinfo__linked_libs(apr_pool_t *pool)
 {
   svn_version_ext_linked_lib_t *lib;
-  apr_array_header_t *array = apr_array_make(pool, 6, sizeof(*lib));
+  apr_array_header_t *array = apr_array_make(pool, 7, sizeof(*lib));
+  int lz4_version = svn_lz4__runtime_version();
 
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "APR";
@@ -167,6 +168,15 @@ svn_sysinfo__linked_libs(apr_pool_t *poo
   lib->compiled_version = apr_pstrdup(pool, svn_zlib__compiled_version());
   lib->runtime_version = apr_pstrdup(pool, svn_zlib__runtime_version());
 
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "LZ4";
+  lib->compiled_version = apr_pstrdup(pool, svn_lz4__compiled_version());
+
+  lib->runtime_version = apr_psprintf(pool, "%d.%d.%d",
+                                      lz4_version / 100 / 100,
+                                      (lz4_version / 100) % 100,
+                                      lz4_version % 100);
+
   return array;
 }
 


Reply via email to