[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Fix --enable-dso for Darwin/Mac OS X, Take Two

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2005-02-20 01:51:31 CET

Log message nad patch below. The tests still pass on Darwin but
not on NetBSD, and i've found something else. I can run
ra-local-test by hand and it works just fine:

0 trunk% ./subversion/tests/libsvn_ra_local/ra-local-test
PASS: ra-local-test 1: open an ra session to a local repository
PASS: ra-local-test 2: get the youngest revision in a repository
PASS: ra-local-test 3: svn_ra_local__split_URL: syntax validation
PASS: ra-local-test 4: svn_ra_local__split_URL: invalid host names
PASS: ra-local-test 5: svn_ra_local__split_URL: valid host names
PASS: ra-local-test 6: test svn_ra_local__split_URL correctness

But it breaks in make check:

START: ra-local-test
subversion/libsvn_subr/io.c:1450: (apr_err=2)
svn: Can't open directory 'test-repo-open/db': No such file or directory
FAIL: ra-local-test 1: open an ra session to a local repository
subversion/libsvn_subr/io.c:1450: (apr_err=2)
svn: Can't open directory 'test-repo-getrev/db': No such file or directory
FAIL: ra-local-test 2: get the youngest revision in a repository
PASS: ra-local-test 3: svn_ra_local__split_URL: syntax validation
PASS: ra-local-test 4: svn_ra_local__split_URL: invalid host names
PASS: ra-local-test 5: svn_ra_local__split_URL: valid host names
subversion/libsvn_subr/io.c:1450: (apr_err=2)
svn: Can't open directory 'test-repo-split-fs1/db': No such file or directory
FAIL: ra-local-test 6: test svn_ra_local__split_URL correctness
END: ra-local-test

Fix --enable-dso for Darwin/Mac OS X.

* configure.in
  (SVN_LIBDIR): New svn_private_config.h macro representing libdir,
    just like SVN_BINDIR.
  (SVN_DSO_FORMAT): New svn_private_config.h macro representing the
    format of DSO files for fs-loader.c and ra_loader.c. This is now
    an absolute path ending in .dylib for Darwin and unchanged for
    everyone else.

  Pass libdir along to svn_private_config.h as SVN_LIBDIR, just like
  SVN_BINDIR. Pass SVN_DSO_FORMAT to svn_private_config.h.

* subversion/libsvn_fs/fs-loader.c
  (load_module): Use SVN_LIBDIR and SVN_DSO_FORMAT to find DSO files.

* subversion/libsvn_ra/ra_loader.c
  (load_ra_module): Use SVN_LIBDIR and SVN_DSO_FORMAT to find DSO
    files.

=== configure.in
==================================================================
--- configure.in (/trunk) (revision 1836)
+++ configure.in (/local/darwin-dso) (revision 1836)
@@ -148,6 +148,30 @@
 AC_DEFINE_UNQUOTED(SVN_BINDIR, "${SVN_BINDIR}",
         [Defined to be the path to the installed binaries])
 
+dnl Create SVN_LIBDIR for proper substitution
+if test "${libdir}" = '${exec_prefix}/lib'; then
+ if test "${exec_prefix}" = "NONE"; then
+ if test "${prefix}" = "NONE"; then
+ SVN_LIBDIR="${ac_default_prefix}/lib"
+ else
+ SVN_LIBDIR="${prefix}/lib"
+ fi
+ else
+ SVN_LIBDIR="${exec_prefix}/lib"
+ fi
+else
+ SVN_LIBDIR="${libdir}"
+fi
+
+dnl fully evaluate this value. when we substitute it into our tool scripts,
+dnl they will not have things such as ${libdir} available
+SVN_LIBDIR="`eval echo ${SVN_LIBDIR}`"
+AC_SUBST(SVN_LIBDIR)
+
+dnl provide ${libdir} in svn_private.h for use in compiled code
+AC_DEFINE_UNQUOTED(SVN_LIBDIR, "${SVN_LIBDIR}",
+ [Defined to be the path to the installed libraries])
+
 dnl This purposely does *not* allow for multiple parallel installs.
 dnl However, it is compatible with most gettext usages.
 localedir='${datadir}/locale'
@@ -659,7 +683,19 @@
 AC_SUBST(SVN_FS_LIB_INSTALL_DEPS)
 AC_SUBST(SVN_FS_LIB_LINK)
 
+dnl Find out the DSO filename format for fs-loader.c and ra_loader.c.
+case ${host_os} in
+darwin*)
+ SVN_DSO_FORMAT="${SVN_LIBDIR}/libsvn_%s_%s-%d.dylib"
+ ;;
+*)
+ SVN_DSO_FORMAT='libsvn_%s_%s-%d.so.0'
+ ;;
+esac
+AC_DEFINE_UNQUOTED(SVN_DSO_FORMAT, "${SVN_DSO_FORMAT}",
+ [Defined to be the format of DSO filenames])
 
+
 dnl Possibly compile JavaHL (experimental)
 do_javahl_build=no
 AC_ARG_ENABLE(javahl,
=== subversion/libsvn_ra/ra_loader.c
==================================================================
--- subversion/libsvn_ra/ra_loader.c (/trunk) (revision 1836)
+++ subversion/libsvn_ra/ra_loader.c (/local/darwin-dso) (revision 1836)
@@ -125,8 +125,8 @@
     const char *compat_funcname;
     apr_status_t status;
 
- libname = apr_psprintf (pool, "libsvn_ra_%s-%d.so.0",
- ra_name, SVN_VER_MAJOR);
+ libname = apr_psprintf (pool, SVN_DSO_FORMAT,
+ "ra", ra_name, SVN_VER_MAJOR);
     funcname = apr_psprintf (pool, "svn_ra_%s__init", ra_name);
     compat_funcname = apr_psprintf (pool, "svn_ra_%s_init", ra_name);
 
=== subversion/libsvn_fs/fs-loader.c
==================================================================
--- subversion/libsvn_fs/fs-loader.c (/trunk) (revision 1836)
+++ subversion/libsvn_fs/fs-loader.c (/local/darwin-dso) (revision 1836)
@@ -82,8 +82,8 @@
     const char *funcname;
     apr_status_t status;
 
- libname = apr_psprintf (pool, "libsvn_fs_%s-%d.so.0",
- name, SVN_VER_MAJOR);
+ libname = apr_psprintf (pool, SVN_DSO_FORMAT,
+ "fs", name, SVN_VER_MAJOR);
     funcname = apr_psprintf (pool, "svn_fs_%s__init", name);
 
     /* Find/load the specified library. If we get an error, assume

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 20 01:53:09 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.