Author: brane
Date: Thu Dec 20 17:25:23 2018
New Revision: 1849417

URL: http://svn.apache.org/viewvc?rev=1849417&view=rev
Log:
Make sure we don't require any part of Boost unless explicitly requested by
enabling the C++ bindings.

* configure.ac
  (--enable-svnxx): New option to compile C++ bindings.
  (--enable-svnxx-tests): New option to compile C++ bindings tests.
  (SVN_HAVE_CXX_BOOST): Remove substitution variable.
  (SVN_BUILD_SVNXX, SVN_BUILD_SVNXX_TESTS): New substitution variables.

* build.conf
  (libsvnxx): Only build when SVN_BUILD_SVNXX is enabled.
  (svnxx-tests): Only build when SVN_BUILD_SVNXX_TESTS is enabled.

* Makefile.in
  (SVN_HAVE_CXX_BOOST): Remove.
  (SVN_BUILD_SVNXX, SVN_BUILD_SVNXX_TESTS): Define.

Modified:
    subversion/trunk/Makefile.in
    subversion/trunk/build.conf
    subversion/trunk/configure.ac

Modified: subversion/trunk/Makefile.in
URL: 
http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1849417&r1=1849416&r2=1849417&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Thu Dec 20 17:25:23 2018
@@ -165,7 +165,8 @@ CTYPES_PYTHON_SRC_DIR = $(abs_srcdir)/su
 JAVAHL_JAR=subversion/bindings/javahl/svn-javahl.jar
 JAVAHL_INCLUDES= @JNI_INCLUDES@ 
-I$(abs_builddir)/subversion/bindings/javahl/include
 
-SVN_HAVE_CXX_BOOST = @SVN_HAVE_CXX_BOOST@
+SVN_BUILD_SVNXX = @SVN_BUILD_SVNXX@
+SVN_BUILD_SVNXX_TESTS = @SVN_BUILD_SVNXX_TESTS@
 SVNXX_INCLUDES = -I$(abs_srcdir)/subversion/bindings/cxx/include
 
 SVN_APR_CONFIG = @SVN_APR_CONFIG@

Modified: subversion/trunk/build.conf
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1849417&r1=1849416&r2=1849417&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Thu Dec 20 17:25:23 2018
@@ -730,6 +730,7 @@ link-cmd = $(LINK_JAVAHL_CXX)
 
 [libsvnxx]
 description = Subversion C++ bindings
+when = SVN_BUILD_SVNXX
 type = lib
 path = subversion/bindings/cxx
 libs = libsvn_repos libsvn_client libsvn_wc libsvn_ra libsvn_delta libsvn_diff
@@ -742,7 +743,7 @@ link-cmd = $(LINK_CXX_LIB)
 
 [svnxx-tests]
 description = Unit tests for Subversion C++ bindings
-when = SVN_HAVE_CXX_BOOST
+when = SVN_BUILD_SVNXX_TESTS
 type = exe
 path = subversion/bindings/cxx
 libs = libsvnxx apr

Modified: subversion/trunk/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1849417&r1=1849416&r2=1849417&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Thu Dec 20 17:25:23 2018
@@ -1439,13 +1439,66 @@ AC_SUBST(SVN_FS_LIB_LINK)
 
 # ==== SVN++ =================================================================
 
+dnl Possibly compile SVN++
+do_svnxx_build=no
+AC_ARG_ENABLE(svnxx,
+  AS_HELP_STRING([--enable-svnxx],
+      [Enable compilation of the C++ bindings (requires C++)]),
+  [ if test "$enableval" = "yes" ; then
+        AC_MSG_NOTICE([Enabling the C++ bindings])
+        do_svnxx_build=yes
+    fi
+  ])
+
+dnl Possibly compile SVN++ tests
+do_svnxx_test_build=no
+AC_ARG_ENABLE(svnxx-tests,
+  AS_HELP_STRING([--enable-svnxx-tests],
+      [Enable compilation of tests for the C++ bindings
+      (implies --enable-svnxx, requires Boost and Boost.Test)]),
+  [ if test "$enableval" = "yes" ; then
+        AC_MSG_NOTICE([Enabling tests for the C++ bindings])
+        do_svnxx_test_build=yes
+    fi
+  ])
+
 AX_BOOST_BASE([1.58],
   [
-    SVN_HAVE_CXX_BOOST=true
-    AX_BOOST_UNIT_TEST_FRAMEWORK
+    if test "$do_svnxx_test_build" = "yes"; then
+        AX_BOOST_UNIT_TEST_FRAMEWORK
+    fi
   ],
-  [SVN_HAVE_CXX_BOOST=false])
-AC_SUBST(SVN_HAVE_CXX_BOOST)
+  [
+    if test "$do_svnxx_test_build" = "yes"; then
+        AC_MSG_WARN([Tests for the C++ bindings require Boost and Boost.Test])
+        do_svnxx_test_build=no
+    fi
+  ])
+
+if test "$do_svnxx_test_build" = "yes"; then
+    if test "$want_boost" != "yes"; then
+        AC_MSG_WARN([Tests for the C++ bindings require Boost and Boost.Test])
+        do_svnxx_test_build=no
+        SVN_BUILD_SVNXX_TESTS=false
+    else
+        if test "$do_svnxx_build" != "yes"; then
+            AC_MSG_WARN([Enabling the C++ bindings because their tests are 
enabled])
+            do_svnxx_build=yes
+        fi
+        SVN_BUILD_SVNXX_TESTS=true
+    fi
+else
+    SVN_BUILD_SVNXX_TESTS=false
+fi
+
+if test "$do_svnxx_build" == "yes"; then
+    SVN_BUILD_SVNXX=true
+else
+    SVN_BUILD_SVNXX=false
+fi
+
+AC_SUBST(SVN_BUILD_SVNXX)
+AC_SUBST(SVN_BUILD_SVNXX_TESTS)
 
 # ==== JavaHL ================================================================
 


Reply via email to