pcp
[Top] [All Lists]

[PATCH] Add a configure switch for publican brand support

To: pcp@xxxxxxxxxxx
Subject: [PATCH] Add a configure switch for publican brand support
From: Michele Baldessari <michele@xxxxxxxxxx>
Date: Thu, 30 Apr 2015 12:12:01 +0200
Cc: Michele Baldessari <michele@xxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=acksyn.org; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received; s=2010; t=1430388729; bh=5QCbMLC8gHSDAIzfTg2skH+CCDwW fa4200ipqHchiq8=; b=LY1E5NlS0F6lrkbUAWc3X6f5788BWnRIm1oyhgYtGs9r nRDrQZrCxZ8zNdCanzM7WBPrjtQlNX/1hGmv8Ms6d5XcAZD14JXemKPmJbMbAY5j as0xcEdlPMdTtJ1cn4scEE/hdi6M0rYoyRgiVkdEIfZpro8H5lahgYYytLnEFIg=
Add a --with-books-brand=BRAND configure switch in order
to choose the publican brand at build time. This is
especially useful for the website documentation where
we use a custom brand.
The default brand used when nothing is specified is
the standard 'common' publican brand.
---
 books/PCP_PG/GNUmakefile      |  7 +++++--
 books/PCP_PG/publican.cfg     |  4 ----
 books/PCP_PG/publican.cfg.in  |  4 ++++
 books/PCP_TCS/GNUmakefile     |  7 +++++--
 books/PCP_TCS/publican.cfg    |  4 ----
 books/PCP_TCS/publican.cfg.in |  4 ++++
 books/PCP_UAG/GNUmakefile     |  7 +++++--
 books/PCP_UAG/publican.cfg    |  4 ----
 books/PCP_UAG/publican.cfg.in |  4 ++++
 configure                     | 21 +++++++++++++++++++++
 configure.ac                  | 13 +++++++++++++
 src/include/builddefs.in      |  1 +
 12 files changed, 62 insertions(+), 18 deletions(-)
 delete mode 100644 books/PCP_PG/publican.cfg
 create mode 100644 books/PCP_PG/publican.cfg.in
 delete mode 100644 books/PCP_TCS/publican.cfg
 create mode 100644 books/PCP_TCS/publican.cfg.in
 delete mode 100644 books/PCP_UAG/publican.cfg
 create mode 100644 books/PCP_UAG/publican.cfg.in

diff --git a/books/PCP_PG/GNUmakefile b/books/PCP_PG/GNUmakefile
index 1cd3aacedf9b..eca64bd0be2b 100644
--- a/books/PCP_PG/GNUmakefile
+++ b/books/PCP_PG/GNUmakefile
@@ -13,7 +13,7 @@ CFG = publican.cfg
 CP = cp -rdp
 LSRCFILES = $(XML) $(PUB) $(CFG) $(PDF)
 LDIRDIRT = pdf html en-US tmp
-LDIRT = built.*
+LDIRT = built.* publican.cfg
 CWD = $(shell pwd)
 
 default: build-me
@@ -21,7 +21,7 @@ default: build-me
 include $(BUILDRULES)
 
 ifeq "$(BOOK_TOOLCHAIN)" "publican"
-built.$(BOOK_TOOLCHAIN):       $(XML)
+built.$(BOOK_TOOLCHAIN):       $(XML) $(CFG)
        @rm -fr pdf html en-US tmp
        @mkdir -p pdf html en-US tmp
        $(CP) $(CWD)/$(PUB) en-US/
@@ -59,6 +59,9 @@ else
 build-me:
 endif
 
+publican.cfg : publican.cfg.in
+       $(SED) -e 's;@brand@;'$(BOOK_BRAND)';' $< > $@
+
 install: default
        $(INSTALL) -m 755 -d $(PCP_BOOKS_DIR)
        $(INSTALL) -m 644 $(PDF) $(PCP_BOOKS_DIR)/$(PDF)
diff --git a/books/PCP_PG/publican.cfg b/books/PCP_PG/publican.cfg
deleted file mode 100644
index 0e5049b157cf..000000000000
--- a/books/PCP_PG/publican.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-debug: 1
-xml_lang: en-US
-brand: common
-condition: common
diff --git a/books/PCP_PG/publican.cfg.in b/books/PCP_PG/publican.cfg.in
new file mode 100644
index 000000000000..eaf4e8d483ff
--- /dev/null
+++ b/books/PCP_PG/publican.cfg.in
@@ -0,0 +1,4 @@
+debug: 1
+xml_lang: en-US
+brand: @brand@
+condition: common
diff --git a/books/PCP_TCS/GNUmakefile b/books/PCP_TCS/GNUmakefile
index 239eee80da9a..c61aeb730e4f 100644
--- a/books/PCP_TCS/GNUmakefile
+++ b/books/PCP_TCS/GNUmakefile
@@ -13,7 +13,7 @@ CFG = publican.cfg
 CP = cp -rdp
 LSRCFILES = $(XML) $(PUB) $(CFG) $(PDF)
 LDIRDIRT = pdf html en-US tmp
-LDIRT = built.*
+LDIRT = built.* publican.cfg
 CWD = $(shell pwd)
 
 default: build-me
@@ -21,7 +21,7 @@ default: build-me
 include $(BUILDRULES)
 
 ifeq "$(BOOK_TOOLCHAIN)" "publican"
-built.$(BOOK_TOOLCHAIN):       $(XML)
+built.$(BOOK_TOOLCHAIN):       $(XML) $(CFG)
        @rm -fr pdf html en-US tmp
        @mkdir -p pdf html en-US tmp
        $(CP) $(CWD)/$(PUB) en-US/
@@ -59,6 +59,9 @@ else
 build-me:
 endif
 
+publican.cfg : publican.cfg.in
+       $(SED) -e 's;@brand@;'$(BOOK_BRAND)';' $< > $@
+
 install: default
 #      $(INSTALL) -m 755 -d $(PCP_BOOKS_DIR)
 #      $(INSTALL) -m 644 $(PDF) $(PCP_BOOKS_DIR)/$(PDF)
diff --git a/books/PCP_TCS/publican.cfg b/books/PCP_TCS/publican.cfg
deleted file mode 100644
index 0e5049b157cf..000000000000
--- a/books/PCP_TCS/publican.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-debug: 1
-xml_lang: en-US
-brand: common
-condition: common
diff --git a/books/PCP_TCS/publican.cfg.in b/books/PCP_TCS/publican.cfg.in
new file mode 100644
index 000000000000..eaf4e8d483ff
--- /dev/null
+++ b/books/PCP_TCS/publican.cfg.in
@@ -0,0 +1,4 @@
+debug: 1
+xml_lang: en-US
+brand: @brand@
+condition: common
diff --git a/books/PCP_UAG/GNUmakefile b/books/PCP_UAG/GNUmakefile
index 6221203d1da0..5242f4e8aac8 100644
--- a/books/PCP_UAG/GNUmakefile
+++ b/books/PCP_UAG/GNUmakefile
@@ -13,7 +13,7 @@ CFG = publican.cfg
 CP = cp -rdp
 LSRCFILES = $(XML) $(PUB) $(CFG) $(PDF)
 LDIRDIRT = pdf html en-US tmp
-LDIRT = built.*
+LDIRT = built.* publican.cfg
 CWD = $(shell pwd)
 
 default: build-me
@@ -21,7 +21,7 @@ default: build-me
 include $(BUILDRULES)
 
 ifeq "$(BOOK_TOOLCHAIN)" "publican"
-built.$(BOOK_TOOLCHAIN):       $(XML)
+built.$(BOOK_TOOLCHAIN):       $(XML) $(CFG)
        @rm -fr pdf html en-US tmp
        @mkdir -p pdf html en-US tmp
        $(CP) $(CWD)/$(PUB) en-US/
@@ -59,6 +59,9 @@ else
 build-me:
 endif
 
+publican.cfg : publican.cfg.in
+       $(SED) -e 's;@brand@;'$(BOOK_BRAND)';' $< > $@
+
 install: default
        $(INSTALL) -m 755 -d $(PCP_BOOKS_DIR)
        $(INSTALL) -m 644 $(PDF) $(PCP_BOOKS_DIR)/$(PDF)
diff --git a/books/PCP_UAG/publican.cfg b/books/PCP_UAG/publican.cfg
deleted file mode 100644
index 0e5049b157cf..000000000000
--- a/books/PCP_UAG/publican.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-debug: 1
-xml_lang: en-US
-brand: common
-condition: common
diff --git a/books/PCP_UAG/publican.cfg.in b/books/PCP_UAG/publican.cfg.in
new file mode 100644
index 000000000000..eaf4e8d483ff
--- /dev/null
+++ b/books/PCP_UAG/publican.cfg.in
@@ -0,0 +1,4 @@
+debug: 1
+xml_lang: en-US
+brand: @brand@
+condition: common
diff --git a/configure b/configure
index 4d825cf69fed..201353682fde 100755
--- a/configure
+++ b/configure
@@ -738,6 +738,7 @@ LEXLIB
 LEX_OUTPUT_ROOT
 LEX
 LN_S
+book_brand
 book_toolchain
 xmlto
 XMLTO
@@ -911,6 +912,7 @@ with_qt
 with_python
 with_python3
 with_books
+with_books_brand
 with_papi
 with_perfevent
 with_manager
@@ -1604,6 +1606,9 @@ Optional Packages:
   --with-python3          enable support for tools requiring Python3 (default
                           is on)
   --with-books            enable building of the PCP books (default is off)
+  --with-books-brand=BRAND
+                          choose the docbook brand when building the PCP books
+                          (default is common)
   --with-papi[=DIR|=MODULE]
                           enable performance api counter pmda (default is on)
                           The optional argument may be a full path of a PAPI
@@ -2659,6 +2664,15 @@ fi
 
 
 
+# Check whether --with-books-brand was given.
+if test "${with_books_brand+set}" = set; then :
+  withval=$with_books_brand; do_books_brand=$withval; 
PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-books-brand=$withval"
+else
+  do_books_brand=common
+fi
+
+
+
 # Check whether --with-papi was given.
 if test "${with_papi+set}" = set; then :
   withval=$with_papi; do_papi=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE 
--with-papi=$withval"
@@ -8346,6 +8360,13 @@ then
 fi
 
 
+book_brand="common"
+if test "$do_books_brand" != ""
+then
+       book_brand=$do_books_brand
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
diff --git a/configure.ac b/configure.ac
index fd2b62f669da..65e6f4969f56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,12 @@ AC_ARG_WITH([books],
     [do_books=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE 
--with-books=$withval"],
     [do_books=no])
 
+AC_ARG_WITH([books-brand],
+    [AC_HELP_STRING([--with-books-brand=BRAND],
+                   [choose the docbook brand when building the PCP books 
(default is common)])],
+    [do_books_brand=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE 
--with-books-brand=$withval"],
+    [do_books_brand=common])
+
 AC_ARG_WITH([papi],
     [AC_HELP_STRING([--with-papi@<:@=DIR|=MODULE@:>@],
                   [enable performance api counter pmda (default is on)
@@ -955,6 +961,13 @@ then
 fi
 AC_SUBST(book_toolchain)
 
+book_brand="common"
+if test "$do_books_brand" != ""
+then
+       book_brand=$do_books_brand
+fi
+AC_SUBST(book_brand)
+
 dnl check if symbolic links are supported
 AC_PROG_LN_S
 if test $target_os = mingw; then
diff --git a/src/include/builddefs.in b/src/include/builddefs.in
index 34d9f4d9269e..2d5d77b4a0de 100644
--- a/src/include/builddefs.in
+++ b/src/include/builddefs.in
@@ -204,6 +204,7 @@ XMLTO       = @xmlto@
 DBLATEX        = @dblatex@
 PUBLICAN = @publican@
 BOOK_TOOLCHAIN = @book_toolchain@
+BOOK_BRAND = @book_brand@
 
 HAVE_GZIPPED_MANPAGES = @have_gzipped_manpages@
 HAVE_BZIP2ED_MANPAGES = @have_bzip2ed_manpages@
-- 
2.3.6

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] Add a configure switch for publican brand support, Michele Baldessari <=