Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 1999 19:39:50 +0100
From:      Nik Clayton <nik@nothing-going-on.demon.co.uk>
To:        Wolfram Schneider <wosch@panke.de.freebsd.org>
Cc:        nclayton@lehman.com, Satoshi - Ports Wraith - Asami <asami@FreeBSD.ORG>, doc@FreeBSD.ORG
Subject:   Re: Can't build handbook
Message-ID:  <19990517193950.A2496@catkin.nothing-going-on.org>
In-Reply-To: <19990515190712.02032@panke.de.freebsd.org>; from Wolfram Schneider on Sat, May 15, 1999 at 07:07:12PM %2B0200
References:  <19990508141141.A20366@holly.dyndns.org> <XFMail.990508212539.jesusr@ncsa.es> <19990508231333.45191@panke.de.freebsd.org> <19990510111306.I14492@lehman.com> <199905110749.AAA28713@silvia.hip.berkeley.edu> <19990513130423.49638@panke.de.freebsd.org> <19990513124039.N14492@lehman.com> <19990515190712.02032@panke.de.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 15, 1999 at 07:07:12PM +0200, Wolfram Schneider wrote:
> >  2.  Stick in some code that checks for an empty DOC_PREFIX, and advises
> >      the user on how to fix it.  Or better yet, looks in DOC_PREFIX
> >      first the make sure the appropriate files are there, and warns the
> >      user if they aren't.
> > 
> >      I posted code that does this earlier on in this thread.
> > 
> > I think option 2 is the best way to go.  We can keep /usr/doc as the
> > default, and it will work if the user has been storing a checked out 
> > copy in /usr/doc.  If they haven't then the DOC_PREFIX test will discover
> > that, abort the build, and print instructions about what they should do.
> 
> I prefer option 2).

Here's a trivial patch which does this.  Anyone want to add any more 
smarts to it before I commit it?

N

Index: docproj.docbook.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/docproj.docbook.mk,v
retrieving revision 1.3
diff -u -r1.3 docproj.docbook.mk
--- docproj.docbook.mk	1999/05/05 20:16:46	1.3
+++ docproj.docbook.mk	1999/05/17 18:37:26
@@ -63,8 +63,6 @@
 #
 # You shouldn't need to change definitions below here
 
-DOC_PREFIX?=	/usr/doc
-
 VOLUME?=	${.CURDIR:T}
 DOC?=		${.CURDIR:T}
 DISTRIBUTION?=	doc
@@ -81,6 +79,27 @@
 JADEOPTS=	${JADEFLAGS} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g}
 
 KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar doc
+
+# ------------------------------------------------------------------------
+# If DOC_PREFIX is not set then try and generate a sensible value for it.
+#
+# If they have used an unedited /usr/share/examples/cvsup/doc-supfile to
+# download these files then /usr/doc probably exists.  If it does, then
+# use that.  If it doesn't exist then tell the user they must specify
+# DOC_PREFIX by hand.
+#
+.BEGIN:
+.if !defined(DOC_PREFIX) || empty(DOC_PREFIX)
+.if exists(/usr/doc)
+DOC_PREFIX=/usr/doc
+.else
+	@echo "You must define the DOC_PREFIX variable.  This should contain"
+	@echo "the path to the top of your checked out doc/ repository.  For"
+	@echo "example, \"make DOC_PREFIX=/usr/doc\", if that is where the"
+	@echo "documentation has been checked out to."
+	@exit 1
+.endif
+.endif
 
 # ------------------------------------------------------------------------
 #
-- 
    There's some milk in the fridge about to go off. . . and there it goes.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990517193950.A2496>