[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 Three

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2005-02-21 02:14:41 CET

"Max Bowsher" <maxb@ukf.net> writes:

> > +dnl provide ${libdir} in svn_private.h for use in compiled code
>
> Filename incorrect.

I copied and pasted this from the SVN_BINDIR stuff, which i have
also fixed.

> Very nasty things will happen if SVN_LIBDIR happens to contain a %
> character!!!

DOH! How's this?

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.
  (SVN_DSO_PATH): New svn_private_config.h macro representing the
    absolute path to the DSO files; empty for all systems but Darwin.

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

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

=== configure.in
==================================================================
--- configure.in (/trunk) (revision 1852)
+++ configure.in (/local/darwin-dso) (revision 1852)
@@ -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_config.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,23 @@
 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="%slibsvn_%s_%s-%d.dylib"
+ SVN_DSO_PATH="${SVN_LIBDIR}/"
+ ;;
+*)
+ SVN_DSO_FORMAT='%slibsvn_%s_%s-%d.so.0'
+ SVN_DSO_PATH=''
+ ;;
+esac
+AC_DEFINE_UNQUOTED(SVN_DSO_FORMAT, "${SVN_DSO_FORMAT}",
+ [Defined to be the format of DSO filenames])
+AC_DEFINE_UNQUOTED(SVN_DSO_PATH, "${SVN_DSO_PATH}",
+ [Defined to be the absolute path to DSO files (usually empty)])
 
+
 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 1852)
+++ subversion/libsvn_ra/ra_loader.c (/local/darwin-dso) (revision 1852)
@@ -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,
+ SVN_DSO_PATH, "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 1852)
+++ subversion/libsvn_fs/fs-loader.c (/local/darwin-dso) (revision 1852)
@@ -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,
+ SVN_DSO_PATH, "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 Mon Feb 21 02:16:04 2005

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