You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/08/20 13:17:43 UTC

svn commit: r1696758 - in /subversion/trunk: build.conf subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_base/fs_init.h subversion/libsvn_fs_fs/fs_init.h subversion/libsvn_fs_x/fs_init.h

Author: rhuijben
Date: Thu Aug 20 11:17:43 2015
New Revision: 1696758

URL: http://svn.apache.org/r1696758
Log:
Make libsvn_fs_util, libsvn_fs_base, libsvn_fs_fs and libsvn_fs_x proper
shared libraries on Windows when shared libraries are enabled in the build,
just like on other platforms. Before this all of them were statically
linked into libsvn_fs and any project that directly used their functions.

This patch automatically detects circular reference problems in this code,
such as the one fixed in r1696695 and will allow delay loading quite a bit
of code from svn and svnadmin in a followup patch.

The 'msvc-force-static' markers on many test projects formalizes that these
projects already depended on internal apis, which were only available because
they were statically linked.

* build.conf
  (libsvn_fs_base,
   libsvn_fs_fs,
   libsvn_fs_x,
   libsvn_fs_util): Properly declare exports to

* subversion/libsvn_fs/fs-loader.h
  (LIBSVN_FS_FS_H): Use proper unique define.
  (svn_fs_base__init,
   svn_fs_fs__init,
   svn_fs_x__init): Move to separate header files to allow using the export
     generator.

* subversion/libsvn_fs_base/fs_init.h
* subversion/libsvn_fs_fs/fs_init.h
* subversion/libsvn_fs_x/fs_init.h
  New files containing the single entry point of these libraries.

Added:
    subversion/trunk/subversion/libsvn_fs_base/fs_init.h   (with props)
    subversion/trunk/subversion/libsvn_fs_fs/fs_init.h   (with props)
    subversion/trunk/subversion/libsvn_fs_x/fs_init.h   (with props)
Modified:
    subversion/trunk/build.conf
    subversion/trunk/subversion/libsvn_fs/fs-loader.h

Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1696758&r1=1696757&r2=1696758&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Thu Aug 20 11:17:43 2015
@@ -282,7 +282,7 @@ path = subversion/libsvn_fs_base
 sources = *.c bdb/*.c util/*.c
 install = bdb-lib
 libs = libsvn_delta libsvn_subr aprutil apriconv apr bdb libsvn_fs_util
-msvc-static = yes
+msvc-export = ../libsvn_fs_base/fs_init.h
 
 [libsvn_fs_fs]
 description = Subversion FSFS Repository Filesystem Library
@@ -290,7 +290,7 @@ type = fs-module
 path = subversion/libsvn_fs_fs
 install = fsmod-lib
 libs = libsvn_delta libsvn_subr aprutil apriconv apr libsvn_fs_util
-msvc-static = yes
+msvc-export = private/svn_fs_fs_private.h ../libsvn_fs_fs/fs_init.h
 
 [libsvn_fs_x]
 description = Subversion FSX Repository Filesystem Library
@@ -298,7 +298,7 @@ type = fs-module
 path = subversion/libsvn_fs_x
 install = fsmod-lib
 libs = libsvn_delta libsvn_subr aprutil apriconv apr libsvn_fs_util
-msvc-static = yes
+msvc-export = ../libsvn_fs_x/fs_init.h
 
 # Low-level grab bag of utilities
 [libsvn_fs_util]
@@ -308,7 +308,7 @@ install = fsmod-lib
 path = subversion/libsvn_fs_util
 libs = libsvn_subr aprutil apriconv apr
 msvc-libs = advapi32.lib shfolder.lib
-msvc-static = yes
+msvc-export = private/svn_fs_util.h
 
 # General API for accessing repositories
 [libsvn_ra]
@@ -787,6 +787,7 @@ sources = fs-base-test.c
 install = bdb-test
 libs = libsvn_test libsvn_fs libsvn_fs_base libsvn_delta
        libsvn_fs_util libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [strings-reps-test]
 description = Test strings/reps in libsvn_fs_base
@@ -796,6 +797,7 @@ sources = strings-reps-test.c
 install = bdb-test
 libs = libsvn_test libsvn_fs libsvn_fs_base libsvn_delta
        libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [changes-test]
 description = Test changes in libsvn_fs_base
@@ -805,6 +807,7 @@ sources = changes-test.c
 install = bdb-test
 libs = libsvn_test libsvn_fs libsvn_fs_base libsvn_delta
        libsvn_subr apriconv apr
+msvc-force-static = yes
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_fs_fs
@@ -816,6 +819,7 @@ sources = fs-fs-pack-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
        libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [fs-fs-fuzzy-test]
 description = Use fuzzying to test FSFS corruption resilience
@@ -825,6 +829,7 @@ sources = fs-fs-fuzzy-test.c
 install = sub-test
 libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
        libsvn_repos libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [fs-fs-private-test]
 description = Test FSSF private API
@@ -834,6 +839,7 @@ sources = fs-fs-private-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_fs_fs libsvn_delta
        libsvn_repos libsvn_subr apriconv apr
+msvc-force-static = yes
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_fs_x
@@ -845,6 +851,7 @@ sources = fs-x-pack-test.c
 install = test
 libs = libsvn_test libsvn_fs libsvn_fs_x libsvn_delta
        libsvn_subr apriconv apr
+msvc-force-static = yes
 
 [string-table-test]
 description = Test fsfs string tables
@@ -853,6 +860,7 @@ path = subversion/tests/libsvn_fs_x
 sources = string-table-test.c
 install = test
 libs = libsvn_test libsvn_fs_x libsvn_subr apr
+msvc-force-static = yes
 
 # ----------------------------------------------------------------------------
 # Tests for libsvn_fs

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.h?rev=1696758&r1=1696757&r2=1696758&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.h Thu Aug 20 11:17:43 2015
@@ -22,8 +22,8 @@
  */
 
 
-#ifndef LIBSVN_FS_FS_H
-#define LIBSVN_FS_FS_H
+#ifndef LIBSVN_FS_LOADER_H
+#define LIBSVN_FS_LOADER_H
 
 #include "svn_types.h"
 #include "svn_fs.h"
@@ -184,15 +184,9 @@ typedef svn_error_t *(*fs_init_func_t)(c
    to the create and open functions and these init functions (as well
    as the open and create functions) are globally serialized so that
    they have exclusive access to the common_pool. */
-svn_error_t *svn_fs_base__init(const svn_version_t *loader_version,
-                               fs_library_vtable_t **vtable,
-                               apr_pool_t* common_pool);
-svn_error_t *svn_fs_fs__init(const svn_version_t *loader_version,
-                             fs_library_vtable_t **vtable,
-                             apr_pool_t* common_pool);
-svn_error_t *svn_fs_x__init(const svn_version_t *loader_version,
-                            fs_library_vtable_t **vtable,
-                            apr_pool_t* common_pool);
+#include "../libsvn_fs_base/fs_init.h"
+#include "../libsvn_fs_fs/fs_init.h"
+#include "../libsvn_fs_x/fs_init.h"
 
 
 
@@ -569,4 +563,4 @@ struct svn_fs_lock_target_t
 }
 #endif /* __cplusplus */
 
-#endif
+#endif /* LIBSVN_FS_LOADER_H */

Added: subversion/trunk/subversion/libsvn_fs_base/fs_init.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs_init.h?rev=1696758&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/fs_init.h (added)
+++ subversion/trunk/subversion/libsvn_fs_base/fs_init.h Thu Aug 20 11:17:43 2015
@@ -0,0 +1,33 @@
+/*
+ * libsvn_fs_base/fs_init.h:  Exported function of libsvn_fs_base
+ *
+ *
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ */
+
+#ifndef LIBSVN_FS_LOADER_H
+#error Please include libsvn_fs/fs_loader.h instead of this file
+#else
+
+svn_error_t *svn_fs_base__init(const svn_version_t *loader_version,
+                               fs_library_vtable_t **vtable,
+                               apr_pool_t* common_pool);
+
+#endif
\ No newline at end of file

Propchange: subversion/trunk/subversion/libsvn_fs_base/fs_init.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: subversion/trunk/subversion/libsvn_fs_fs/fs_init.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_init.h?rev=1696758&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_init.h (added)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_init.h Thu Aug 20 11:17:43 2015
@@ -0,0 +1,32 @@
+/*
+ * libsvn_fs_fs/fs_init.h:  Exported function of libsvn_fs_fs
+ *
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ */
+
+#ifndef LIBSVN_FS_LOADER_H
+#error Please include libsvn_fs/fs_loader.h instead of this file
+#else
+
+svn_error_t *svn_fs_fs__init(const svn_version_t *loader_version,
+  fs_library_vtable_t **vtable,
+  apr_pool_t* common_pool);
+
+#endif

Propchange: subversion/trunk/subversion/libsvn_fs_fs/fs_init.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: subversion/trunk/subversion/libsvn_fs_x/fs_init.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_init.h?rev=1696758&view=auto
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs_init.h (added)
+++ subversion/trunk/subversion/libsvn_fs_x/fs_init.h Thu Aug 20 11:17:43 2015
@@ -0,0 +1,33 @@
+/*
+* libsvn_fs_x/fs_init.h:  Exported function of libsvn_fs_x
+*
+* ====================================================================
+*    Licensed to the Apache Software Foundation (ASF) under one
+*    or more contributor license agreements.  See the NOTICE file
+*    distributed with this work for additional information
+*    regarding copyright ownership.  The ASF licenses this file
+*    to you under the Apache License, Version 2.0 (the
+*    "License"); you may not use this file except in compliance
+*    with the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+*    Unless required by applicable law or agreed to in writing,
+*    software distributed under the License is distributed on an
+*    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+*    KIND, either express or implied.  See the License for the
+*    specific language governing permissions and limitations
+*    under the License.
+* ====================================================================
+*/
+
+#ifndef LIBSVN_FS_LOADER_H
+#error Please include libsvn_fs/fs_loader.h instead of this file
+#else
+
+svn_error_t *svn_fs_x__init(const svn_version_t *loader_version,
+  fs_library_vtable_t **vtable,
+  apr_pool_t* common_pool);
+
+#endif
+

Propchange: subversion/trunk/subversion/libsvn_fs_x/fs_init.h
------------------------------------------------------------------------------
    svn:eol-style = native