configure.ac, doc/Makefile.am: Ship the bibliography style.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 24 Aug 2019 23:41:27 +0000 (00:41 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 31 Aug 2019 02:12:33 +0000 (03:12 +0100)
Well, the machinery to generate one, anyway.

configure.ac
doc/Makefile.am
doc/mdwalpha.dbj [new file with mode: 0644]

index 66cdc51..5e121cd 100644 (file)
@@ -133,11 +133,12 @@ AC_ARG_ENABLE([manual], [AS_HELP_STRING([--enable-manual])],
 
 dnl Make sure the TeX programs we need are available.
 case $sod_have_latex in maybe)
+AC_CHECK_PROGS([TEX], [tex], [none])
 AC_CHECK_PROGS([PDFLATEX], [pdflatex], [none])
 AC_CHECK_PROGS([KPSEWHICH], [kpsewhich], [none])
 AC_CHECK_PROGS([BIBTEX], [bibtex], [none])
 AC_CHECK_PROGS([MAKEINDEX], [makeindex], [none])
-case ,$PDFLATEX,$KPSEWHICH,$BIBTEX,$MAKEINDX, in
+case ,$TEX,$PDFLATEX,$KPSEWHICH,$BIBTEX,$MAKEINDX, in
   *,none,*)
     AC_MSG_WARN([Necessary TeX programs not found: can't build manual!])
     sod_have_latex=no
@@ -145,6 +146,7 @@ case ,$PDFLATEX,$KPSEWHICH,$BIBTEX,$MAKEINDX, in
 esac
 ;; esac
 
+sod_have_custom_bib=no
 case $sod_have_latex in maybe)
 SOD_CHECK_LATEX_FILE([strayman.cls], [], [sod_have_latex=no])
 SOD_CHECK_LATEX_FILE([fontenc.sty], [], [sod_have_latex=no])
@@ -180,6 +182,8 @@ SOD_CHECK_LATEX_FILE([phvr8r.tfm], [], [sod_have_latex=no])
 SOD_CHECK_LATEX_FILE([phvb8r.tfm], [], [sod_have_latex=no])
 SOD_CHECK_LATEX_FILE([pcrr8rn.tfm], [], [sod_have_latex=no])
 
+SOD_CHECK_LATEX_FILE([merlin.mbs], [sod_have_custom_bib=yes], [:])
+
 case $sod_have_latex in
   no)
     AC_MSG_WARN([Necessary LaTeX packages not found: can't build manual!])
@@ -196,6 +200,7 @@ case $sod_want_latex,$sod_have_latex in
     ;;
 esac
 AM_CONDITIONAL([HAVE_LATEX], [test "$sod_have_latex" = "yes"])
+AM_CONDITIONAL([HAVE_CUSTOM_BIB], [test "$sod_have_custom_bib" = "yes"])
 
 dnl--------------------------------------------------------------------------
 dnl Output.
index 6647f48..ec29260 100644 (file)
@@ -27,9 +27,10 @@ include $(top_srcdir)/vars.am
 
 doc_DATA                =
 TEX_FILES               =
+BIB_FILES               =
 
 CLEANFILES             += *.aux *.out *.log *.toc *.ind *.idx *.ilg
-EXTRA_DIST             += $(TEX_FILES)
+EXTRA_DIST             += $(TEX_FILES) $(BIB_FILES)
 
 TEXFLAGS                = --interaction=batchmode \
                                --output-directory=$(abs_builddir)
@@ -89,18 +90,35 @@ TEX_FILES           += output.tex
 ## Other hacks.
 TEX_FILES              += cutting-room-floor.tex
 
+## Building the bibliography style.
+EXTRA_DIST             += mdwalpha.dbj
+
 ## Building the output documents.
-MAINTAINERCLEANFILES   += sod.pdf
+MAINTAINERCLEANFILES   += sod.pdf sod.bst babelbst.tex
 
 if HAVE_LATEX
 doc_DATA               += sod.pdf
 EXTRA_DIST             += sod.pdf
-sod.pdf: $(TEX_FILES)
+sod.pdf: $(TEX_FILES) $(BIB_FILES)
        $(call run_pdflatex,sod.tex)
-       $(V_BIBTEX)$(BIBTEX) $(BIBTEXFLAGS) sod.aux
+       $(V_BIBTEX)env \
+               BIBINPUTS=$(srcdir):$$BIBINPUTS \
+               BSTINPUTS=$(srcdir):$$BSTINPUTS \
+       $(BIBTEX) $(BIBTEXFLAGS) sod.aux
        $(call run_pdflatex,sod.tex)
        $(V_MAKEINDEX)$(MAKEINDEX) $(MAKEINDEXFLAGS) sod.idx
        $(call run_pdflatex,sod.tex)
+
+if HAVE_CUSTOM_BIB
+BIB_FILES              += mdwalpha.bst babelbst.tex
+babelbst.tex: mdwalpha.bst
+mdwalpha.bst: mdwalpha.dbj
+       (cd $(srcdir) && $(TEX) \
+               --jobname=mdwalpha \
+               --interaction=batchmode \
+               --output-directory=$(abs_builddir) \
+               '\let\ifbatching\iftrue \input mdwalpha.dbj')
+endif
 endif
 
 ###----- That's all, folks --------------------------------------------------
diff --git a/doc/mdwalpha.dbj b/doc/mdwalpha.dbj
new file mode 100644 (file)
index 0000000..25c5d43
--- /dev/null
@@ -0,0 +1,41 @@
+\input docstrip
+
+\preamble
+\endpreamble
+
+\postamble
+\endpostamble
+
+\keepsilent
+\ifx\ifbatching\iftrue
+  \askforoverwritefalse
+\fi
+
+\generate{
+  \file{mdwalpha.bst}{
+    \from{merlin.mbs}{%
+      alph,vonx,%
+      babel,lang,%
+      blk-com,com-semi,%
+      volp-sp,vnum-sp,tit-qq,qt-s,qx,atit-u,pp-last,%
+      num-xser,%
+      isbn,issn,%
+      url,url-blk,%
+      pp,ed,abr,%
+      etal-it,%
+      nfss%
+    }
+  }
+  \file{babelbst.tex}{
+    \from{merlin.mbs}{%
+      bblbst%
+    }
+  }
+}
+
+\endbatchfile
+
+%%% Local Variables:
+%%% mode: plain-tex
+%%% TeX-master: t
+%%% End: