[distcc] Patch for --with-docdir in configure.ac and Makefile.in

Harold L Hunt II huntharo at msu.edu
Thu Nov 27 23:43:02 GMT 2003


The attached patch adds a --with-docdir=path flag for the configure 
script; the default when --with-docdir is not specified remains 
unchanged.  The patch has been build tested on Cygwin.

By the way, I am working with John Morrison to package distcc for 
Cygwin.  This patch allows us to consolidate our documentation in the 
directory that we specify.  It was also marked as a TODO in configure.ac 
so it seems that this was wanted.

Harold
-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /cvsroot/distcc/Makefile.in,v
retrieving revision 1.274
diff -u -r1.274 Makefile.in
--- Makefile.in	23 Nov 2003 05:08:44 -0000	1.274
+++ Makefile.in	27 Nov 2003 23:31:44 -0000
@@ -51,7 +51,6 @@
 includedir = @includedir@
 oldincludedir = /usr/include
 docdir = @docdir@
-pkgdocdir = $(docdir)/@PACKAGE_NAME@
 pkgdatadir = $(datadir)/@PACKAGE_NAME@
 
 # These must be done from here, not from autoconf, because they can 
@@ -536,7 +535,7 @@
 showpaths:
 	@echo "'make install' will install distcc as follows:"
 	@echo "  man pages            $(DESTDIR)$(man1dir)"
-	@echo "  documents            $(DESTDIR)$(pkgdocdir)"
+	@echo "  documents            $(DESTDIR)$(docdir)"
 	@echo "  programs             $(DESTDIR)$(bindir)"
 	@echo "  system configuration $(DESTDIR)$(sysconfdir)"
 	@echo "  shared data files    $(DESTDIR)$(pkgdatadir)"
@@ -560,15 +559,15 @@
 	done
 
 install-doc: $(pkgdoc_DOCS)
-	$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
+	$(mkinstalldirs) $(DESTDIR)$(docdir)
 	for p in $(pkgdoc_DOCS); do				\
-	$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir) || exit 1;	\
+	$(INSTALL_DATA) $$p $(DESTDIR)$(docdir) || exit 1;	\
 	done
 
 install-example: $(example_DOCS)
-	$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/example
+	$(mkinstalldirs) $(DESTDIR)$(docdir)/example
 	for p in $(example_DOCS); do				\
-	$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdocdir)/example || exit 1;	\
+	$(INSTALL_DATA) $$p $(DESTDIR)$(docdir)/example || exit 1;	\
 	done
 
 install-gnome-data: $(gnome_data)
Index: configure.ac
===================================================================
RCS file: /cvsroot/distcc/configure.ac,v
retrieving revision 1.195
diff -u -r1.195 configure.ac
--- configure.ac	23 Nov 2003 05:08:45 -0000	1.195
+++ configure.ac	27 Nov 2003 23:31:44 -0000
@@ -25,23 +25,26 @@
 
 ##### defaults
 
-# TODO: Add --docdir, and use that instead of this.  It looks like
-# that's actually pretty hard to do in autoconf; it looks like the
-# directory names are pretty much ardcoded.  --with-docdir= might be
-# the best we can get, and that pattern is used by other packages.
+dnl --with-docdir
+AC_DEFUN([DISTCC_WITH_DOCDIR],
+[AC_ARG_WITH(docdir,
+            AC_HELP_STRING([--with-docdir=DIR],
+                           [Use DIR to store documentation files (default ${datadir}/doc/distcc)]),
+            [with_docdir=$withval])
+if test "x$with_docdir" = "x" ; then
+  docdir='${datadir}/doc/distcc'
+else
+  docdir=$with_docdir
+fi
+AC_SUBST(docdir)
+])
+
+dnl Run the check for --with-docdir
+DISTCC_WITH_DOCDIR
 
 # TODO: Check for socklen_t, and do something appropiate on systems
 # that don't have it.  It could be size_t or int.  I'm not sure how
 # we're supposed to tell.
-
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-docdir='${datadir}/doc'
-
-# This turns into something like "/usr/local/share/doc"; pkgdocdir is
-# "/usr/local/share/doc/distcc"
 
 # TODO: Handle program transform rules by autoconf.
 


More information about the distcc mailing list