PATCH: Add --enable-maintainer-mode

Mark Mitchell mark at codesourcery.com
Wed Dec 14 17:38:40 UTC 2005


This patch adds an --enable-maintainter-mode switch.  When maintainer
mode is disabled, we do not try to build documentation, even if it
seems like the right rules are available.

Stefan, this moves the tutorial build logic around -- and I may have
gotten it wrong.  If so, I apologize!  It's important that the logic
respect the same build-or-copy semantics used by csl-docbook; the
version you had ran even if XSLTPROC was not defined, for example.

--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com

2005-12-14  Mark Mitchell  <mark at codesourcery.com>

	* GNUmakefile.in (maintainer_mode): New variable.  Do not define
	documentation variables in maintainer mode.
	(subdirs): Remove doc/tutorial.
	* configure.ac (maintainer-mode): New variable.
	(cpu_mhz): Fix typo in help string.
	* doc/GNUmakefile.inc.in: Build the tutorial here too.
	* doc/tutorial/tutorial.css: Remove.
	* doc/tutorial/GNUmakefile.inc.in: Likewise.

2005-12-14  Mark Mitchell  <mark at codesourcery.com>

	* GNUmakefile.inc (%.html): Use our stylsheet.
	* css/cs.css: New file.
	
Index: GNUmakefile.in
===================================================================
RCS file: /home/cvs/Repository/vpp/GNUmakefile.in,v
retrieving revision 1.29
diff -c -5 -p -r1.29 GNUmakefile.in
*** GNUmakefile.in	13 Dec 2005 01:34:47 -0000	1.29
--- GNUmakefile.in	14 Dec 2005 17:15:43 -0000
*************** all::
*** 26,35 ****
--- 26,39 ----
  
  # Variables in this section can be set by the user on the command line.
  
  srcdir := @srcdir@
  
+ # Test this variable with "ifdef" to determine whether or not to 
+ # perform actions needed by maintainers.
+ maintainer_mode := @maintainer_mode@
+ 
  ### Installation ###
  
  # Order matters for the various directory variables, as autoconf makes some
  # of the variables depend on the values of others.
  prefix := @prefix@
*************** USE_PAR := @USE_PAR@
*** 72,81 ****
--- 76,94 ----
  MPI_CPPFLAGS := @MPI_CPPFLAGS@
  MPI_LIBS := @MPI_LIBS@
  
  ### Documentation ### 
  
+ # The location of the csl-docbook directory.
+ csldocbookdir := $(srcdir)/doc/csl-docbook
+ 
+ # Documentation is only built in maintainer mode.  Many ordinary users
+ # do not have these tools, and some versions do not work very well.
+ # So, our source distributions contain pre-built versions of the
+ # documentation; the build prcoess will copy the pre-built versions if
+ # these tools are not available.
+ ifdef maintainer_mode
  # The Doxygen command.
  DOXYGEN := @DOXYGEN@ 
  # The Synopsis command.
  SYNOPSIS := python synopsis.py
  # The command used to turn DocBook into TeX.
*************** JADE := 
*** 84,95 ****
  PDFJADETEX := 
  # The command used to turn XSL-FO into PDF.
  XEP := @XEP@
  # The command used to turn DocBook into HTML or XSL-FO.
  XSLTPROC := @XSLTPROC@
! # The location of the csl-docbook directory.
! csldocbookdir := $(srcdir)/doc/csl-docbook
  
  ########################################################################
  # Subdirectory Variables
  ########################################################################
  
--- 97,107 ----
  PDFJADETEX := 
  # The command used to turn XSL-FO into PDF.
  XEP := @XEP@
  # The command used to turn DocBook into HTML or XSL-FO.
  XSLTPROC := @XSLTPROC@
! endif
  
  ########################################################################
  # Subdirectory Variables
  ########################################################################
  
*************** cxx_sources :=
*** 101,111 ****
  # The subdirectories in which we can find sub-Makefiles.
  subdirs := \
  	apps \
  	benchmarks \
  	doc \
- 	doc/tutorial \
  	examples \
  	src \
  	src/vsip \
  	tests \
  	tools \
--- 113,122 ----
Index: configure.ac
===================================================================
RCS file: /home/cvs/Repository/vpp/configure.ac,v
retrieving revision 1.57
diff -c -5 -p -r1.57 configure.ac
*** configure.ac	6 Dec 2005 03:42:38 -0000	1.57
--- configure.ac	14 Dec 2005 17:15:43 -0000
*************** dnl Autoconf initialization
*** 11,23 ****
  dnl ------------------------------------------------------------------
  AC_PREREQ(2.56)
  AC_REVISION($Revision: 1.57 $)
  AC_INIT(VSIPL++, 1.0, vsipl++ at codesourcery.com)
  
! #
  # Configure command line arguments.
! #
  AC_ARG_WITH(obj_ext,
    AS_HELP_STRING([--with-obj-ext=EXT],
                   [Specify the file extension to be used for object files.
                    Object files will be named file.$EXT]),
    [obj_ext=$withval])
--- 11,42 ----
  dnl ------------------------------------------------------------------
  AC_PREREQ(2.56)
  AC_REVISION($Revision: 1.57 $)
  AC_INIT(VSIPL++, 1.0, vsipl++ at codesourcery.com)
  
! ######################################################################
  # Configure command line arguments.
! ######################################################################
! 
! ### Overall options.
! 
! # Set maintainer_mode to either "true" or the empty string.
! AC_ARG_ENABLE(maintainer-mode,
!   AS_HELP_STRING([--enable-maintainer-mode],
!                  [Activate features required by developers modifying
!                   Sourcery VSIPL++ itself.  If you will be using Sourcery 
!                   VSIPL++, but do not plan to modify Sourcery VSIPL++,
!                   you should not use this option.]),
!   [case x"$enableval" in
!     xyes) maintainer_mode=true ;;
!     xno)  maintainer_mode= ;;
!     *)   AC_MSG_ERROR([Invalid argument to --enable-maintainer-mode.])
!    esac],
!   [maintainer_mode=]) 
! AC_SUBST(maintainer_mode)
!  
! ### Filename extensions. 
  AC_ARG_WITH(obj_ext,
    AS_HELP_STRING([--with-obj-ext=EXT],
                   [Specify the file extension to be used for object files.
                    Object files will be named file.$EXT]),
    [obj_ext=$withval])
*************** AC_ARG_WITH(mpi_prefix,
*** 41,50 ****
--- 60,70 ----
                   [Specify the installation prefix of the MPI library.  Headers
                    must be in PATH/include; libraries in PATH/lib.]),
    dnl If the user specified --with-mpi-prefix, they mean to use MPI for sure.
    [enable_mpi=yes])
  
+ ### Mecury Scientific Algorithm (SAL)
  AC_ARG_ENABLE([sal],
    AS_HELP_STRING([--enable-sal],
                   [use SAL if found (default is to not search for it)]),,
    [enable_sal=no])
  AC_ARG_WITH(sal_include,
*************** AC_ARG_WITH(sal_lib,
*** 56,65 ****
--- 76,86 ----
    AS_HELP_STRING([--with-sal-lib=PATH],
                   [Specify the installation path of the SAL library.]),
    dnl If the user specified --with-sal-lib, they mean to use SAL for sure.
    [enable_sal=yes])
  
+ ### Intel Performance Primitives (IPP)
  AC_ARG_ENABLE([ipp],
    AS_HELP_STRING([--enable-ipp],
                   [use IPP if found (default is to not search for it)]),,
    [enable_ipp=no])
  AC_ARG_WITH(ipp_prefix,
*************** AC_ARG_ENABLE([profile_timer],
*** 157,167 ****
                   [set profile timer type.  Choices include none, posix, realtime, pentiumtsc, x86_64_tsc]),,
    [enable_profile_timer=none])
  
  AC_ARG_ENABLE([cpu_mhz],
    AS_HELP_STRING([--enable-cpu-mhz=speed],
!                  [set CPU speed in MHz.  Only necessary for TSC and if /proc/cpuinfo does nto exist or is wrong]),,
    [enable_cpu_mhz=none])
  
  
  #
  # Files to generate.
--- 178,188 ----
                   [set profile timer type.  Choices include none, posix, realtime, pentiumtsc, x86_64_tsc]),,
    [enable_profile_timer=none])
  
  AC_ARG_ENABLE([cpu_mhz],
    AS_HELP_STRING([--enable-cpu-mhz=speed],
!                  [set CPU speed in MHz.  Only necessary for TSC and if /proc/cpuinfo does not exist or is wrong]),,
    [enable_cpu_mhz=none])
  
  
  #
  # Files to generate.
Index: doc/GNUmakefile.inc.in
===================================================================
RCS file: /home/cvs/Repository/vpp/doc/GNUmakefile.inc.in,v
retrieving revision 1.9
diff -c -5 -p -r1.9 GNUmakefile.inc.in
*** doc/GNUmakefile.inc.in	10 Nov 2005 05:44:02 -0000	1.9
--- doc/GNUmakefile.inc.in	14 Dec 2005 17:15:43 -0000
***************
*** 10,23 ****
  
  ########################################################################
  # Variables
  ########################################################################
  
! doc_pdf_manuals := doc/quickstart/quickstart.pdf
! doc_html_manuals := doc/quickstart/quickstart.html
  doc_manuals := $(doc_pdf_manuals) $(doc_html_manuals)
  
  ########################################################################
  # Rules
  ########################################################################
  
  doc:: $(doc_html_manuals) $(doc_pdf_manuals)
--- 10,29 ----
  
  ########################################################################
  # Variables
  ########################################################################
  
! doc_pdf_manuals := \
! 	doc/quickstart/quickstart.pdf \
! 	doc/tutorial/tutorial.pdf
! doc_html_manuals := $(doc_pdf_manuals:%.pdf=%.html)
  doc_manuals := $(doc_pdf_manuals) $(doc_html_manuals)
  
+ tutorial_images := \
+ 	$(wildcard $(srcdir)/doc/tutorial/images/*.png) \
+ 	$(wildcard $(srcdir)/doc/tutorial/images/callouts/*.png) \
+ 
  ########################################################################
  # Rules
  ########################################################################
  
  doc:: $(doc_html_manuals) $(doc_pdf_manuals)
*************** $(doc_manuals): \
*** 31,55 ****
  	doc/csl-docbook/fragments/gpl.xml
  
  doc/html/index.html:
  	$(DOXYGEN) doc/Doxyfile
  
  clean::
  	rm -f $(doc_manuals)
  	rm -rf doc/html
  
! # Install the manuals.  They may be present in the build directory,
! # or, if we could not build them, in the source directory.
  install::
  	$(INSTALL) -d $(docdir)
  	for f in $(doc_pdf_manuals); do \
  		if test -r $$f; then \
  			$(INSTALL_DATA) $$f $(docdir); \
  		fi; \
  	done
  	# HTML manuals go in their own subdirectories.
! 	$(INSTALL) -d $(docdir)/html/quickstart
! 	if test -r doc/quickstart/html/index.html; then \
! 		$(INSTALL_DATA) doc/quickstart/html/*.html \
! 			$(docdir)/html/quickstart; \
! 	fi
! 		
--- 37,81 ----
  	doc/csl-docbook/fragments/gpl.xml
  
  doc/html/index.html:
  	$(DOXYGEN) doc/Doxyfile
  
+ doc/tutorial/tutorial.html: \
+         $(patsubst $(srcdir)/doc/tutorial/%,doc/tutorial/html/%,$(tutorial_images))
+ 
+ doc/tutorial/html/images/%.png: $(srcdir)/doc/tutorial/images/%.png
+ 	mkdir -p $(@D)
+ 	cp $< $@
+ 
  clean::
  	rm -f $(doc_manuals)
  	rm -rf doc/html
  
! # Install the manuals.
  install::
  	$(INSTALL) -d $(docdir)
  	for f in $(doc_pdf_manuals); do \
  		if test -r $$f; then \
  			$(INSTALL_DATA) $$f $(docdir); \
  		fi; \
  	done
  	# HTML manuals go in their own subdirectories.
! 	for dir in quickstart tutorial; do \
! 		if test -r doc/$$dir/html/index.html; then \
! 			$(INSTALL) -d $(docdir)/html/$$dir; \
! 			$(INSTALL_DATA) doc/$$dir/html/*.html \
! 				$(docdir)/html/$$dir; \
! 			$(INSTALL_DATA) doc/$$dir/html/*.css \
! 				$(docdir)/html/$$dir; \
! 		fi; \
! 	        if test -d doc/$$dir/html/images; then \
! 			$(INSTALL) -d $(docdir)/html/$$dir/images; \
! 			$(INSTALL_DATA) doc/$$dir/images/*.png \
! 				$(docdir)/html/$$dir/images; \
! 		fi; \
! 	        if test -d doc/$$dir/html/images/callouts; then \
! 			$(INSTALL) -d \
! 				$(docdir)/html/$$dir/images/callouts; \
! 			$(INSTALL_DATA) doc/$$dir/images/callouts/*.png \
! 				$(docdir)/html/$$dir/images/callouts; \
! 		fi; \
! 	done		
Index: doc/csl-docbook/GNUmakefile.inc
===================================================================
RCS file: /home/cvs/Repository/csl-docbook/GNUmakefile.inc,v
retrieving revision 1.2
diff -c -5 -p -r1.2 GNUmakefile.inc
*** doc/csl-docbook/GNUmakefile.inc	13 Dec 2005 01:38:13 -0000	1.2
--- doc/csl-docbook/GNUmakefile.inc	14 Dec 2005 17:15:43 -0000
*************** XML_DCL := xml.dcl
*** 63,77 ****
  # Implicit Rules
  ########################################################################
  
  ifdef XSLTPROC
  # Generate HTML from DocBook. 
! %.html: %.xml $(csldocbookdir)/xsl/html/csl.xsl
! 	rm -rf $(@D)/html
  	mkdir -p $(@D)/html
  	$(XSLTPROC) \
  	    --stringparam csl_docbook.root $(csldocbookdir) \
  	    --output $(@D)/html/index.html \
  	    $(csldocbookdir)/xsl/html/csl.xsl \
  	    $<
  	touch $@
  
--- 63,82 ----
  # Implicit Rules
  ########################################################################
  
  ifdef XSLTPROC
  # Generate HTML from DocBook. 
! %.html: %.xml \
! 	$(csldocbookdir)/xsl/html/csl.xsl \
! 	$(csldocbookdir)/css/cs.css
  	mkdir -p $(@D)/html
+ 	cp $(csldocbookdir)/css/cs.css $(@D)/html
  	$(XSLTPROC) \
+ 	    --xinclude \
  	    --stringparam csl_docbook.root $(csldocbookdir) \
+ 	    --stringparam html.stylesheet cs.css \
+ 	    --stringparam keep.relative.image.uris 1 \
  	    --output $(@D)/html/index.html \
  	    $(csldocbookdir)/xsl/html/csl.xsl \
  	    $<
  	touch $@
  
Index: doc/csl-docbook/css/cs.css
===================================================================
RCS file: doc/csl-docbook/css/cs.css
diff -N doc/csl-docbook/css/cs.css
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- doc/csl-docbook/css/cs.css	14 Dec 2005 17:15:43 -0000
***************
*** 0 ****
--- 1,10 ----
+ @import url("http://www.codesourcery.com/codesourcerystyles.css");
+ 
+ pre.programlisting
+ {
+   font-size: smaller;
+   border: 1px solid #aaaaaa;
+   background-color: #eeeeee;
+   margin: 20px;
+   padding: 10px;
+ }
Index: doc/tutorial/tutorial.css
===================================================================
RCS file: doc/tutorial/tutorial.css
diff -N doc/tutorial/tutorial.css
*** doc/tutorial/tutorial.css	10 Nov 2005 05:44:02 -0000	1.1
--- /dev/null	1 Jan 1970 00:00:00 -0000
***************
*** 1,9 ****
- @import url("http://www.codesourcery.com/codesourcerystyles.css");
- pre.programlisting
- {
-   font-size: smaller;
-   border: 1px solid #aaaaaa;
-   background-color: #eeeeee;
-   margin: 20px;
-   padding: 10px;
- }
--- 0 ----



More information about the qmtest mailing list