summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2009-08-19 16:14:28 +0200
committerDaniel Elstner <danielk@openismus.com>2009-08-19 16:39:41 +0200
commit697e26bb87296c972710eccdad37138cb8f7ac8c (patch)
tree6d07f65c39a8017fd45ed59ea9f3e91f52bcac13
parentee433852dcd654c66694fab032b4ca0e47d9ef26 (diff)
downloadmm-common-697e26bb87296c972710eccdad37138cb8f7ac8c.tar.gz
Use URIs instead of OS path names in markup files
* macros/mm-doc.m4 (_MM_ARG_WITH_TAGFILE_DOC): Translate local path names to file:// URIs, since these path names end up in XML and HTML files. The canonical representation also simplifies the translation from absolute to relative path names during installation. * build/doc-reference.am (htmlref_install): Take the new file:// URI prefix into account when translating from absolute to relative links.
-rw-r--r--build/doc-reference.am8
-rw-r--r--macros/mm-doc.m410
2 files changed, 13 insertions, 5 deletions
diff --git a/build/doc-reference.am b/build/doc-reference.am
index 848a462..7ae1778 100644
--- a/build/doc-reference.am
+++ b/build/doc-reference.am
@@ -73,11 +73,17 @@ MAINTAINERCLEANFILES = $(doxytagfile) $(devhelpfile) reference/html/*
# The generic bit of the doc-install.pl command line.
doc_install_cmd = $(doc_install) --verbose --mode=0644
+# Set $(mm_space) to a single space character
+mm_empty =
+mm_space = $(mm_empty) $(mm_empty)
+
# The command and options used to install the files from the HTML reference
# documentation. The $(subst) magic translates external tag references from
# absolute to relative paths if the destination is on the local file system
# and installed under the same prefix as the package being built.
-htmlref_install = $(doc_install_cmd) $(subst @$(datarootdir)/doc/,@../../../,$(DOCINSTALL_FLAGS))
+docdir_base_uri = $(patsubst /%,file:///%,$(subst $(mm_space),%20,$(subst \,/,$(datarootdir))))/doc
+htmlref_relinst = $(subst @$(docdir_base_uri)/,@../../../,$(DOCINSTALL_FLAGS))
+htmlref_install = $(doc_install_cmd) $(htmlref_relinst)
# Override the file installation program for dist_devhelp_DATA files.
# Note that this is not a documented feature as far as I'm aware, but
diff --git a/macros/mm-doc.m4 b/macros/mm-doc.m4
index decb4ea..7e2818d 100644
--- a/macros/mm-doc.m4
+++ b/macros/mm-doc.m4
@@ -15,7 +15,7 @@
## You should have received a copy of the GNU General Public License
## along with mm-common. If not, see <http://www.gnu.org/licenses/>.
-#serial 20090818
+#serial 20090819
## _MM_CONFIG_DOCTOOL_DIR
##
@@ -181,10 +181,12 @@ m4_ifval([$4], [dnl
mm_doxytagfile=`$PKG_CONFIG --variable=doxytagfile "$4" 2>&AS_MESSAGE_LOG_FD`
test "x$mm_doxytagfile" = x || mm_tagpath=$mm_doxytagfile
])
- # Remove any trailing slashes from the location
- mm_htmlrefpub=`[expr "X$mm_htmlrefpub" : 'X\(.*[^\\/]\)[\\/]*' 2>&]AS_MESSAGE_LOG_FD`
+ # Remove trailing slashes and translate to URI
+ mm_htmlrefpub=`[expr "X$mm_htmlrefpub" : 'X\(.*[^\\/]\)[\\/]*' 2>&]AS_MESSAGE_LOG_FD |\
+ [sed 's,[\\],/,g;s, ,%20,g;s,^/,file:///,' 2>&]AS_MESSAGE_LOG_FD`
])[]dnl
- mm_htmlrefdir=`[expr "X$mm_htmlrefdir" : 'X\(.*[^\\/]\)[\\/]*' 2>&]AS_MESSAGE_LOG_FD`
+ mm_htmlrefdir=`[expr "X$mm_htmlrefdir" : 'X\(.*[^\\/]\)[\\/]*' 2>&]AS_MESSAGE_LOG_FD |\
+ [sed 's,[\\],/,g;s, ,%20,g;s,^/,file:///,' 2>&]AS_MESSAGE_LOG_FD`
AC_MSG_RESULT([$mm_tagpath@$mm_htmlrefdir])