Subject: [PATCH 3/3] Respect the configure --docdir override

Thanks to RedDwarf, lilrc, and mgorny for pointing it out and
 suggesting patches.

Patch contributed by Ron Lee.

Closes ticket:1758

svn path=/trunk/ogg/; revision=18934
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e7eec1f..3dd47b9 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,11 +2,8 @@
 
 SUBDIRS = libogg
 
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-
-doc_DATA = framing.html index.html oggstream.html ogg-multiplex.html \
+dist_html_DATA = framing.html index.html oggstream.html ogg-multiplex.html \
 	fish_xiph_org.png multiplex1.png packets.png pages.png stream.png \
 	vorbisword2.png white-ogg.png white-xifish.png \
 	rfc3533.txt rfc5334.txt skeleton.html
 
-EXTRA_DIST = $(doc_DATA)
diff --git a/doc/libogg/Makefile.am b/doc/libogg/Makefile.am
index 9139391..7ecd26a 100644
--- a/doc/libogg/Makefile.am
+++ b/doc/libogg/Makefile.am
@@ -1,8 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/libogg
+apidocdir = $(htmldir)/libogg
 
-doc_DATA = bitpacking.html datastructures.html decoding.html encoding.html\
+dist_apidoc_DATA = bitpacking.html datastructures.html decoding.html encoding.html\
 	general.html index.html ogg_iovec_t.html ogg_packet.html ogg_packet_clear.html\
 	ogg_page.html ogg_page_bos.html ogg_page_checksum_set.html\
 	ogg_page_continued.html ogg_page_eos.html ogg_page_granulepos.html\
@@ -24,4 +24,3 @@
 	oggpack_writecopy.html oggpack_writeinit.html oggpack_writetrunc.html\
 	overview.html reference.html style.css
 
-EXTRA_DIST = $(doc_DATA)