summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-12-20 10:41:53 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-12-20 10:41:53 +0000
commit5ea8fa0cef406b98d720cda6f6b87a033439987b (patch)
tree0bf7f79b9b9e02b0c56d68faeeb9c2c3b9e62329 /Build/source
parentacdc410c1a4278aa00a147cf413e432df66418f7 (diff)
songs 2.17
git-svn-id: svn://tug.org/texlive/trunk@32454 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/Makefile.in1
-rwxr-xr-xBuild/source/configure20
-rw-r--r--Build/source/doc/Makefile.in1
-rw-r--r--Build/source/libs/Makefile.in1
-rwxr-xr-xBuild/source/libs/configure20
-rw-r--r--Build/source/m4/ChangeLog4
-rw-r--r--Build/source/m4/kpse-pkgs.m41
-rw-r--r--Build/source/texk/Makefile.in1
-rwxr-xr-xBuild/source/texk/configure20
-rw-r--r--Build/source/utils/Makefile.in1
-rw-r--r--Build/source/utils/README3
-rwxr-xr-xBuild/source/utils/configure29
-rw-r--r--Build/source/utils/songs/ChangeLog7
-rw-r--r--Build/source/utils/songs/Makefile.am55
-rw-r--r--Build/source/utils/songs/Makefile.in1211
-rw-r--r--Build/source/utils/songs/ac/withenable.ac7
-rw-r--r--Build/source/utils/songs/aclocal.m41188
-rw-r--r--Build/source/utils/songs/config.h.in87
-rwxr-xr-xBuild/source/utils/songs/configure6812
-rw-r--r--Build/source/utils/songs/configure.ac55
-rwxr-xr-xBuild/source/utils/songs/songidx.test20
-rw-r--r--Build/source/utils/songs/songs-2.17-PATCHES/ChangeLog7
-rw-r--r--Build/source/utils/songs/songs-2.17-PATCHES/TL-Changes17
-rw-r--r--Build/source/utils/songs/songs-2.17-PATCHES/patch-01-protos41
-rw-r--r--Build/source/utils/songs/songs-2.17-PATCHES/patch-02-const59
-rw-r--r--Build/source/utils/songs/songs-2.17/AUTHORS3
-rw-r--r--Build/source/utils/songs/songs-2.17/COPYING339
-rw-r--r--Build/source/utils/songs/songs-2.17/ChangeLog4
-rw-r--r--Build/source/utils/songs/songs-2.17/INSTALL370
-rw-r--r--Build/source/utils/songs/songs-2.17/Makefile.am10
-rw-r--r--Build/source/utils/songs/songs-2.17/NEWS369
-rw-r--r--Build/source/utils/songs/songs-2.17/README200
-rw-r--r--Build/source/utils/songs/songs-2.17/acinclude.m48
-rw-r--r--Build/source/utils/songs/songs-2.17/configure.ac85
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_dvips.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_kpsewhich.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_latex.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_makeindex.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_pdflatex.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_texhash.m441
-rw-r--r--Build/source/utils/songs/songs-2.17/m4/ac_prog_vim.m435
-rw-r--r--Build/source/utils/songs/songs-2.17/src/config.h.in96
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/Makefile.am5
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/authidx.c494
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/bible.can200
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/catholic.can174
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/chars.h136
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/fileio.c122
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/fileio.h54
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/greek.can187
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/protestant.can160
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/scripidx.c1105
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/songidx.c265
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/songidx.h64
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/songsort.c164
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/tanakh.can100
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songidx/titleidx.c375
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songs/GNUmakefile.am54
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songs/Makefile5
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songs/songs.dtx12090
-rw-r--r--Build/source/utils/songs/songs-2.17/src/songs/songs.ins61
-rw-r--r--Build/source/utils/songs/tests/myauth.sbx4
-rw-r--r--Build/source/utils/songs/tests/myauth.sxd4
-rw-r--r--Build/source/utils/songs/tests/mybook.tex32
-rw-r--r--Build/source/utils/songs/tests/myscrip.sbx3
-rw-r--r--Build/source/utils/songs/tests/myscrip.sxd4
-rw-r--r--Build/source/utils/songs/tests/mytitle.sbx6
-rw-r--r--Build/source/utils/songs/tests/mytitle.sxd7
-rw-r--r--Build/source/utils/songs/version.ac11
69 files changed, 27319 insertions, 0 deletions
diff --git a/Build/source/Makefile.in b/Build/source/Makefile.in
index 49886dad354..1fd6ff447e8 100644
--- a/Build/source/Makefile.in
+++ b/Build/source/Makefile.in
@@ -125,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/kpse-cairo-flags.m4 \
$(top_srcdir)/utils/m-tx/ac/withenable.ac \
$(top_srcdir)/utils/pmx/ac/withenable.ac \
$(top_srcdir)/utils/ps2eps/ac/withenable.ac \
+ $(top_srcdir)/utils/songs/ac/withenable.ac \
$(top_srcdir)/utils/t1utils/ac/withenable.ac \
$(top_srcdir)/utils/texdoctk/ac/withenable.ac \
$(top_srcdir)/utils/tpic2pdftex/ac/withenable.ac \
diff --git a/Build/source/configure b/Build/source/configure
index 28df798c378..6b54ba05224 100755
--- a/Build/source/configure
+++ b/Build/source/configure
@@ -788,6 +788,7 @@ enable_biber
enable_m_tx
enable_pmx
enable_ps2eps
+enable_songs
enable_t1utils
enable_texdoctk
enable_tpic2pdftex
@@ -1596,6 +1597,7 @@ Optional Features:
--disable-m-tx do not build the m-tx package
--disable-pmx do not build the pmx package
--disable-ps2eps do not build the ps2eps package
+ --disable-songs do not build the songs package
--disable-t1utils do not build the t1utils package
--disable-texdoctk do not build the texdoctk package
--disable-tpic2pdftex do not build the tpic2pdftex package
@@ -4175,6 +4177,24 @@ $as_echo "$as_me: Assuming \`--enable-ps2eps=$enable_ps2eps'" >&6;}
;;
esac
+## utils/songs/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/songs/
+## configure options and TL libraries required for songs
+# Check whether --enable-songs was given.
+if test "${enable_songs+set}" = set; then :
+ enableval=$enable_songs;
+fi
+case $enable_songs in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_songs=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-songs=$enable_songs'" >&5
+$as_echo "$as_me: Assuming \`--enable-songs=$enable_songs'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-songs=$enable_songs'"
+ ;;
+esac
+
## utils/t1utils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/t1utils/
## configure options and TL libraries required for t1utils
# Check whether --enable-t1utils was given.
diff --git a/Build/source/doc/Makefile.in b/Build/source/doc/Makefile.in
index b6ca57ecdec..9c54632642f 100644
--- a/Build/source/doc/Makefile.in
+++ b/Build/source/doc/Makefile.in
@@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/kpse-cairo-flags.m4 \
$(top_srcdir)/utils/m-tx/ac/withenable.ac \
$(top_srcdir)/utils/pmx/ac/withenable.ac \
$(top_srcdir)/utils/ps2eps/ac/withenable.ac \
+ $(top_srcdir)/utils/songs/ac/withenable.ac \
$(top_srcdir)/utils/t1utils/ac/withenable.ac \
$(top_srcdir)/utils/texdoctk/ac/withenable.ac \
$(top_srcdir)/utils/tpic2pdftex/ac/withenable.ac \
diff --git a/Build/source/libs/Makefile.in b/Build/source/libs/Makefile.in
index 0f63682eb72..8a994d42e36 100644
--- a/Build/source/libs/Makefile.in
+++ b/Build/source/libs/Makefile.in
@@ -123,6 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-cairo-flags.m4 \
$(top_srcdir)/../utils/m-tx/ac/withenable.ac \
$(top_srcdir)/../utils/pmx/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
+ $(top_srcdir)/../utils/songs/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
$(top_srcdir)/../utils/texdoctk/ac/withenable.ac \
$(top_srcdir)/../utils/tpic2pdftex/ac/withenable.ac \
diff --git a/Build/source/libs/configure b/Build/source/libs/configure
index d8dd8cdc98c..2bf899a5ca0 100755
--- a/Build/source/libs/configure
+++ b/Build/source/libs/configure
@@ -700,6 +700,7 @@ enable_biber
enable_m_tx
enable_pmx
enable_ps2eps
+enable_songs
enable_t1utils
enable_texdoctk
enable_tpic2pdftex
@@ -1501,6 +1502,7 @@ Optional Features:
--disable-m-tx do not build the m-tx package
--disable-pmx do not build the pmx package
--disable-ps2eps do not build the ps2eps package
+ --disable-songs do not build the songs package
--disable-t1utils do not build the t1utils package
--disable-texdoctk do not build the texdoctk package
--disable-tpic2pdftex do not build the tpic2pdftex package
@@ -3424,6 +3426,24 @@ $as_echo "$as_me: Assuming \`--enable-ps2eps=$enable_ps2eps'" >&6;}
;;
esac
+## utils/songs/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/songs/
+## configure options and TL libraries required for songs
+# Check whether --enable-songs was given.
+if test "${enable_songs+set}" = set; then :
+ enableval=$enable_songs;
+fi
+case $enable_songs in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_songs=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-songs=$enable_songs'" >&5
+$as_echo "$as_me: Assuming \`--enable-songs=$enable_songs'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-songs=$enable_songs'"
+ ;;
+esac
+
## utils/t1utils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/t1utils/
## configure options and TL libraries required for t1utils
# Check whether --enable-t1utils was given.
diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog
index 68fb7a271e7..c33ea7c8892 100644
--- a/Build/source/m4/ChangeLog
+++ b/Build/source/m4/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-pkgs.m4 (kpse_utils_pkgs): Add songs.
+
2013-12-03 Peter Breitenlohner <peb@mppmu.mpg.de>
* kpse-pkgs.m4: Move psutils from ../utils/ to ../texk/.
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
index 53dd8d6c90e..0854c425a1f 100644
--- a/Build/source/m4/kpse-pkgs.m4
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -79,6 +79,7 @@ biber
m-tx
pmx
ps2eps
+songs
t1utils
texdoctk
tpic2pdftex
diff --git a/Build/source/texk/Makefile.in b/Build/source/texk/Makefile.in
index 1a66ae00cc9..1fc88695719 100644
--- a/Build/source/texk/Makefile.in
+++ b/Build/source/texk/Makefile.in
@@ -123,6 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-cairo-flags.m4 \
$(top_srcdir)/../utils/m-tx/ac/withenable.ac \
$(top_srcdir)/../utils/pmx/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
+ $(top_srcdir)/../utils/songs/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
$(top_srcdir)/../utils/texdoctk/ac/withenable.ac \
$(top_srcdir)/../utils/tpic2pdftex/ac/withenable.ac \
diff --git a/Build/source/texk/configure b/Build/source/texk/configure
index ec827376f01..e24598c8bea 100755
--- a/Build/source/texk/configure
+++ b/Build/source/texk/configure
@@ -700,6 +700,7 @@ enable_biber
enable_m_tx
enable_pmx
enable_ps2eps
+enable_songs
enable_t1utils
enable_texdoctk
enable_tpic2pdftex
@@ -1516,6 +1517,7 @@ Optional Features:
--disable-m-tx do not build the m-tx package
--disable-pmx do not build the pmx package
--disable-ps2eps do not build the ps2eps package
+ --disable-songs do not build the songs package
--disable-t1utils do not build the t1utils package
--disable-texdoctk do not build the texdoctk package
--disable-tpic2pdftex do not build the tpic2pdftex package
@@ -3439,6 +3441,24 @@ $as_echo "$as_me: Assuming \`--enable-ps2eps=$enable_ps2eps'" >&6;}
;;
esac
+## utils/songs/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/songs/
+## configure options and TL libraries required for songs
+# Check whether --enable-songs was given.
+if test "${enable_songs+set}" = set; then :
+ enableval=$enable_songs;
+fi
+case $enable_songs in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_songs=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-songs=$enable_songs'" >&5
+$as_echo "$as_me: Assuming \`--enable-songs=$enable_songs'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-songs=$enable_songs'"
+ ;;
+esac
+
## utils/t1utils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/t1utils/
## configure options and TL libraries required for t1utils
# Check whether --enable-t1utils was given.
diff --git a/Build/source/utils/Makefile.in b/Build/source/utils/Makefile.in
index 8dbfab42287..e0645e0484f 100644
--- a/Build/source/utils/Makefile.in
+++ b/Build/source/utils/Makefile.in
@@ -123,6 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-cairo-flags.m4 \
$(top_srcdir)/../utils/m-tx/ac/withenable.ac \
$(top_srcdir)/../utils/pmx/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
+ $(top_srcdir)/../utils/songs/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
$(top_srcdir)/../utils/texdoctk/ac/withenable.ac \
$(top_srcdir)/../utils/tpic2pdftex/ac/withenable.ac \
diff --git a/Build/source/utils/README b/Build/source/utils/README
index 3d440f8c5aa..1917a384760 100644
--- a/Build/source/utils/README
+++ b/Build/source/utils/README
@@ -18,6 +18,9 @@ pmx 2.7.0 - checked 11apr13
ps2eps 1.68 - checked 10may12
http://tm.uka.de/~bless/ps2eps
+songs 2.17 - checked 20dec13
+ http://songs.sourceforge.net/
+
t1utils 1.38 - checked 3oct13
http://www.lcdf.org/type/
diff --git a/Build/source/utils/configure b/Build/source/utils/configure
index cc96c98f8fc..1b23e6ae991 100755
--- a/Build/source/utils/configure
+++ b/Build/source/utils/configure
@@ -700,6 +700,7 @@ enable_biber
enable_m_tx
enable_pmx
enable_ps2eps
+enable_songs
enable_t1utils
enable_texdoctk
enable_tpic2pdftex
@@ -859,6 +860,7 @@ ac_subdirs_all='biber
m-tx
pmx
ps2eps
+songs
t1utils
texdoctk
tpic2pdftex
@@ -1495,6 +1497,7 @@ Optional Features:
--disable-m-tx do not build the m-tx package
--disable-pmx do not build the pmx package
--disable-ps2eps do not build the ps2eps package
+ --disable-songs do not build the songs package
--disable-t1utils do not build the t1utils package
--disable-texdoctk do not build the texdoctk package
--disable-tpic2pdftex do not build the tpic2pdftex package
@@ -3418,6 +3421,24 @@ $as_echo "$as_me: Assuming \`--enable-ps2eps=$enable_ps2eps'" >&6;}
;;
esac
+## utils/songs/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/songs/
+## configure options and TL libraries required for songs
+# Check whether --enable-songs was given.
+if test "${enable_songs+set}" = set; then :
+ enableval=$enable_songs;
+fi
+case $enable_songs in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_songs=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-songs=$enable_songs'" >&5
+$as_echo "$as_me: Assuming \`--enable-songs=$enable_songs'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-songs=$enable_songs'"
+ ;;
+esac
+
## utils/t1utils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/t1utils/
## configure options and TL libraries required for t1utils
# Check whether --enable-t1utils was given.
@@ -6287,6 +6308,14 @@ if test -x $srcdir/ps2eps/configure; then
fi
fi
+if test -x $srcdir/songs/configure; then
+ test "x$enable_songs" = xyes && MAKE_SUBDIRS="$MAKE_SUBDIRS songs"
+ CONF_SUBDIRS="$CONF_SUBDIRS songs"
+ if false; then
+ subdirs="$subdirs songs"
+
+ fi
+fi
if test -x $srcdir/t1utils/configure; then
test "x$enable_t1utils" = xyes && MAKE_SUBDIRS="$MAKE_SUBDIRS t1utils"
CONF_SUBDIRS="$CONF_SUBDIRS t1utils"
diff --git a/Build/source/utils/songs/ChangeLog b/Build/source/utils/songs/ChangeLog
new file mode 100644
index 00000000000..f5df0b5b316
--- /dev/null
+++ b/Build/source/utils/songs/ChangeLog
@@ -0,0 +1,7 @@
+2013-12-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Adapt songs-2.17 to the TeX Live build system.
+
+Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+You may freely use, modify and/or distribute this file.
+
diff --git a/Build/source/utils/songs/Makefile.am b/Build/source/utils/songs/Makefile.am
new file mode 100644
index 00000000000..ba5d29bf74d
--- /dev/null
+++ b/Build/source/utils/songs/Makefile.am
@@ -0,0 +1,55 @@
+## Makefile.am for the TeX Live subdirectory utils/songs/
+##
+## Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+##
+
+## We want to re-distribute the whole original songs source tree.
+EXTRA_DIST = $(SONGS_TREE)
+## Patches applied to the original source tree
+EXTRA_DIST += $(SONGS_TREE)-PATCHES
+
+# in case of an SVN repository
+dist-hook:
+ rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'`
+
+AM_CPPFLAGS = -I$(SONGS_TREE)/src/songidx
+AM_CPPFLAGS += -D_ISOC99_SOURCE
+AM_CFLAGS = $(WARNING_CFLAGS)
+
+bin_PROGRAMS = songidx
+
+songidx_SOURCES = \
+ @SONGS_TREE@/src/songidx/authidx.c \
+ @SONGS_TREE@/src/songidx/fileio.c \
+ @SONGS_TREE@/src/songidx/scripidx.c \
+ @SONGS_TREE@/src/songidx/songidx.c \
+ @SONGS_TREE@/src/songidx/songsort.c \
+ @SONGS_TREE@/src/songidx/titleidx.c
+
+## Data
+##
+songsdatadir = $(datarootdir)/texmf-dist/tex/latex/songs
+dist_songsdata_DATA = songs.sty
+
+all-local: songs.sty
+
+songs.sty: @MAINTAINER_MODE_TRUE@ $(SONGS_TREE)/src/songs/songs.ins $(SONGS_TREE)/src/songs/songs.dtx
+ TEXINPUTS=$(srcdir)/$(SONGS_TREE)/src/songs:$$TEXINPUTS $(LATEX) songs.ins
+
+DISTCLEANFILES = songs.log
+
+## Tests
+##
+TESTS = songidx.test
+EXTRA_DIST += $(TESTS)
+
+TESTS_ENVIRONMENT = SONGS_TREE=$(SONGS_TREE)
+
+## songidx.test
+EXTRA_DIST += tests/mybook.tex \
+ tests/myauth.sbx tests/myauth.sxd \
+ tests/myscrip.sbx tests/myscrip.sxd \
+ tests/mytitle.sbx tests/mytitle.sxd
+DISTCLEANFILES += tests/xmy*.sbx
+
diff --git a/Build/source/utils/songs/Makefile.in b/Build/source/utils/songs/Makefile.in
new file mode 100644
index 00000000000..fba5deb7418
--- /dev/null
+++ b/Build/source/utils/songs/Makefile.in
@@ -0,0 +1,1211 @@
+# Makefile.in generated by automake 1.14 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+bin_PROGRAMS = songidx$(EXEEXT)
+subdir = .
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.h.in $(top_srcdir)/../../build-aux/depcomp \
+ $(dist_songsdata_DATA) \
+ $(top_srcdir)/../../build-aux/test-driver ChangeLog \
+ ../../build-aux/compile ../../build-aux/config.guess \
+ ../../build-aux/config.sub ../../build-aux/depcomp \
+ ../../build-aux/install-sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap \
+ ../../build-aux/ltmain.sh \
+ $(top_srcdir)/../../build-aux/compile \
+ $(top_srcdir)/../../build-aux/install-sh \
+ $(top_srcdir)/../../build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-progs.m4 \
+ $(top_srcdir)/../../m4/kpse-warnings.m4 \
+ $(top_srcdir)/version.ac $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(songsdatadir)"
+PROGRAMS = $(bin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_songidx_OBJECTS = @SONGS_TREE@/src/songidx/authidx.$(OBJEXT) \
+ @SONGS_TREE@/src/songidx/fileio.$(OBJEXT) \
+ @SONGS_TREE@/src/songidx/scripidx.$(OBJEXT) \
+ @SONGS_TREE@/src/songidx/songidx.$(OBJEXT) \
+ @SONGS_TREE@/src/songidx/songsort.$(OBJEXT) \
+ @SONGS_TREE@/src/songidx/titleidx.$(OBJEXT)
+songidx_OBJECTS = $(am_songidx_OBJECTS)
+songidx_LDADD = $(LDADD)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(songidx_SOURCES)
+DIST_SOURCES = $(songidx_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+DATA = $(dist_songsdata_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope check recheck
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/../../build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LATEX = @LATEX@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SONGS_TREE = @SONGS_TREE@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = $(SONGS_TREE) $(SONGS_TREE)-PATCHES $(TESTS) \
+ tests/mybook.tex tests/myauth.sbx tests/myauth.sxd \
+ tests/myscrip.sbx tests/myscrip.sxd tests/mytitle.sbx \
+ tests/mytitle.sxd
+AM_CPPFLAGS = -I$(SONGS_TREE)/src/songidx -D_ISOC99_SOURCE
+AM_CFLAGS = $(WARNING_CFLAGS)
+songidx_SOURCES = \
+ @SONGS_TREE@/src/songidx/authidx.c \
+ @SONGS_TREE@/src/songidx/fileio.c \
+ @SONGS_TREE@/src/songidx/scripidx.c \
+ @SONGS_TREE@/src/songidx/songidx.c \
+ @SONGS_TREE@/src/songidx/songsort.c \
+ @SONGS_TREE@/src/songidx/titleidx.c
+
+songsdatadir = $(datarootdir)/texmf-dist/tex/latex/songs
+dist_songsdata_DATA = songs.sty
+DISTCLEANFILES = songs.log tests/xmy*.sbx
+TESTS = songidx.test
+TESTS_ENVIRONMENT = SONGS_TREE=$(SONGS_TREE)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+@SONGS_TREE@/src/songidx/$(am__dirstamp):
+ @$(MKDIR_P) @SONGS_TREE@/src/songidx
+ @: > @SONGS_TREE@/src/songidx/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) @SONGS_TREE@/src/songidx/$(DEPDIR)
+ @: > @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/authidx.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/fileio.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/scripidx.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/songidx.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/songsort.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+@SONGS_TREE@/src/songidx/titleidx.$(OBJEXT): \
+ @SONGS_TREE@/src/songidx/$(am__dirstamp) \
+ @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+
+songidx$(EXEEXT): $(songidx_OBJECTS) $(songidx_DEPENDENCIES) $(EXTRA_songidx_DEPENDENCIES)
+ @rm -f songidx$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(songidx_OBJECTS) $(songidx_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f @SONGS_TREE@/src/songidx/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/authidx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/fileio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/scripidx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/songidx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/songsort.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@SONGS_TREE@/src/songidx/$(DEPDIR)/titleidx.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+install-dist_songsdataDATA: $(dist_songsdata_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_songsdata_DATA)'; test -n "$(songsdatadir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(songsdatadir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(songsdatadir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(songsdatadir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(songsdatadir)" || exit $$?; \
+ done
+
+uninstall-dist_songsdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_songsdata_DATA)'; test -n "$(songsdatadir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(songsdatadir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA) config.h all-local
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(songsdatadir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f @SONGS_TREE@/src/songidx/$(DEPDIR)/$(am__dirstamp)
+ -rm -f @SONGS_TREE@/src/songidx/$(am__dirstamp)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf @SONGS_TREE@/src/songidx/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_songsdataDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf @SONGS_TREE@/src/songidx/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_songsdataDATA
+
+.MAKE: all check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \
+ check-TESTS check-am clean clean-binPROGRAMS clean-cscope \
+ clean-generic cscope cscopelist-am ctags ctags-am dist \
+ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-dist_songsdataDATA install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \
+ uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-dist_songsdataDATA
+
+
+# in case of an SVN repository
+dist-hook:
+ rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'`
+
+all-local: songs.sty
+
+songs.sty: @MAINTAINER_MODE_TRUE@ $(SONGS_TREE)/src/songs/songs.ins $(SONGS_TREE)/src/songs/songs.dtx
+ TEXINPUTS=$(srcdir)/$(SONGS_TREE)/src/songs:$$TEXINPUTS $(LATEX) songs.ins
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/utils/songs/ac/withenable.ac b/Build/source/utils/songs/ac/withenable.ac
new file mode 100644
index 00000000000..6b7f32a6781
--- /dev/null
+++ b/Build/source/utils/songs/ac/withenable.ac
@@ -0,0 +1,7 @@
+## utils/songs/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/songs/
+dnl
+dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+dnl You may freely use, modify and/or distribute this file.
+dnl
+## configure options and TL libraries required for songs
+KPSE_ENABLE_PROG([songs])
diff --git a/Build/source/utils/songs/aclocal.m4 b/Build/source/utils/songs/aclocal.m4
new file mode 100644
index 00000000000..fa895f79df1
--- /dev/null
+++ b/Build/source/utils/songs/aclocal.m4
@@ -0,0 +1,1188 @@
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.14'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.14], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../../m4/kpse-common.m4])
+m4_include([../../m4/kpse-progs.m4])
+m4_include([../../m4/kpse-warnings.m4])
diff --git a/Build/source/utils/songs/config.h.in b/Build/source/utils/songs/config.h.in
new file mode 100644
index 00000000000..087b259bfe0
--- /dev/null
+++ b/Build/source/utils/songs/config.h.in
@@ -0,0 +1,87 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+#endif
diff --git a/Build/source/utils/songs/configure b/Build/source/utils/songs/configure
new file mode 100755
index 00000000000..fc7224bc053
--- /dev/null
+++ b/Build/source/utils/songs/configure
@@ -0,0 +1,6812 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for songs (TeX Live) 2.17.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and tex-k@tug.org
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='songs (TeX Live)'
+PACKAGE_TARNAME='songs--tex-live-'
+PACKAGE_VERSION='2.17'
+PACKAGE_STRING='songs (TeX Live) 2.17'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+PACKAGE_URL=''
+
+ac_unique_file="songs-2.17/src/songidx/songidx.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+SONGS_TREE
+EGREP
+GREP
+CPP
+LATEX
+LN_S
+WARNING_CFLAGS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+enable_compiler_warnings
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+LATEX
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures songs (TeX Live) 2.17 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/songs--tex-live-]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of songs (TeX Live) 2.17:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-compiler-warnings=[no|min|yes|max|all]
+ Turn on compiler warnings [default: yes if
+ maintainer-mode, min otherwise]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ LATEX LaTeX command
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+songs (TeX Live) configure 2.17
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ---------------------------- ##
+## Report this to tex-k@tug.org ##
+## ---------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by songs (TeX Live) $as_me 2.17, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../build-aux \"$srcdir\"/../../build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.14'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --enable-compiler-warnings was given.
+if test "${enable_compiler_warnings+set}" = set; then :
+ enableval=$enable_compiler_warnings;
+fi
+case $enable_compiler_warnings in #(
+ no | min | yes | max | all) :
+ ;; #(
+ *) :
+ if test "x$enable_maintainer_mode" = xyes; then :
+ enable_compiler_warnings=yes
+else
+ enable_compiler_warnings=min
+fi ;;
+esac
+
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='songs--tex-live-'
+ VERSION='2.17'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler accepts prototypes" >&5
+$as_echo_n "checking whether the compiler accepts prototypes... " >&6; }
+if ${kb_cv_c_prototypes+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+int
+main ()
+{
+extern void foo(int i,...);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ kb_cv_c_prototypes=yes
+else
+ kb_cv_c_prototypes=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kb_cv_c_prototypes" >&5
+$as_echo "$kb_cv_c_prototypes" >&6; }
+if test "x$kb_cv_c_prototypes" = xno; then
+ as_fn_error $? "Sorry, your compiler does not understand prototypes." "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what warning flags to pass to the C compiler" >&5
+$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
+if ${kpse_cv_warning_cflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$GCC" = xyes; then
+ kpse_cv_warning_cflags=
+if test "x$enable_compiler_warnings" != xno; then
+ kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
+ *) :
+ ;;
+esac
+ case `$CC -dumpversion` in #(
+ 3.[234].* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
+ 3.4.* | 4.*) :
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
+ *) :
+ ;;
+esac
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
+ fi
+ fi
+fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
+else
+ kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_warning_cflags" >&5
+$as_echo "$kpse_cv_warning_cflags" >&6; }
+WARNING_CFLAGS=$kpse_cv_warning_cflags
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+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
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+for ac_prog in latex elatex lambda
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LATEX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LATEX"; then
+ ac_cv_prog_LATEX="$LATEX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LATEX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LATEX=$ac_cv_prog_LATEX
+if test -n "$LATEX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5
+$as_echo "$LATEX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$LATEX" && break
+done
+test -n "$LATEX" || LATEX="no"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in locale.h stdlib.h stdio.h string.h wchar.h wctype.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+for ac_func in setlocale strrchr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+
+"
+if test "x$ac_cv_type_wchar_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+
+fi
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+
+
+SONGS_TREE=songs-2.17
+
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by songs (TeX Live) $as_me 2.17, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <tex-k@tug.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+songs (TeX Live) config.status 2.17
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/utils/songs/configure.ac b/Build/source/utils/songs/configure.ac
new file mode 100644
index 00000000000..d32fc51282f
--- /dev/null
+++ b/Build/source/utils/songs/configure.ac
@@ -0,0 +1,55 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl *********************************************************************
+dnl
+dnl Adapted for TeX Live from songs-2.17/configure.ac
+dnl
+dnl *********************************************************************
+dnl
+m4_include([version.ac])[] dnl define songs_version
+AC_INIT([songs (TeX Live)], songs_version, [tex-k@tug.org])
+AC_PREREQ([2.65])
+AC_CONFIG_SRCDIR([songs-]songs_version[/src/songidx/songidx.h])
+AC_CONFIG_AUX_DIR([../../build-aux])
+AC_CONFIG_MACRO_DIR([../../m4])
+
+KPSE_BASIC([songs])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+KPSE_CHECK_LATEX
+
+AC_CHECK_HEADERS([locale.h stdlib.h stdio.h string.h wchar.h wctype.h])
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_CHECK_FUNCS([setlocale strrchr])
+AC_CHECK_TYPES([wchar_t], , ,[
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+])
+
+AC_CONFIG_HEADERS([config.h])
+AH_TOP([#ifndef CONFIG_H
+#define CONFIG_H])
+AH_BOTTOM([#endif])
+
+AC_SUBST([SONGS_TREE], [songs-]songs_version)
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/utils/songs/songidx.test b/Build/source/utils/songs/songidx.test
new file mode 100755
index 00000000000..c4956d6c1e7
--- /dev/null
+++ b/Build/source/utils/songs/songidx.test
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+./songidx $srcdir/tests/myauth.sxd tests/xmyauth.sbx \
+ && diff -b tests/xmyauth.sbx $srcdir/tests/myauth.sbx \
+ || exit 1
+
+./songidx -b $srcdir/$SONGS_TREE/src/songidx/bible.can \
+ $srcdir/tests/myscrip.sxd tests/xmyscrip.sbx \
+ && diff -b tests/xmyscrip.sbx $srcdir/tests/myscrip.sbx \
+ || exit 1
+
+./songidx $srcdir/tests/mytitle.sxd tests/xmytitle.sbx \
+ && diff -b tests/xmytitle.sbx $srcdir/tests/mytitle.sbx \
+ || exit 1
+
diff --git a/Build/source/utils/songs/songs-2.17-PATCHES/ChangeLog b/Build/source/utils/songs/songs-2.17-PATCHES/ChangeLog
new file mode 100644
index 00000000000..8f07afdebdd
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17-PATCHES/ChangeLog
@@ -0,0 +1,7 @@
+2013-12-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Import songs-2.17, patches in songs-2.17-PATCHES.
+
+ * patch-01-protos: Prototypes only in headers.
+ * patch-02-const: Mostly proper handling of const.
+
diff --git a/Build/source/utils/songs/songs-2.17-PATCHES/TL-Changes b/Build/source/utils/songs/songs-2.17-PATCHES/TL-Changes
new file mode 100644
index 00000000000..2a11360a275
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17-PATCHES/TL-Changes
@@ -0,0 +1,17 @@
+Changes applied to the songs-2.17 tree as obtained from:
+ http://songs.sourceforge.net/
+
+Remove:
+ Makefile.in
+ aclocal.m4
+ compile
+ configure
+ depcomp
+ install-sh
+ missing
+ sample/
+ src/sbdchk/
+ src/songidx/Makefile.in
+ src/songs/
+ src/vim/
+
diff --git a/Build/source/utils/songs/songs-2.17-PATCHES/patch-01-protos b/Build/source/utils/songs/songs-2.17-PATCHES/patch-01-protos
new file mode 100644
index 00000000000..6ff7af9397f
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17-PATCHES/patch-01-protos
@@ -0,0 +1,41 @@
+diff -ur songs-2.17.orig/src/songidx/songidx.c songs-2.17/src/songidx/songidx.c
+--- songs-2.17.orig/src/songidx/songidx.c 2013-01-02 21:06:06.000000000 +0100
++++ songs-2.17/src/songidx/songidx.c 2013-12-19 14:45:31.000000000 +0100
+@@ -64,11 +64,6 @@
+ #endif
+ #endif
+
+-extern int gentitleindex(FSTATE *fs, const char *outname);
+-extern int genscriptureindex(FSTATE *fs, const char *outname,
+- const char *biblename);
+-extern int genauthorindex(FSTATE *fs, const char *outname);
+-
+ #define BIBLEDEFAULT "bible.can"
+
+ #if HAVE_STRRCHR
+diff -ur songs-2.17.orig/src/songidx/songidx.h songs-2.17/src/songidx/songidx.h
+--- songs-2.17.orig/src/songidx/songidx.h 2013-01-02 21:06:12.000000000 +0100
++++ songs-2.17/src/songidx/songidx.h 2013-12-19 14:48:20.000000000 +0100
+@@ -29,6 +29,7 @@
+ #endif
+
+ #include "chars.h"
++#include "fileio.h"
+
+ /* A SONGENTRY struct consists of three fields:
+ * title: a string representing the title of the song
+@@ -50,4 +51,14 @@
+ extern void skipesc(const WCHAR **p, int stop_on_space, int skipover_groups);
+ extern int songcmp(const void *s1, const void *s2);
+
++/* The following function is in titleidx.c */
++extern int gentitleindex(FSTATE *fs, const char *outname);
++
++/* The following function is in scripidx.c */
++extern int genscriptureindex(FSTATE *fs, const char *outname,
++ const char *biblename);
++
++/* The following function is in authidx.c */
++extern int genauthorindex(FSTATE *fs, const char *outname);
++
+ #endif
diff --git a/Build/source/utils/songs/songs-2.17-PATCHES/patch-02-const b/Build/source/utils/songs/songs-2.17-PATCHES/patch-02-const
new file mode 100644
index 00000000000..75f5e8e0ccc
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17-PATCHES/patch-02-const
@@ -0,0 +1,59 @@
+diff -ur songs-2.17.orig/src/songidx/authidx.c songs-2.17/src/songidx/authidx.c
+--- songs-2.17.orig/src/songidx/authidx.c 2013-01-02 21:05:12.000000000 +0100
++++ songs-2.17/src/songidx/authidx.c 2013-12-19 15:05:01.000000000 +0100
+@@ -333,10 +333,10 @@
+ int arraysize, numauthors, i;
+ WORDLIST *seplist=&wl_and, *afterlist=&wl_by, *ignorelist=&wl_unknown;
+ SONGENTRY **authors;
+- WCHAR authorbuf[MAXLINELEN], *bp;
++ WCHAR authorbuf[MAXLINELEN];
+ WCHAR songnumbuf[MAXLINELEN], linknamebuf[MAXLINELEN];
+ WCHAR *thisnum, *thislink;
+- const WCHAR *auth;
++ const WCHAR *auth, *bp;
+
+ fprintf(stderr, "songidx: Parsing author index data file %s...\n",
+ fs->filename);
+@@ -395,7 +395,7 @@
+ ws_strcpy(thislink, linknamebuf);
+
+ for (bp=authorbuf;
+- (auth=grabauthor((const WCHAR **) &bp, seplist, afterlist,
++ (auth=grabauthor(&bp, seplist, afterlist,
+ ignorelist)) != NULL;
+ ++numauthors)
+ {
+diff -ur songs-2.17.orig/src/songidx/songsort.c songs-2.17/src/songidx/songsort.c
+--- songs-2.17.orig/src/songidx/songsort.c 2013-04-24 07:19:20.000000000 +0200
++++ songs-2.17/src/songidx/songsort.c 2013-12-19 15:10:08.000000000 +0100
+@@ -96,8 +96,8 @@
+ {
+ static WCHAR buf1[MAXLINELEN+1], *bp1;
+ static WCHAR buf2[MAXLINELEN+1], *bp2;
+- const WCHAR *t1 = (*((const SONGENTRY **) s1))->title;
+- const WCHAR *t2 = (*((const SONGENTRY **) s2))->title;
++ const WCHAR *t1 = (*((SONGENTRY * const *) s1))->title;
++ const WCHAR *t2 = (*((SONGENTRY * const *) s2))->title;
+ int diff;
+
+ for (;;)
+@@ -151,14 +151,14 @@
+
+ /* If each corresponding word/number is identical, then sort alternate-
+ * form entries (e.g., lyrics) after normal entries (e.g., titles). */
+- if (((*((const SONGENTRY **) s1))->title[0] == wc_asterisk)
+- && ((*((const SONGENTRY **) s2))->title[0] != wc_asterisk))
++ if (((*((SONGENTRY * const *) s1))->title[0] == wc_asterisk)
++ && ((*((SONGENTRY * const *) s2))->title[0] != wc_asterisk))
+ return 1;
+- if (((*((const SONGENTRY **) s1))->title[0] != wc_asterisk)
+- && ((*((const SONGENTRY **) s2))->title[0] == wc_asterisk))
++ if (((*((SONGENTRY * const *) s1))->title[0] != wc_asterisk)
++ && ((*((SONGENTRY * const *) s2))->title[0] == wc_asterisk))
+ return -1;
+
+ /* If everything is the same, sort by the right-hand sides of the index
+ * entries (e.g., the song or page numbers). */
+- return (*((const SONGENTRY **) s1))->idx - (*((const SONGENTRY **) s2))->idx;
++ return (*((SONGENTRY * const *) s1))->idx - (*((SONGENTRY * const *) s2))->idx;
+ }
diff --git a/Build/source/utils/songs/songs-2.17/AUTHORS b/Build/source/utils/songs/songs-2.17/AUTHORS
new file mode 100644
index 00000000000..1692a7f0efe
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/AUTHORS
@@ -0,0 +1,3 @@
+The Songs LaTeX package and utilities were created by Kevin W. Hamlen.
+Please refer to http://songs.sourceforge.net for current contact information.
+
diff --git a/Build/source/utils/songs/songs-2.17/COPYING b/Build/source/utils/songs/songs-2.17/COPYING
new file mode 100644
index 00000000000..d159169d105
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/Build/source/utils/songs/songs-2.17/ChangeLog b/Build/source/utils/songs/songs-2.17/ChangeLog
new file mode 100644
index 00000000000..4e258370d68
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/ChangeLog
@@ -0,0 +1,4 @@
+Please refer to NEWS for a revision history of the software.
+Line-by-line source code modification history can be obtained by consulting
+the CVS repository at http://songs.cvs.sourceforge.net/songs.
+
diff --git a/Build/source/utils/songs/songs-2.17/INSTALL b/Build/source/utils/songs/songs-2.17/INSTALL
new file mode 100644
index 00000000000..007e9396d0a
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/INSTALL
@@ -0,0 +1,370 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved. Use GNU `make'
+instead.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf limitation. Until the limitation is lifted, you can use
+this workaround:
+
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
diff --git a/Build/source/utils/songs/songs-2.17/Makefile.am b/Build/source/utils/songs/songs-2.17/Makefile.am
new file mode 100644
index 00000000000..98eb5c73f31
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/Makefile.am
@@ -0,0 +1,10 @@
+SUBDIRS = src/songs src/songidx src/sbdchk sample src/vim
+
+distclean-local:
+ -test src/songs/songs.dtx -ef "${srcdir}/src/songs/songs.dtx" || rm -f src/songs/songs.dtx
+ -test sample/chordbook.tex -ef "${srcdir}/sample/chordbook.tex" || rm -f sample/chordbook.tex
+ -test sample/lyricbook.tex -ef "${srcdir}/sample/lyricbook.tex" || rm -f sample/lyricbook.tex
+ -test sample/slidebook.tex -ef "${srcdir}/sample/slidebook.tex" || rm -f sample/slidebook.tex
+ -test sample/transparencies.tex -ef "${srcdir}/sample/transparencies.tex" || rm -f sample/transparencies.tex
+ -test sample/songs.sbd -ef "${srcdir}/sample/songs.sbd" || rm -f sample/songs.sbd
+
diff --git a/Build/source/utils/songs/songs-2.17/NEWS b/Build/source/utils/songs/songs-2.17/NEWS
new file mode 100644
index 00000000000..84aa406d3fa
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/NEWS
@@ -0,0 +1,369 @@
+Songs LaTeX Package Revision History:
+
+Version 2.17 [2013/07/10]:
+
+ * Fixed a major error in the page-builder (introduced in v2.16 by the fix to \sclearpage) which caused the last page of many songs environments to be dropped. The fix required a significant overhaul of the page-building algorithm, so is given its own release.
+
+ * Fixed a returning bug that caused the first lines of numbered, centered verses to be slightly off-center.
+
+Version 2.16 [2013/07/02]:
+
+ * \pagepreludes now sets \songpos to 0, since otherwise songs could become separated from their preludes.
+
+ * Fixed a bug introduced in v2.15 that caused errors when a song title began with a multinational character encoded by the inputenc package.
+
+ * Fixed a bug introduced in v2.14 that broke the \authsepword, \authbyword, and \authignoreword macros (again).
+
+ * Fixed a bug that caused \sclearpage (and macros that call it) to sometimes output a blank page. The same bug also caused the \songpos algorithm to occasionally miss the best song placement.
+
+ * Added extra error-checking for macro name-clashes with other packages.
+
+Version 2.15 [2013/02/02]:
+
+ * New page format: In non-slides mode, activating \pagepreludes typesets each song on a fresh page with title spanning the entire page width, but with the rest of the song typeset in multiple columns below the title.
+
+ * New \songtarget and \songlink macros elaborate the nopdfindex option with finer control over PDF bookmark indexes and hyperlinks. The \ifpdfindex conditional has been retired.
+
+ * Some index-sorting problems related to the inputenc package have been resolved. (For even better sorting of international alphabets, use a LaTeX version with native Unicode support, such as XeTeX, instead of inputenc.)
+
+ * The author indexer now treats everything except spaces, commas, and semicolons not enclosed in braces as parts of words. This helps to support unusual band names that contain punctuation or numbers.
+
+ * Setting \idxheadwidth to 0pt now suppresses the letter divisions in large indexes entirely.
+
+ * Fixed a bug that caused the author indexer to recognize only the last \authignoreword.
+
+ * Fixed a bug in the title indexer that incorrectly indexed titles beginning with numbers.
+
+ * Updated the Unix installer to bring it into compliance with Gnu autoconf 2.69 standards. See the README file for new (easier) install instructions.
+
+Version 2.14 [2012/03/17]: Fourth CTAN Release
+
+ * Corrected a bug introduced in version 2.13 that broke \titleprefixword, \authsepword, \authbyword, and \authignoreword. (Turns out this fix contained another bug that left the last three of these macros unfixed until v2.16. See v2.16 notes above.)
+
+ * Corrected a bug that caused misformatted multiline index entries in single-column indexes.
+
+Version 2.13 [2011/08/08]:
+
+ * New \clineparams macro allows better customization of the vertical space between chords and lyrics.
+
+ * New \afterpreludeskip and \beforepostludeskip skip registers allow customization of the vertical space above and below song bodies.
+
+ * New \gtabtrans macro allows the user to customize what happens when a \gtab macro is supposed to be auto-transposed. (By default, the chord name is transposed and the tablature diagram is omitted.)
+
+ * Note name conversion is now applied by default to chord names in \gtab macros (even when there is no auto-transposition).
+
+ * New \notrans macro allows transposition to be suppressed within a chord name without suppressing note name conversion (via \notenamesin and \notenamesout).
+
+ * New \sepindexesfalse macro disables automatic page breaks at the end of indexes, and makes every index n-column (where n is specified in the optional argument to \showindex) instead of converting short indexes to centered, single-columns. This allows the user to put many small indexes on a single page if desired.
+
+ * Declaring a large number of song indexes no longer causes TeX to exceed the write-register limit.
+
+ * Fixed a bug that caused errors when certain fragile macros appeared in \songmark, \versemark, or \chorusmark definitions.
+
+ * Fixed a bug that erased numerators from meter bars that began the first lines of numbered verses.
+
+ * Fixed a bug that inadvertently swapped the meanings of \begin{verse} and \begin{verse*}.
+
+ * Windows installer now supports 64-bit MiKTeX installations.
+
+Version 2.12 [2011/01/09]:
+
+ * The argument to \beginscripture and the sr={} key of \beginsong now support multi-byte unicode input characters. Surrounding any text in these arguments with braces suppresses any reformatting that would otherwise be applied to that text.
+
+ * All macro pairs of the form \beginX...\endX now have an equivalent environment definition of the form \begin{X}...\end{X}. This fixes some compatibility problems with other packages.
+
+ * Fixed a bug that caused one-word author names to be preceded by a comma in the author index.
+
+Version 2.11 [2010/06/09]:
+
+ * New intersong environment typesets column-width or page-width displays between songs in a songs environment.
+
+ * New songgroup environment allows scripture quotations or other intersong displays to be included with a nearby song when using \includeonlysongs to generate a partial book.
+
+ * Tablature diagrams can now have any number of strings and from 1 to 9 rows of frets.
+
+ * Colors of textual notes, song number boxes, and index section boxes are now independently configurable by redefining \notebgcolor, \snumbgcolor, and \idxbgcolor.
+
+ * New \sclearpage and \scleardpage macros shift to the next blank page or the next even-numbered blank page, respectively.
+
+ * Songs environments and indexes are no longer followed by a forced \cleardoublepage. Documents can use \cleardoublepage explicitly if this behavior is desired.
+
+ * \includeonlysongs now works even when the page-builder is disabled.
+
+ * New "--locale" option for songidx and sbdchk overrides the environment default locale setting.
+
+ * Added extra grouping levels for verses, choruses, textual notes, and most other constructs to help users avoid color "bleeding" errors when using the color package.
+
+Version 2.10 [2010/01/01]:
+
+ * The size of accidentals (sharps and flats) is now relative to the current font size instead of being relative to the document default font size.
+
+ * New \sharpsymbol and \flatsymbol macros can be redefined to change the font symbols used for accidentals.
+
+ * Fixed a bug that forced single column mode whenever \songcols was used within a songs environment.
+
+ * Fixed a bug in which \songpos{1} caused empty pages to be inserted between some songs when used in one-sided documents.
+
+ * Fixed a bug that caused lines in numbered verses to be slightly off-center in slides mode.
+
+ * The current system locale setting is now consulted when alphabetizing song titles that contain non-English letters. Change the system locale before running songidx to alphabetize according to the conventions of another language.
+
+ * Some missing Vim icon files were re-included into the Unix distribution.
+
+Version 2.9 [2009/08/02]:
+
+ * Song numbering can now be disabled with \nosongnumbers.
+
+ * New \nolyrics macro puts chords on the baseline instead of raised, to better typeset instrumental solos and intros.
+
+ * \brk can be used between songs to force column breaks without introducing the extra vertical space that \nextcol puts at the bottom of the column.
+
+ * \begin...only and \begin...never family of macros have been made obsolete. Eliminate them from existing documents by replacing \beginXonly with \ifX, replace \beginXnever with \ifX\else, and replace both \endXonly and \endXnever with \fi.
+
+ * \colminheight (which could not be perfectly supported by LaTeX's page-breaking algorithm) has been eliminated in favor of \colbotglue and \lastcolglue.
+
+ * An external page-making package (e.g., multicol) can now be used in place of the songs-provided one by setting the number of columns to zero (with \songcolumns{0}).
+
+ * The song-positioning algorithm, which moves songs to fresh columns or pages to avoid column-breaks, page-breaks, and page-turns within songs, can now be tuned or disabled with \songpos.
+
+ * \interlinepenalty now controls the penalties inserted between consecutive lines of each verse and chorus.
+
+ * The rest of the penalty system has been recalibrated in accordance with the above changes. The \interlinepenalty now defaults to 1000 and \vvpenalty and friends now default to 200. \spenalty defaults to 100.
+
+ * Fixed a compatibility issue with Babel that caused \gtab to malfunction when French was the active language
+
+ * Fixed a bug that caused overthick division bars between songs when \sbarheight was set larger than 1pt
+
+ * Fixed a bug that caused the song-positioning algorithm to underestimate the size of songs containing auto-repeated choruses.
+
+ * Re-fixed a returning bug that caused spurious hyphenation when an \echo part ended with a chord longer than its lyric.
+
+Version 2.8 [2009/03/14]:
+
+ * \songnumstyle and \versenumstyle replaced with \thesongnum and \theversenum macros (for compatibility with standard LaTeX counters)
+
+ * \label's within a song or numbered verse can now be used to create automatic references to the song's or the verse's number.
+
+ * Using \showindex with \includeonlysongs now yields a partial index instead of a full index.
+
+ * New \indexsongsas macro can customize indexes to print page numbers instead of song numbers.
+
+ * Index fonts now customizable with \idxheadfont, \idxtitlefont, \idxlyricfont, \idxscripfont, \idxauthfont, and \idxrefsfont.
+
+ * Formatting of scripture index book names is now customizable with \idxbook.
+
+ * \showindex now takes an optional argument to specify the number of columns.
+
+ * Index typesetting logic improved to handle index entries whose left-hand-sides exceed the width of the column
+
+Version 2.7 [2009/01/08]: Third CTAN release
+
+ * Constructions like "\[A]\[B]\[C]lyric" now typeset the same as "\[A B C]lyric", but the chords in the sequence can be replayed separately (e.g., with "^^^lyric").
+
+ * Added support for begin- and end-repeat signs (\lrep and \rrep).
+
+ * Column and page breaks can now be inserted into partial song lists created with \includeonlysongs.
+
+ * Fixed a bug that caused sharp symbols to be doubled within echo parts on eTeX.
+
+Version 2.6 [2008/04/02]:
+
+ * \newchords and \replay macros added, optional argument added to \memorize
+
+ * new "Quick Chords" mode for Vim users to make chord-entry a snap
+
+ * Windows uninstaller reworked to avoid deleting files modified since installation
+
+ * Last pages of multicolumn indexes are now vertically balanced.
+
+ * Fixed a bug that occasionally produced empty pages when \topskip was non-zero
+
+ * Fixed a bug that produced duplicate verse numbers when the first line of a verse was contained in a group
+
+ * \echo macro no longer introduces a spurious line-break on eTeX.
+
+ * \DeclareLyricChar and friends now perform macro-tests based on macro name rather than macro definition.
+
+ * Extended mark register classes are now allocated safely so as to cooperate with other eTeX-aware packages.
+
+Version 2.5 [2008/02/08]:
+
+ * Unix version now uses the GNU automake system to configure and build itself
+
+ * Support for more than two columns added (use \songcolumns to set the number of columns).
+
+ * Chord replaying system now works properly in choruses.
+
+ * Added \stitlefont to allow users to customize the song title font without having to redefine \makeprelude.
+
+ * Added \baselineadj to allow users to customize the \baselineskip without having to redefine \everychorus and \everyverse.
+
+ * Superscript ("^") now works again in math mode even when chord replaying system is active. (It can therefore be used to typeset chord names if desired.)
+
+ * hyphchk utility renamed to sbdchk
+
+ * sbdchk utility updated to report column numbers in reports and error messages
+
+ * sbdchk and songidx sources updated to better adhere to GNU coding standards
+
+Version 2.4 [2007/10/09]: Second CTAN release
+
+ * Added \titleprefixword, \authsepword, \authbyword, \authignoreword, and \idxcont to support automatic index-generation for non-English languages.
+
+ * songidx program now supports piping to/from stdin/stdout (specify a filename of "-" to use this feature) and will infer an output filename when none is specified on the command line.
+
+ * Unix makefiles and Windows batch files for the sample books have been updated to allow users to add new indexes without changing any of the make/batch files.
+
+Version 2.3 [2007/09/23]:
+
+ * \indexentry and \indextitleentry now accept an optional argument specifying which indexes to add the new entry to (overriding the defaults for the current songs environment)
+
+ * \ch and \mch macros can now replay chords by using "^" as the chord name
+
+ * Renamed the .dat and .tex intermediate files produced during index generation to .sxd (Song indeX Data) and .sbx (Song Book indeX), respectively, to avoid conflicts with other software. Unix users can now write Makefiles that recognize these unique file extensions.
+
+Version 2.2 [2007/08/09]:
+
+ * The page-layout algorithm now honors \maxdepth, fixing a bug that occasionally produced overfilled vbox warnings during output.
+
+ * Fixed compiler warnings for systems that won't implicitly cast between integer and wide-characters.
+
+Version 2.1 [2007/08/02]:
+
+ * "Overheads" mode renamed to "slides" to reflect some substantial changes to that mode (see below).
+
+ * \sepverses can now be used in slides mode to put each verse and chorus on a separate slide. This seems to be the norm in churches that use a digital projector, since it allows worship leaders to repeat previous verses or choruses without having extraneous lyrics up on the screen.
+
+ * Choruses in slides mode are no longer surrounded by vertical rules, but are instead italicized by default. The rules looked nice, but they made it impossible to correctly break large choruses that couldn't fit on a single slide.
+
+ * To make echo parts stand out in italicized choruses, \echo now toggles between oblique and upright shapes (like \emph) instead of forcing the former.
+
+ * \repchoruses can now be used to repeat choruses automatically in songs that span more than one slide. This is very useful when creating foils for an overhead projector.
+
+ * \versemark and \chorusmark added to allow page headers that match the current verse or chorus rather than just the current song.
+
+ * \everyverse and \everychorus added so that users can make choruses begin with "Chorus:" and the like if they wish. (Personally I think that wastes too much space, but it's a common style.)
+
+ * \ifvnumbered conditional added to allow code that checks to see if the current verse is numbered or not.
+
+ * New \begin...only and \begin...never conditionals introduced that are just like \if... and \if...\else except that they avoid certain "runaway argument" errors raised by the latter.
+
+ * Added \versefont, \chorusfont, \versejustify, and \chorusjustify to allow users to customize font and/or justification of verses and choruses all independently. This reduces slides mode to a set of customizations that can all be manually duplicated (or undone) by the user.
+
+ * \baselineskip logic improved to better handle large fonts.
+
+ * Indexes now work properly when using \includeonlysongs to generate a partial list.
+
+ * \brk can now be used in vertical mode to suggest column- and page-breaks in verses and choruses that are too long to fit on a single slide.
+
+ * Added \DeclareNonLyric and \DeclareNoHyphen for better support of \inputenc.
+
+ * \tablature macro shortened to \gtab and with only two mandatory arguments instead of four.
+
+ * Automatic transposition now recognizes alternate note names, such as solfedge note names.
+
+Version 2.0 [2007/06/20]:
+
+ * Introduced keyval syntax for \beginsong.
+
+ * Added chord-replaying system (^, \memorize, \[^...]).
+
+ * Removed in-package code that loads hyperref. Users must now load hyperref manually.
+
+ * \songsection and \songchapter now support optional arguments like \section and \chapter do.
+
+ * Non-output-producing tokens (like \relax) can now appear between the last \Acolon or \Bcolon line and the \endscripture line without messing up the scripture citation that gets appended to the last line.
+
+ * Fewer macros are declared \outer, allowing authors to embed them within their own macro definitions.
+
+ * Lyric-scanner code is now faster.
+
+ * songidx was not recognizing apostrophes as intra-word characters.
+
+ * When a guitar tablature diagram with a fret number appeared above a lyric, subsequent chords that did not include tablature diagrams were being spaced incorrectly (as if they had invisible fret numbers).
+
+ * Fixed a bug that caused songs environments to occasionally generate pages slightly larger than \textheight.
+
+Version 1.22 [2007/05/15]: First CTAN release
+
+ * \chordson and \chordsoff modified to update interline spacing, so that they can now be used within a song.
+
+ * \MultiwordChords added to allow spaces to be included under chords.
+
+ * \DeclareLyricChar added to allow user-specified macros to be treated as lyric characters.
+
+ * Added support for UTF-8 encoded source files.
+
+Version 1.21 [2006/09/17]:
+
+ * Changed \rep so that it does not enter math mode when making the "times" symbol. (This helps quell missing font size warnings.)
+
+ * \echo now preserves existing font selection and merely italicizes it.
+
+Version 1.20 [2006/03/12]:
+
+ * Added \noversenumbers to turn off automatic verse numbering
+
+Version 1.19 [2005/10/24]:
+
+ * Added book sectioning commands (\songchapter and \songsection).
+
+ * Fixed song numbering so that it now starts at 1 by default in each song section.
+
+Version 1.18 [2005/09/29]:
+
+ * Automatic verse numbering added.
+
+Version 1.17 [2005/09/24]: First release as a style package instead of a class
+
+ * Code massively reorganized to function as a .sty package instead of a .cls class.
+
+ * Added \songmark so that users can add marks to affect page headers/footers
+
+Version 1.16 [2005/07/23]:
+
+ * First rollout of the new \[] syntax for producing chords. Lyrics are parsed as an implicit second argument.
+
+Version 1.15 [2005/05/26]:
+
+ * Added song title iterators: \songtitle, \songtitletoks, \nexttitle, \foreachtitle, \resettitles
+
+ * Added \makeprelude and \makepostlude to allow users to customize song headers/footers
+
+Version 1.14 [2005/05/15]:
+
+ * Introduced the scripture reference parser, to prevent odd linebreaks in scripture references.
+
+ * Choruses now stretch and shrink like verses do.
+
+Version 1.13 [2005/05/12]:
+
+ * Added kerning correction for double-quote ligatures in the Zaph Chancery font.
+
+ * Added \Acolon, \Bcolon, and \strophe for typesetting biblical poetry.
+
+ * Chords now preserve the \spacefactor so that subsequent text is spaced appropriately.
+
+Version 1.12 [2005/05/10]:
+
+ * Redid intra-song spacing and penalties to eliminate superfluous vbox items. Improved performance.
+
+ * Improved inter-song penalties for better page- and column-breaking.
+
+ * \parindent now controls the amount of indentation for wrapped lines within a song or scripture.
+
+ * Multiline textnotes now work right.
+
+ * Fixed chord macros to avoid introducing hyphenation when lyric ends in punctuation.
+
+Version 1.11 [2005/04/21]: Begin tracking revision history
+
+ * Renamed various macros to avoid naming clashes with other packages.
+
+ * Adjusted the \\ index-separator macro so that its scope is now limited to the indexes.
+
+Version 1.1 [2005/04/03]: First release as a .cls documentclass
+
+ * First release as a self-documenting .dtx file
+
+Version 1.0 [2001/12/01]: Initial release
diff --git a/Build/source/utils/songs/songs-2.17/README b/Build/source/utils/songs/songs-2.17/README
new file mode 100644
index 00000000000..049e7d0d591
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/README
@@ -0,0 +1,200 @@
+------------------------------------------------------------------------------
+ Songs LaTeX Package Documentation
+------------------------------------------------------------------------------
+
+Table Of Contents:
+ I. Overview
+ II. Copyright Notice
+ III. System Requirements
+ IV. Installation Instructions
+ V. Usage
+ A. LaTeX Package Style File and Documentation
+ B. Sample Song Books
+ C. Creating a New Song Book
+ D. Support Utilities (songidx and sbdchk)
+ VI. Removal / Reinstallation
+ VII. Help and Support
+
+
+I. Overview
+
+The Songs package is for producing songbooks containing lyrics and chords
+(but not sheet music). Each songs document can produce a lyric-only songbook
+for singers, a chorded songbook for musicians, a set of overhead
+transparencies, or a set of digital projector slides, all from a single master
+document. It can also automatically generate partial songbooks consisting of
+only some songs from the master document in a specified order. Facilities for
+automatic transposition and creation of guitar tablature diagrams are also
+included.
+
+
+II. Copyright Notice
+
+The songs LaTeX package is copyright (C) 2013 Kevin W. Hamlen.
+
+It is free software; you can redistribute it and/or modify it under the terms
+of the GNU General Public License as published by the Free Software Foundation;
+either version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
+Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+III. System Requirements
+
+In order to install and run this software, you will need:
+
+1. a C compiler (included on all Unix systems),
+2. a LaTeX2e installation (by default, the installation tries "pdflatex"),
+3. tar and gzip programs (to unpack the songs-x.xx.tar.gz file), and
+4. an installation of GNU Make (to run the Makefile).
+
+
+IV. Installation Instructions
+
+1. Unpack the songs-x.xx.tar.gz file (where x.xx is the version number).
+
+ tar -xzf songs-x.xx.tar.gz
+
+2. Change directory to the songs directory and run the configure script.
+
+ cd songs-x.xx
+ ./configure
+
+3. Run GNU Make (other versions of Make are not supported). To be sure that
+you are using GNU Make and not some other version of Make, use the "gmake"
+command:
+
+ gmake
+
+4. If you only intend to use the software by editing files within the
+songs-x.xx directory tree (i.e., a single-user installation), then you don't
+need to perform the following final step. However, to allow other users to
+access the software or to build song books yourself in other directories, you
+must next install the binary programs, LaTeX style files, index data files,
+and Vim support scripts in appropriate places on your system. To do so, make
+the "install" target and specify a directory prefix equal to a fresh sub-
+directory in your home directory:
+
+ gmake install prefix=~/mysongs
+
+This will create a ~/mysongs directory tree containing the files that need to
+be installed. Here is a summary of what it contains:
+
+ bin: Contains executable programs.
+ share/doc: Contains package documentation.
+ share/texmf: Contains the main LaTeX style file.
+ share/songs: Contains the *.can data files used by songidx when
+ generating scripture indexes.
+ share/vimfiles: Contains support scripts for Vim (optional).
+
+Each of these must be copied to an appropriate place on your system. For
+example, the following commands copy the files to appropriate places in a
+typical /usr/local tree:
+
+ cp ~/mysongs/bin/* /usr/local/bin
+ cp -r ~/mysongs/share/doc/songs /usr/local/share/doc
+ cp -r ~/mysongs/share/songs /usr/local/share
+ cp -r ~/mysongs/share/texmf/tex /usr/local/texmf
+ cp -r ~/mysongs/share/vimfiles/* /usr/local/share/vim/vimfiles
+
+Alternatively, the following copies them to appropriate places in a typical
+single-user home directory structure:
+
+ cp ~/mysongs/bin/* ~/bin
+ cp -r ~/mysongs/share/doc/songs ~/doc
+ cp -r ~/mysongs/share/songs ~/data
+ cp -r ~/mysongs/share/texmf/tex ~/localtexmf
+ cp -r ~/mysongs/share/vimfiles/* ~/.vim
+
+Note: After copying new files into the texmf tree, many LaTeX distributions
+require you to execute the texhash command to update LaTeX's file name
+database. Be sure to do so if your version of LaTeX requires it:
+
+ texhash
+
+
+V. Usage
+
+After running "gmake" from the songs-x.xx directory (step 3 above) you should
+find the following file clusters:
+
+A. LaTeX Package Style File and Documentation
+
+In songs/src/songs you will find:
+* src/songs/songs.sty: If you don't use "gmake install" to install this LaTeX
+ style file in the system's TeX repository tree, then songs.sty must be copied
+ into each directory that has a .tex file that uses the songs package. (This
+ is done automatically by the makefile that generates the sample book, so if
+ you reuse that makefile as recommended in part C below, you don't need to
+ copy it manually.)
+* src/songs/songs.pdf: Comprehensive documentation of the songs package.
+
+B. Sample Song Books
+
+The GNUmakefile in songs/sample generates the sample song books. There are
+four books in total:
+
+* sample/chordbook.pdf: a chord book for musicians,
+* sample/lyricbook.pdf: a lyric book for singers,
+* sample/slidebook.pdf: a book of slides for use with a digital projector, and
+* sample/transparencies.pdf: book of transparencies for an overhead projector
+
+All four books draw upon the song data contained in the file songs.sbd. By
+modifying that file, you can change the content of all four books. To change
+the formatting style of any particular book, change the corresponding
+sample/*.tex file.
+
+C. Creating a New Song Book
+
+You can create a new song book directory by copying the sample directory and
+its contents to a new subdirectory:
+
+ cp -r sample mybook
+ cd mybook
+ gmake clean
+ gmake
+
+If you have used "gmake install" to install the software (see Section III.4)
+then your new "mybook" directory can be located anywhere; otherwise it must be
+in the songs-x.xx directory.
+
+D. Support Utilities (songidx and sbdchk)
+
+* songs/src/songidx/songidx: This program is required for auto-generating song
+ book indexes. The GNUmakefile in songs/sample invokes it automatically as
+ necessary.
+* songs/src/sbdchk/sbdchk: The sbdchk program is a utility that proofs .sbd
+ files for chord placement errors. Chords are misplaced if they fall at an
+ invalid hyphenation point or they break a ligature. To use sbdchk with the
+ sample song books, change to the songs/sample directory and type
+
+ gmake sbdcheck
+
+ This will generate a report file named songs.hyp in the current directory.
+
+
+VI. Removal / Reinstallation
+
+To reverse the behavior of "make install", type:
+
+ gmake uninstall
+
+To merely delete all generated files within the songs directory (without
+deleting the non-generated files), type:
+
+ gmake clean
+
+
+VII. Support and Bug Reporting
+
+For the most current version of this software as well as author contact
+information, see the songs project homepage at:
+
+ http://songs.sourceforge.net
+
diff --git a/Build/source/utils/songs/songs-2.17/acinclude.m4 b/Build/source/utils/songs/songs-2.17/acinclude.m4
new file mode 100644
index 00000000000..9667c922c0a
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/acinclude.m4
@@ -0,0 +1,8 @@
+m4_include([./m4/ac_prog_latex.m4])
+m4_include([./m4/ac_prog_pdflatex.m4])
+m4_include([./m4/ac_prog_dvips.m4])
+m4_include([./m4/ac_prog_makeindex.m4])
+m4_include([./m4/ac_prog_texhash.m4])
+m4_include([./m4/ac_prog_kpsewhich.m4])
+m4_include([./m4/ac_prog_vim.m4])
+
diff --git a/Build/source/utils/songs/songs-2.17/configure.ac b/Build/source/utils/songs/songs-2.17/configure.ac
new file mode 100644
index 00000000000..43d9bd16111
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/configure.ac
@@ -0,0 +1,85 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+
+AC_PREREQ(2.69)
+AC_INIT(songs,2.17)
+AM_INIT_AUTOMAKE([-Wno-portability])
+AC_CONFIG_SRCDIR([src/songs/songs.dtx])
+AC_CONFIG_HEADER([src/config.h])
+AC_ARG_VAR([texmfdir], [Root texmf tree where new packages are installed.
+ [DATADIR/texmf]])
+AS_IF([test "x$texmfdir" = x], [texmfdir="${datadir}/texmf"])
+AC_ARG_VAR([candir], [Where .can data files (used by songidx) are installed.
+ [DATADIR/songs]])
+AS_IF([test "x$candir" = x], [candir="${datadir}/songs"])
+AC_ARG_VAR([vimfilesdir], [Prefix for installing Vim support scripts.
+ [DATADIR/vimfiles]])
+AS_IF([test "x$vimfilesdir" = x], [vimfilesdir="${datadir}/vimfiles"])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_MKDIR_P
+AC_PROG_LATEX
+AC_PROG_PDFLATEX
+AC_PROG_MAKEINDEX
+AC_PROG_DVIPS
+AC_PROG_TEXHASH
+AC_PROG_KPSEWHICH
+AC_CHECK_HEADERS([locale.h stdlib.h stdio.h string.h wchar.h wctype.h])
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([setlocale strrchr])
+AC_CHECK_TYPES([wchar_t], , ,[
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#if HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+])
+AH_TOP([
+#ifndef CONFIG_H
+#define CONFIG_H
+])
+AH_BOTTOM([#endif])
+AC_CONFIG_FILES([
+ Makefile
+ src/songs/GNUmakefile
+ src/songidx/Makefile
+ sample/GNUmakefile
+ src/sbdchk/Makefile
+ src/vim/Makefile
+])
+define([COPY1],[AC_CONFIG_COMMANDS([$1],AS_IF([test "$srcdir/$1" -ef "$1"],,[cp "$srcdir/$1" "$1"]))])
+define([COPY],[m4_foreach_w([f],$1,[COPY1(f)])])
+COPY([
+ src/songs/songs.dtx
+ sample/chordbook.tex
+ sample/lyricbook.tex
+ sample/slidebook.tex
+ sample/transparencies.tex
+ sample/songs.sbd
+])
+AC_OUTPUT
+
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_dvips.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_dvips.m4
new file mode 100644
index 00000000000..309f3dfc371
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_dvips.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_DVIPS
+#
+# Test for dvips
+# and set $dvips to the correct value.
+#
+#
+dnl @synopsis AC_PROG_DVIPS
+dnl
+dnl This macro test if dvips is installed. If dvips
+dnl is installed, it set $dvips to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_DVIPS],[
+AC_CHECK_PROGS(dvips,dvips,no)
+export dvips;
+if test $dvips = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a dvips application]);
+fi;
+AC_SUBST(dvips)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_kpsewhich.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_kpsewhich.m4
new file mode 100644
index 00000000000..b2c2bdce497
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_kpsewhich.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_KPSEWHICH
+#
+# Test for kpsewhich
+# and set $kpsewhich to the correct value.
+#
+#
+dnl @synopsis AC_PROG_KPSEWHICH
+dnl
+dnl This macro test if kpsewhich is installed. If kpsewhich
+dnl is installed, it set $kpsewhich to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_KPSEWHICH],[
+AC_CHECK_PROGS(kpsewhich,[kpsewhich],no)
+export kpsewhich;
+if test $kpsewhich = "no" ;
+then
+ AC_MSG_ERROR([Unable to find the kpsewhich application]);
+fi
+AC_SUBST(kpsewhich)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_latex.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_latex.m4
new file mode 100644
index 00000000000..7204471da1e
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_latex.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_LATEX
+#
+# Test for latex or elatax or lambda
+# and set $latex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX
+dnl
+dnl This macro test if latex is installed. If latex
+dnl is installed, it set $latex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_LATEX],[
+AC_CHECK_PROGS(latex,[latex elatex lambda],no)
+export latex;
+if test $latex = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a LaTeX application]);
+fi
+AC_SUBST(latex)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_makeindex.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_makeindex.m4
new file mode 100644
index 00000000000..90d884a66d4
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_makeindex.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_MAKEINDEX
+#
+# Test for makeindex
+# and set $makeindex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_MAKEINDEX
+dnl
+dnl This macro test if makeindex is installed. If makeindex
+dnl is installed, it set $makeindex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_MAKEINDEX],[
+AC_CHECK_PROGS(makeindex,makeindex,no)
+export makeindex;
+if test $makeindex = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a MakeIndex application]);
+fi
+AC_SUBST(makeindex)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_pdflatex.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_pdflatex.m4
new file mode 100644
index 00000000000..2b839a14a8e
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_pdflatex.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_PDFLATEX
+#
+# Test for pdflatex
+# and set $pdflatex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PDFLATEX
+dnl
+dnl This macro test if pdflatex is installed. If pdflatex
+dnl is installed, it set $pdflatex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_PDFLATEX],[
+AC_CHECK_PROGS(pdflatex,[pdflatex],no)
+export pdflatex;
+if test $pdflatex = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a PDFLaTeX application]);
+fi
+AC_SUBST(pdflatex)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_texhash.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_texhash.m4
new file mode 100644
index 00000000000..12c8926da35
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_texhash.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_TEXHASH
+#
+# Test for texhash
+# and set $texhash to the correct value.
+#
+#
+dnl @synopsis AC_PROG_TEXHASH
+dnl
+dnl This macro test if texhash is installed. If texhash
+dnl is installed, it set $texhash to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti@eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_TEXHASH],[
+AC_CHECK_PROGS(texhash,[texhash],no)
+export texhash;
+if test $texhash = "no" ;
+then
+ AC_MSG_ERROR([Unable to find the texhash application]);
+fi
+AC_SUBST(texhash)
+])
diff --git a/Build/source/utils/songs/songs-2.17/m4/ac_prog_vim.m4 b/Build/source/utils/songs/songs-2.17/m4/ac_prog_vim.m4
new file mode 100644
index 00000000000..7d31acb63e7
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/m4/ac_prog_vim.m4
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_VIM
+#
+# Test for vim and set $vim to the correct value.
+#
+#
+dnl @synopsis AC_PROG_VIM
+dnl
+dnl This macro tests if vim is installed. If vim
+dnl is installed, it sets $vim to the right value
+dnl
+dnl @version 1.0
+dnl @author Kevin W. Hamlen
+dnl
+AC_DEFUN([AC_PROG_VIM],[
+AC_CHECK_PROG(vim,[vim],vim)
+export $vim;
+])
diff --git a/Build/source/utils/songs/songs-2.17/src/config.h.in b/Build/source/utils/songs/songs-2.17/src/config.h.in
new file mode 100644
index 00000000000..5d0b40d5a0e
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/config.h.in
@@ -0,0 +1,96 @@
+/* src/config.h.in. Generated from configure.ac by autoheader. */
+
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+ and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+#endif
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/Makefile.am b/Build/source/utils/songs/songs-2.17/src/songidx/Makefile.am
new file mode 100644
index 00000000000..a299546fd7f
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/Makefile.am
@@ -0,0 +1,5 @@
+bin_PROGRAMS = songidx
+songidx_SOURCES = authidx.c fileio.c scripidx.c songidx.c songsort.c titleidx.c chars.h fileio.h songidx.h
+dist_pkgdata_DATA = bible.can catholic.can greek.can protestant.can tanakh.can
+songidx_CPPFLAGS = -I ..
+
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/authidx.c b/Build/source/utils/songs/songs-2.17/src/songidx/authidx.c
new file mode 100644
index 00000000000..be631b26233
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/authidx.c
@@ -0,0 +1,494 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+
+/* Create a LaTeX author index file from an author .dat file. */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+#if HAVE_STRING_H
+# include <string.h>
+#elif HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+/* Word-separators are spaces. */
+#define auth_wsep(x) wc_isspace((x))
+
+/* Entry-separators are commas or semicolons. */
+#define auth_esep(x) (((x)==wc_comma) || ((x)==wc_semicolon))
+
+/* Everything else is considered part of a word---it is not dropped when
+ * migrating author text to the author index. */
+#define auth_sep(x) (auth_wsep(x) || auth_esep(x))
+
+typedef struct wordlist
+{
+ struct wordlist *next;
+ WCHAR *w;
+}
+WORDLIST;
+
+WORDLIST wl_and = { NULL, ws_lit("and") };
+WORDLIST wl_by = { NULL, ws_lit("by") };
+WORDLIST wl_unknown = { NULL, ws_lit("unknown") };
+
+/* wl_insert(<wordlist>,<word>)
+ * Insert a word onto the head of a wordlist. */
+static void
+wl_insert(wl,w)
+ WORDLIST **wl;
+ const WCHAR *w;
+{
+ WORDLIST *head = (WORDLIST *) malloc(sizeof(WORDLIST));
+ head->next = ((*wl==&wl_and) || (*wl==&wl_by) || (*wl==&wl_unknown)) ?
+ NULL : *wl;
+ head->w = (WCHAR *) calloc(ws_strlen(w)+1, sizeof(WCHAR));
+ ws_strcpy(head->w, w);
+ *wl = head;
+}
+
+/* matchany(<string>,<wordlist>)
+ * If a word in <wordlist> case-insensitively matches to a prefix of <string>,
+ * and if the match concludes with whitespace, then return the length of the
+ * match plus 1. Otherwise return 0.
+ */
+static size_t
+matchany(s,wl)
+ const WCHAR *s;
+ WORDLIST *wl;
+{
+ const WCHAR *s2, *w2;
+
+ for (; wl; wl=wl->next)
+ {
+ for (s2=s, w2=wl->w; *w2; ++s2, ++w2)
+ if (wc_tolower(*s2)!=wc_tolower(*w2)) break;
+ if ((*w2 == wc_null) && auth_wsep(*s2)) return s2-s+1;
+ }
+ return 0;
+}
+
+/* matchwithin(<string>,<wordlist>)
+ * Return 1 if any word in <wordlist> appears in <string> (case insensitive
+ * match). */
+static char
+matchwithin(s,wl)
+ const WCHAR *s;
+ WORDLIST *wl;
+{
+ const WCHAR *s2, *w2;
+ WORDLIST *wl2;
+ int spc;
+
+ spc = 1;
+ while (*s!=wc_null)
+ {
+ if (spc)
+ {
+ for (wl2=wl; wl2; wl2=wl2->next)
+ {
+ for (s2=s, w2=wl->w; *w2!=wc_null; ++s2, ++w2)
+ if (wc_tolower(*s2)!=wc_tolower(*w2)) break;
+ if ((*w2==wc_null) && ((*s2==wc_null) || auth_sep(*s2))) return 1;
+ }
+ }
+ spc = auth_wsep(*s);
+ s2 = s;
+ skipesc(&s,1,0);
+ if (s==s2) ++s;
+ }
+ return 0;
+}
+
+/* issuffix(<string>)
+ * Return 1 if <string> points to the name suffix "Jr" or a roman numeral
+ * consisting solely of I's, V's, and/or X's. Return 0 otherwise. */
+static int
+issuffix(s)
+ const WCHAR *s;
+{
+ WCHAR buf[3];
+ size_t n;
+
+ n = ws_strspn(s, ws_lit("IVX"));
+ if (n>0)
+ s += n;
+ else if ((*s==wc_null) || (*(s+1)==wc_null))
+ return 0;
+ else
+ {
+ buf[0] = *s++;
+ buf[1] = *s++;
+ buf[2] = wc_null;
+ if (ws_coll(buf, ws_lit("Jr"))) return 0;
+ }
+ return (auth_sep(*s) || (*s==wc_period) || (*s==wc_null));
+}
+
+/* grabauthor(<string>,<seplist>,<afterlist>,<ignorelist>)
+ * Return a string of the form "Sirname, Restofname" denoting the full name
+ * of the first author found in <string>; or return NULL if no author name
+ * can be found. Set <string> to point to the suffix of <string> that was
+ * not parsed. The string returned (if any) is static, so successive calls
+ * will overwrite it.
+ *
+ * Heuristics:
+ * * Names are separated by punctuation (other than hyphens, periods,
+ * apostrophes, or backslashes) or by the word "and" (or whatever words
+ * are in seplist).
+ * Special case: If a comma is followed by the abbreviation "Jr" or by a
+ * roman numeral, then the comma does NOT end the author's name.
+ * * If a name contains the word "by" (or anything in afterlist), then
+ * everything before it is not considered part of the name. (Let's hope
+ * nobody is named "By".)
+ * * The author's last name is always the last capitalized word in the
+ * name unless the last capitalized word is "Jr." or a roman numeral.
+ * In that case the author's last name is the second-last capitalized
+ * word.
+ * * If an author appears to have only a first name, or if the last name
+ * found according to the above heuristics is an abbreviation (ending in
+ * a period), look ahead in <string> until we find someone with a last
+ * name and use that one. This allows us to identify the first author in
+ * a string like "Joe, Billy E., and Bob Smith" to be "Joe Smith".
+ * * If the resultant name contains the word "unknown" (or any word in
+ * unknownlist), it's probably not a real name. Recursively attempt to
+ * parse the next author. */
+static WCHAR *
+grabauthor(authline,seplist,afterlist,unknownlist)
+ const WCHAR **authline;
+ WORDLIST *seplist;
+ WORDLIST *afterlist;
+ WORDLIST *unknownlist;
+{
+ static WCHAR buf[MAXLINELEN+2], *bp;
+ const WCHAR *first, *last, *suffix, *next, *scanahead, *endp;
+ size_t len;
+
+ /* Point "first" to the first character of the name, "last" to the first
+ * character of the sirname, "suffix" to any suffix like "Jr." or "III"
+ * (or NULL if there is none), and "next" to the first character beyond the
+ * end of the name. */
+ if (!authline) return NULL;
+ for (first=*authline; (*first!=wc_null) && auth_sep(*first); ++first) ;
+ if (((len = matchany(first,seplist)) > 0) ||
+ ((len = matchany(first,afterlist)) > 0))
+ first += len;
+ if (*first==wc_null) return NULL;
+ last=suffix=NULL;
+ for (next=first; *next; ++next)
+ {
+ skipesc(&next,0,1);
+ if (*next==wc_comma)
+ {
+ for (scanahead = next+1; auth_wsep(*scanahead); ++scanahead) ;
+ if (issuffix(scanahead)) continue;
+ *authline = next+1;
+ break;
+ }
+ else if (*next==wc_semicolon)
+ {
+ *authline = next+1;
+ break;
+ }
+ if (auth_wsep(*next))
+ {
+ for (++next; auth_wsep(*next); ++next) ;
+ if ((len = matchany(next,seplist)) > 0)
+ {
+ *authline=next+len;
+ break;
+ }
+ if ((len = matchany(next,afterlist)) > 0)
+ {
+ first = next+len;
+ next += len-1;
+ last = suffix = NULL;
+ continue;
+ }
+ if (issuffix(next))
+ suffix=next;
+ else
+ {
+ scanahead = next;
+ skipesc(&scanahead,0,0);
+ if (wc_isupper(*scanahead))
+ {
+ last = next;
+ suffix = NULL;
+ }
+ }
+ --next;
+ }
+ }
+ if (*next==wc_null) *authline = next;
+
+ /* Put the sirname into the buffer first. */
+ endp = NULL;
+ if (last)
+ {
+ endp = (suffix ? suffix : next)-1;
+ if (endp<last) abort();
+ for (; (endp>last) && auth_sep(*endp); --endp) ;
+ }
+ if (!endp || (*endp==wc_period))
+ {
+ /* Here's where it gets tough. We either have a single-word name, or the
+ * last name ends in a "." which means maybe it's just a middle initial or
+ * other abbreviation. We could be dealing with a line like, "Billy,
+ * Joe E., and Bob Smith", in which case we have to go searching for the
+ * real last name. To handle this case, we will try a recursive call. */
+ scanahead = *authline;
+ if (grabauthor(&scanahead,seplist,afterlist,unknownlist) &&
+ ((bp = ws_strchr(buf, wc_comma)) != NULL))
+ /* got it! Make our old last name part of the first name. */
+ last = NULL;
+ else if (last)
+ {
+ /* Couldn't find a last name. Just use this one and hope it's okay. */
+ ws_strncpy(buf, last, endp-last+1);
+ bp = buf+(endp-last+1);
+ }
+ else
+ bp = buf;
+ }
+ else
+ {
+ ws_strncpy(buf, last, endp-last+1);
+ bp = buf+(endp-last+1);
+ }
+
+ /* Next, put the first name into the buffer. */
+ endp = (last ? last : (suffix ? suffix : next))-1;
+ if (endp<first) abort();
+ for (; (endp>=first) && auth_sep(*endp); --endp) ;
+ ++endp;
+ if (endp>first)
+ {
+ if (bp > buf)
+ {
+ *bp++ = wc_comma;
+ *bp++ = wc_space;
+ }
+ ws_strncpy(bp, first, endp-first);
+ bp += endp-first;
+ }
+
+ /* Finally, put the suffix (if any) into the buffer. */
+ if (suffix)
+ {
+ for (endp=next-1; (endp>=suffix) && auth_sep(*endp); --endp) ;
+ ++endp;
+ if (endp>suffix)
+ {
+ if (bp > buf) *bp++ = wc_space;
+ ws_strncpy(bp, suffix, endp-suffix);
+ bp += endp-suffix;
+ }
+ }
+
+ *bp = wc_null;
+ if (matchwithin(buf, unknownlist))
+ return grabauthor(authline,seplist,afterlist,unknownlist);
+ return buf;
+}
+
+/* genauthorindex(<file>,<inname>,<outname>)
+ * Read author data from file handle <file> and generate from it a LaTeX
+ * author index file named <outname>.
+ * Return 0 on success, 1 on warnings, or 2 on error. */
+int
+genauthorindex(fs,outname)
+ FSTATE *fs;
+ const char *outname;
+{
+ FILE *f;
+ int eof = 0;
+ int arraysize, numauthors, i;
+ WORDLIST *seplist=&wl_and, *afterlist=&wl_by, *ignorelist=&wl_unknown;
+ SONGENTRY **authors;
+ WCHAR authorbuf[MAXLINELEN];
+ WCHAR songnumbuf[MAXLINELEN], linknamebuf[MAXLINELEN];
+ WCHAR *thisnum, *thislink;
+ const WCHAR *auth, *bp;
+
+ fprintf(stderr, "songidx: Parsing author index data file %s...\n",
+ fs->filename);
+
+ eof = 0;
+ authors = NULL;
+ for (arraysize=numauthors=i=0; !eof; ++i)
+ {
+ if (!filereadln(fs,authorbuf,&eof)) return 2;
+ if (eof) break;
+ if (authorbuf[0] == wc_percent)
+ {
+ if (!ws_strncmp(authorbuf, ws_lit("%sep "), 5))
+ wl_insert(&seplist, authorbuf + 5);
+ else if (!ws_strncmp(authorbuf, ws_lit("%after "), 7))
+ wl_insert(&afterlist, authorbuf + 7);
+ else if (!ws_strncmp(authorbuf, ws_lit("%ignore "), 8))
+ wl_insert(&ignorelist, authorbuf + 8);
+ --i;
+ continue;
+ }
+ if (!filereadln(fs,songnumbuf,&eof))
+ {
+ fileclose(fs);
+ return 2;
+ }
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete author entry"
+ " (orphan byline)\n", fs->filename, fs->lineno);
+ fileclose(fs);
+ return 2;
+ }
+ if (!filereadln(fs,linknamebuf,&eof))
+ {
+ fileclose(fs);
+ return 2;
+ }
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete author entry"
+ " (missing hyperlink)\n", fs->filename, fs->lineno);
+ fileclose(fs);
+ return 2;
+ }
+ if (((thisnum = (WCHAR *) calloc(ws_strlen(songnumbuf)+1,
+ sizeof(WCHAR))) == NULL) ||
+ ((thislink = (WCHAR *) calloc(ws_strlen(linknamebuf)+1,
+ sizeof(WCHAR))) == NULL))
+ {
+ fprintf(stderr, "songidx:%s:%d: song number/link too long"
+ " (out of memory)\n", fs->filename, fs->lineno);
+ return 2;
+ }
+ ws_strcpy(thisnum, songnumbuf);
+ ws_strcpy(thislink, linknamebuf);
+
+ for (bp=authorbuf;
+ (auth=grabauthor(&bp, seplist, afterlist,
+ ignorelist)) != NULL;
+ ++numauthors)
+ {
+ if (numauthors >= arraysize)
+ {
+ SONGENTRY **temp;
+ arraysize *= 2;
+ if (arraysize==0) arraysize=64;
+ temp = (SONGENTRY **) realloc(authors,arraysize*sizeof(SONGENTRY *));
+ if (!temp)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many song authors"
+ " (out of memory)\n", fs->filename, fs->lineno);
+ return 2;
+ }
+ authors = temp;
+ }
+ if ((authors[numauthors] = (SONGENTRY *)
+ malloc(sizeof(SONGENTRY))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many song authors"
+ " (out of memory)\n", fs->filename, fs->lineno);
+ return 2;
+ }
+ if ((authors[numauthors]->title =
+ (WCHAR *) calloc(ws_strlen(auth)+1, sizeof(WCHAR))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: author name too long (out of memory)\n",
+ fs->filename, fs->lineno);
+ return 2;
+ }
+ ws_strcpy(authors[numauthors]->title, auth);
+ authors[numauthors]->num = thisnum;
+ authors[numauthors]->linkname = thislink;
+ authors[numauthors]->idx = i;
+ }
+ }
+ fileclose(fs);
+
+ /* Sort the array by author. */
+ qsort(authors, numauthors, sizeof(*authors), songcmp);
+
+ /* Generate an author index LaTeX file from the sorted data.
+ * Combine any entries with the same author name into a single index entry. */
+ fprintf(stderr, "songidx: Generating author index TeX file %s...\n", outname);
+ if (strcmp(outname,"-"))
+ {
+ if ((f = fopen(outname, "w")) == NULL)
+ {
+ fprintf(stderr, "songidx: Unable to open %s for writing.\n", outname);
+ return 2;
+ }
+ }
+ else
+ {
+ f = stdout;
+ outname = "stdout";
+ }
+
+#define TRYWRITE(x) \
+ if (!(x)) \
+ { \
+ fprintf(stderr, "songidx:%s: write error\n", outname); \
+ if (f == stdout) fflush(f); else fclose(f); \
+ return 2; \
+ }
+
+ TRYWRITE(ws_fputs(ws_lit("\\begin{idxblock}{"), f) >= 0)
+ for (i=0; i<numauthors; ++i)
+ {
+ if ((i>0) && !ws_coll(authors[i]->title, authors[i-1]->title))
+ {
+ TRYWRITE(ws_fputs(ws_lit("\\\\"), f) >= 0)
+ }
+ else
+ {
+ TRYWRITE((ws_fputs(ws_lit("}\n\\idxentry{"), f) >= 0) &&
+ (ws_fputs(authors[i]->title, f) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0))
+ }
+ TRYWRITE((ws_fputs(ws_lit("\\songlink{"), f) >= 0) &&
+ (ws_fputs(authors[i]->linkname, f) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (ws_fputs(authors[i]->num, f) >= 0) &&
+ (ws_fputs(ws_lit("}"), f) >= 0))
+ }
+ TRYWRITE(ws_fputs(ws_lit("}\n\\end{idxblock}\n"), f) >= 0)
+
+#undef TRYWRITE
+
+ if (f == stdout)
+ fflush(f);
+ else
+ fclose(f);
+ return 0;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/bible.can b/Build/source/utils/songs/songs-2.17/src/songidx/bible.can
new file mode 100644
index 00000000000..1c92a88e206
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/bible.can
@@ -0,0 +1,200 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+#
+#
+# Filename: bible.can
+# Last modified: 2006/06/12
+#
+# The following Canon data file describes a composite of the Protestant,
+# Catholic, and Greek Orthodox Christian bibles. All books of all bibles
+# are represented. Where two bibles have a different number of chapters
+# or a different number of verses, the larger is used. The result is a
+# Canon file that should be adequate to generate scripture indexes for
+# songs referencing any of these biblical canons.
+#
+# File Format: In what follows, each book of the bible is represented by a
+# pair of lines: the first line lists the book title(s), and the second lists
+# the number of verses in each of the book's chapters. The first line may
+# list more than one title, separated by | characters. The first title listed
+# is the one used to generate the scripture index. The other titles, if any,
+# are recognized as aliases when they appear in "sr=" keyvals in the
+# \beginsong macro. Any of the titles may contain arbitrary LaTeX macros.
+# The order that books appear in this file dictates the order that they appear
+# when sorting the scripture index.
+Genesis
+031 025 024 026 032 022 024 022 029 032 032 020 018 024 021 016 027 033 038 018 034 024 020 067 034 035 046 022 035 043 055 032 020 031 029 043 036 030 023 023 057 038 034 034 028 034 031 022 033 026
+Exodus
+022 025 022 031 023 030 025 032 035 029 010 051 022 031 027 036 016 027 025 026 036 031 033 018 040 037 021 043 046 038 018 035 023 035 035 038 029 031 043 038
+Leviticus
+017 016 017 035 019 030 038 036 024 020 047 008 059 057 033 034 016 030 037 027 024 033 044 023 055 046 034
+Numbers
+054 034 051 049 031 027 089 026 023 036 035 016 033 045 041 050 013 032 022 029 035 041 030 025 018 065 023 031 040 016 054 042 056 029 034 013
+Deuteronomy
+046 037 029 049 033 025 026 020 029 022 032 032 018 029 023 022 020 022 021 020 023 030 025 022 019 019 026 068 029 020 030 052 029 012
+Joshua
+018 024 017 024 015 027 026 035 027 043 023 024 033 015 063 010 018 028 051 009 045 034 016 033
+Judges
+036 023 031 024 031 040 025 035 057 018 040 015 025 020 020 031 013 031 030 048 025
+Ruth
+022 023 018 022
+1 Samuel|1 Kingdoms
+028 036 021 022 012 021 017 022 027 027 015 025 023 052 035 023 058 030 024 042 015 023 029 022 044 025 012 025 011 031 013
+2 Samuel|2 Kingdoms
+027 032 039 012 025 023 029 018 013 019 027 031 039 033 037 023 029 033 043 026 022 051 039 025
+1 Kings|3 Kingdoms
+053 046 028 034 018 038 051 066 028 029 043 033 034 031 034 034 024 046 021 043 029 053
+2 Kings|4 Kingdoms
+018 025 027 044 027 033 020 029 037 036 021 021 025 029 038 020 041 037 037 021 026 020 037 020 030
+1 Chronicles
+054 055 024 043 026 081 040 040 044 014 047 040 014 017 029 043 027 017 019 008 030 019 032 031 031 032 034 021 030
+2 Chronicles
+017 018 017 022 014 042 022 018 031 019 023 016 022 015 019 014 019 034 011 037 020 012 021 027 028 023 009 027 036 027 021 033 025 033 027 023
+1 Esdras
+058 030 024 063 073 034 015 096 055
+2 Esdras
+011 070 013 024 017 022 028 036 015 044 011 020 032 023 019 019 073 018 038 039 036 047 031
+Ezra
+011 070 013 024 017 022 028 036 015 044
+Nehemiah
+011 020 032 023 019 019 073 018 038 039 036 047 031
+Tobit|Tobias
+025 023 025 023 028 022 020 024 012 013 021 022 023 017
+Judith
+012 018 015 016 029 021 025 034 019 020 021 020 031 018 015 031
+Esther
+022 023 015 017 014 014 010 017 032 013 012 006 018 019 019 024
+1 Macabees|1 Maccabees
+067 070 060 061 068 063 050 032 073 089 074 054 054 049 041 024
+2 Macabees|2 Maccabees
+036 033 040 050 027 031 042 036 029 038 038 046 026 046 040
+3 Macabees|3 Maccabees
+029 033 030 021 051 041 023
+4 Macabees|4 Maccabees
+035 024 021 026 038 035 023 028 032 021 027 019 027 020 032 025 024 024
+Job
+022 013 026 021 027 030 021 022 035 022 020 025 028 022 035 022 016 021 029 029 034 030 017 025 006 014 023 028 025 031 040 022 033 037 016 033 024 041 030 024 034 017
+Psalms|Psalm
+006 012 008 008 012 010 017 009 020 018 007 008 006 007 005 011 015 050 014 009 013 031 006 010 022 012 014 009 011 012 024 011 022 022 028 012 040 022 013 017 013 011 005 026 017 011 009 014 020 023 019 009 006 007 023 013 011 011 017 012 008 012 011 010 013 020 007 035 036 005 024 020 028 023 010 012 020 072 013 019 016 008 018 012 013 017 007 018 052 017 016 015 005 023 011 013 012 009 009 005 008 028 022 035 045 048 043 013 031 007 010 010 009 008 018 019 002 029 176 007 008 009 004 008 005 006 005 006 008 008 003 018 003 003 021 026 009 008 024 013 010 007 012 015 021 010 020 014 009 006 007
+Odes
+019 043 010 018 012 008 020 037 034 009 010 015 004 046
+Proverbs
+033 022 035 027 023 035 027 036 018 032 031 028 025 035 033 033 028 024 029 030 031 029 035 034 028 028 027 028 027 033 031
+Ecclesiastes
+018 026 022 016 020 012 029 017 018 020 010 014
+Song of Songs|Song of Solomon
+017 017 011 016 016 013 013 014
+Wisdom|Wisdom of Solomon
+016 025 019 020 024 027 030 021 019 021 027 027 019 031 019 029 020 025 020
+Sirach|Ecclesiasticus
+040 023 034 036 018 037 040 022 025 034 036 019 032 027 022 031 031 033 028 033 031 033 038 047 036 028 033 030 034 027 042 028 033 031 026 028 034 039 041 032 028 026 037 027 031 023 031 028 019 031 038
+Psalms of Solomon|Psalm of Solomon
+008 037 012 025 019 006 010 034 011 008 009 006 012 010 013 015 046 012
+Isaiah
+031 022 026 006 030 013 025 022 021 034 016 006 022 032 009 014 014 007 025 006 017 025 018 023 012 021 013 029 024 033 009 020 024 017 010 022 038 022 008 031 029 025 028 028 025 013 015 022 026 011 023 015 012 017 013 012 021 014 021 022 011 012 019 012 025 024
+Jeremiah
+019 037 025 031 031 030 034 022 026 025 023 017 027 022 021 021 027 023 015 018 014 030 040 010 038 024 022 017 032 024 040 044 026 022 019 032 021 028 018 016 018 022 013 030 005 028 007 047 039 046 064 034
+Lamentations
+022 022 066 022 022
+Baruch
+022 035 038 037 009 073
+Letter of Jeremiah
+073
+Ezekiel
+028 010 027 017 017 014 027 018 011 022 025 028 023 023 008 063 024 032 014 049 032 031 049 027 017 021 036 026 021 026 018 032 033 031 015 038 028 023 029 049 026 020 027 031 025 024 023 035
+Daniel
+021 049 100 034 031 028 028 027 027 021 045 013 065 042
+Hosea
+011 023 005 019 015 011 016 014 017 015 012 014 016 009
+Joel
+020 032 021
+Amos
+015 016 015 013 027 014 017 014 015
+Obadiah
+021
+Jonah
+017 010 010 011
+Micah
+016 013 012 013 015 016 020
+Nahum
+015 013 019
+Habakkuk
+017 020 019
+Zephaniah
+018 015 020
+Haggai
+015 023
+Zechariah
+021 013 010 014 011 015 014 023 017 012 017 014 009 021
+Malachi
+014 017 018 006
+Matthew
+025 023 017 025 048 034 029 034 038 042 030 050 058 036 039 028 027 035 030 034 046 046 039 051 046 075 066 020
+Mark
+045 028 035 041 043 056 037 038 050 052 033 044 037 072 047 020
+Luke
+080 052 038 044 039 049 050 056 062 042 054 059 035 035 032 031 037 043 048 047 038 071 056 053
+John
+051 025 036 054 047 071 053 059 041 042 057 050 038 031 027 033 026 040 042 031 025
+Acts
+026 047 026 037 042 015 060 040 043 048 030 025 052 028 041 040 034 028 041 038 040 030 035 027 027 032 044 031
+Romans
+032 029 031 025 021 023 025 039 033 021 036 021 014 026 033 025
+1 Corinthians
+031 016 023 021 013 020 040 013 027 033 034 031 013 040 058 024
+2 Corinthians
+024 017 018 018 021 018 016 024 015 018 033 021 014
+Galatians
+024 021 029 031 026 018
+Ephesians
+023 022 021 032 033 024
+Philippians
+030 030 021 023
+Colossians
+029 023 025 018
+1 Thessalonians
+010 020 013 018 028
+2 Thessalonians
+012 017 018
+1 Timothy
+020 015 016 016 025 021
+2 Timothy
+018 026 017 022
+Titus
+016 015 015
+Philemon
+025
+Hebrews
+014 018 019 016 014 020 028 013 028 039 040 029 025
+James
+027 026 018 017 020
+1 Peter
+025 025 022 019 014
+2 Peter
+021 022 018
+1 John
+010 029 024 021 021
+2 John
+013
+3 John
+014
+Jude
+025
+Revelation
+020 029 022 011 014 017 017 013 021 011 019 017 018 020 008 021 018 024 021 015 027 021
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/catholic.can b/Build/source/utils/songs/songs-2.17/src/songidx/catholic.can
new file mode 100644
index 00000000000..11aa7979a8e
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/catholic.can
@@ -0,0 +1,174 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+#
+#
+# Filename: catholic.can
+# Last modified: 2006/06/12
+#
+# The following Canon data file describes the layout of the Catholic Bible.
+# The deuterocanonical books are included, along with the additional verses
+# in Esther and Daniel.
+#
+Genesis
+031 025 024 026 032 022 024 022 029 032 032 020 018 024 021 016 027 033 038 018 034 024 020 067 034 035 046 022 035 043 055 032 020 031 029 043 036 030 023 023 057 038 034 034 028 034 031 022 033 026
+Exodus
+022 025 022 031 023 030 025 032 035 029 010 051 022 031 027 036 016 027 025 026 036 031 033 018 040 037 021 043 046 038 018 035 023 035 035 038 029 031 043 038
+Leviticus
+017 016 017 035 019 030 038 036 024 020 047 008 059 057 033 034 016 030 037 027 024 033 044 023 055 046 034
+Numbers
+054 034 051 049 031 027 089 026 023 036 035 016 033 045 041 050 013 032 022 029 035 041 030 025 018 065 023 031 040 016 054 042 056 029 034 013
+Deuteronomy
+046 037 029 049 033 025 026 020 029 022 032 032 018 029 023 022 020 022 021 020 023 030 025 022 019 019 026 068 029 020 030 052 029 012
+Joshua
+018 024 017 024 015 027 026 035 027 043 023 024 033 015 063 010 018 028 051 009 045 034 016 033
+Judges
+036 023 031 024 031 040 025 035 057 018 040 015 025 020 020 031 013 031 030 048 025
+Ruth
+022 023 018 022
+1 Samuel
+028 036 021 022 012 021 017 022 027 027 015 025 023 052 035 023 058 030 024 042 015 023 029 022 044 025 012 025 011 031 013
+2 Samuel
+027 032 039 012 025 023 029 018 013 019 027 031 039 033 037 023 029 033 043 026 022 051 039 025
+1 Kings
+053 046 028 034 018 038 051 066 028 029 043 033 034 031 034 034 024 046 021 043 029 053
+2 Kings
+018 025 027 044 027 033 020 029 037 036 021 021 025 029 038 020 041 037 037 021 026 020 037 020 030
+1 Chronicles
+054 055 024 043 026 081 040 040 044 014 047 040 014 017 029 043 027 017 019 008 030 019 032 031 031 032 034 021 030
+2 Chronicles
+017 018 017 022 014 042 022 018 031 019 023 016 022 015 019 014 019 034 011 037 020 012 021 027 028 023 009 027 036 027 021 033 025 033 027 023
+Ezra
+011 070 013 024 017 022 028 036 015 044
+Nehemiah
+011 020 032 023 019 019 073 018 038 039 036 047 031
+Tobit|Tobias
+025 023 025 023 028 022 020 024 012 013 021 022 023 017
+Judith
+012 018 015 016 029 021 025 034 019 020 021 020 031 018 015 031
+Esther
+022 023 015 017 014 014 010 017 032 013 012 006 018 019 019 024
+1 Macabees
+067 070 060 061 068 063 050 032 073 089 074 054 054 049 041 024
+2 Macabees
+036 033 040 050 027 031 042 036 029 038 038 046 026 046 040
+Job
+022 013 026 021 027 030 021 022 035 022 020 025 028 022 035 022 016 021 029 029 034 030 017 025 006 014 023 028 025 031 040 022 033 037 016 033 024 041 030 024 034 017
+Psalms|Psalm
+006 012 008 008 012 010 017 009 020 018 007 008 006 007 005 011 015 050 014 009 013 031 006 010 022 012 014 009 011 012 024 011 022 022 028 012 040 022 013 017 013 011 005 026 017 011 009 014 020 023 019 009 006 007 023 013 011 011 017 012 008 012 011 010 013 020 007 035 036 005 024 020 028 023 010 012 020 072 013 019 016 008 018 012 013 017 007 018 052 017 016 015 005 023 011 013 012 009 009 005 008 028 022 035 045 048 043 013 031 007 010 010 009 008 018 019 002 029 176 007 008 009 004 008 005 006 005 006 008 008 003 018 003 003 021 026 009 008 024 013 010 007 012 015 021 010 020 014 009 006
+Proverbs
+033 022 035 027 023 035 027 036 018 032 031 028 025 035 033 033 028 024 029 030 031 029 035 034 028 028 027 028 027 033 031
+Ecclesiastes
+018 026 022 016 020 012 029 017 018 020 010 014
+Song of Songs|Song of Solomon
+017 017 011 016 016 013 013 014
+Wisdom|Wisdom of Solomon
+016 025 019 020 024 027 030 021 019 021 027 027 019 031 019 029 020 025 020
+Sirach|Ecclesiasticus
+040 023 034 036 018 037 040 022 025 034 036 019 032 027 022 031 031 033 028 033 031 033 038 047 036 028 033 030 034 027 042 028 033 031 026 028 034 039 041 032 028 026 037 027 031 023 031 028 019 031 038
+Isaiah
+031 022 026 006 030 013 025 022 021 034 016 006 022 032 009 014 014 007 025 006 017 025 018 023 012 021 013 029 024 033 009 020 024 017 010 022 038 022 008 031 029 025 028 028 025 013 015 022 026 011 023 015 012 017 013 012 021 014 021 022 011 012 019 012 025 024
+Jeremiah
+019 037 025 031 031 030 034 022 026 025 023 017 027 022 021 021 027 023 015 018 014 030 040 010 038 024 022 017 032 024 040 044 026 022 019 032 021 028 018 016 018 022 013 030 005 028 007 047 039 046 064 034
+Lamentations
+022 022 066 022 022
+Baruch
+022 035 038 037 009 073
+Ezekiel
+028 010 027 017 017 014 027 018 011 022 025 028 023 023 008 063 024 032 014 049 032 031 049 027 017 021 036 026 021 026 018 032 033 031 015 038 028 023 029 049 026 020 027 031 025 024 023 035
+Daniel
+021 049 100 034 031 028 028 027 027 021 045 013 065 042
+Hosea
+011 023 005 019 015 011 016 014 017 015 012 014 016 009
+Joel
+020 032 021
+Amos
+015 016 015 013 027 014 017 014 015
+Obadiah
+021
+Jonah
+017 010 010 011
+Micah
+016 013 012 013 015 016 020
+Nahum
+015 013 019
+Habakkuk
+017 020 019
+Zephaniah
+018 015 020
+Haggai
+015 023
+Zechariah
+021 013 010 014 011 015 014 023 017 012 017 014 009 021
+Malachi
+014 017 018 006
+Matthew
+025 023 017 025 048 034 029 034 038 042 030 050 058 036 039 028 027 035 030 034 046 046 039 051 046 075 066 020
+Mark
+045 028 035 041 043 056 037 038 050 052 033 044 037 072 047 020
+Luke
+080 052 038 044 039 049 050 056 062 042 054 059 035 035 032 031 037 043 048 047 038 071 056 053
+John
+051 025 036 054 047 071 053 059 041 042 057 050 038 031 027 033 026 040 042 031 025
+Acts
+026 047 026 037 042 015 060 040 043 048 030 025 052 028 041 040 034 028 041 038 040 030 035 027 027 032 044 031
+Romans
+032 029 031 025 021 023 025 039 033 021 036 021 014 026 033 025
+1 Corinthians
+031 016 023 021 013 020 040 013 027 033 034 031 013 040 058 024
+2 Corinthians
+024 017 018 018 021 018 016 024 015 018 033 021 014
+Galatians
+024 021 029 031 026 018
+Ephesians
+023 022 021 032 033 024
+Philippians
+030 030 021 023
+Colossians
+029 023 025 018
+1 Thessalonians
+010 020 013 018 028
+2 Thessalonians
+012 017 018
+1 Timothy
+020 015 016 016 025 021
+2 Timothy
+018 026 017 022
+Titus
+016 015 015
+Philemon
+025
+Hebrews
+014 018 019 016 014 020 028 013 028 039 040 029 025
+James
+027 026 018 017 020
+1 Peter
+025 025 022 019 014
+2 Peter
+021 022 018
+1 John
+010 029 024 021 021
+2 John
+013
+3 John
+014
+Jude
+025
+Revelation
+020 029 022 011 014 017 017 013 021 011 019 017 018 020 008 021 018 024 021 015 027 021
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/chars.h b/Build/source/utils/songs/songs-2.17/src/songidx/chars.h
new file mode 100644
index 00000000000..d4ee6903fc1
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/chars.h
@@ -0,0 +1,136 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+#ifndef CHARS_H
+#define CHARS_H
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#if HAVE_WCHAR_H
+# include <wchar.h>
+#endif
+#if HAVE_WCTYPE_H
+# include <wctype.h>
+#endif
+
+#if HAVE_WCHAR_T
+
+typedef wchar_t WCHAR;
+
+#define wc_lit(c) (L ## c)
+#define wc_isalpha(c) iswalpha((c))
+#define wc_ispunct(c) iswpunct((c))
+#define wc_isupper(c) iswupper((c))
+#define wc_isspace(c) iswspace((c))
+#define wc_isdigit(c) iswdigit((c))
+#define wc_tolower(c) towlower((c))
+#define wc_toupper(c) towupper((c))
+
+#define ws_lit(s) ws_lit2(s)
+#define ws_lit2(s) (L ## s)
+#define ws_strlen(p) wcslen((p))
+#define ws_strcmp(p1,p2) wcscmp((p1),(p2))
+#define ws_strncmp(p1,p2,n) wcsncmp((p1),(p2),(n))
+#define ws_strcpy(p1,p2) wcscpy((p1),(p2))
+#define ws_strncpy(p1,p2,n) wcsncpy((p1),(p2),(n))
+#define ws_memmove(p1,p2,n) wmemmove((p1),(p2),(n))
+#define ws_strchr(p,c) wcschr((p),(c))
+#define ws_strspn(p1,p2) wcsspn((p1),(p2))
+#define ws_strpbrk(p1,p2) wcspbrk((p1),(p2))
+#define ws_strtol(p1,p2,n) wcstol((p1),(p2),(n))
+#define ws_coll(p1,p2) wcscoll((p1),(p2))
+#define ws_fprintf1(fh,fs,x) fwprintf((fh),(fs),(x))
+#define ws_fprintf2(fh,fs,x,y) fwprintf((fh),(fs),(x),(y))
+#define ws_fprintf3(fh,fs,x,y,z) fwprintf((fh),(fs),(x),(y),(z))
+#define ws_fgets(p,n,fh) fgetws((p),(n),(fh))
+#define ws_fputs(s,fh) fputws((s),(fh))
+#define ws_fputc(c,fh) fputwc((c),(fh))
+
+#else
+
+#include <ctype.h>
+#if HAVE_STRING_H
+# include <string.h>
+#elif HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+typedef char WCHAR;
+
+#define wc_lit(c) (c)
+#define wc_isalpha(c) isalpha((c))
+#define wc_ispunct(c) ispunct((c))
+#define wc_isupper(c) isupper((c))
+#define wc_isspace(c) isspace((c))
+#define wc_isdigit(c) isdigit((c))
+#define wc_tolower(c) tolower((c))
+#define wc_toupper(c) toupper((c))
+
+#define ws_lit(s) (s)
+#define ws_strlen(p) strlen((p))
+#define ws_strcmp(p1,p2) strcmp((p1),(p2))
+#define ws_strncmp(p1,p2,n) strncmp((p1),(p2),(n))
+#define ws_strcpy(p1,p2) strcpy((p1),(p2))
+#define ws_strncpy(p1,p2,n) strncpy((p1),(p2),(n))
+#define ws_memmove(p1,p2,n) memmove((p1),(p2),(n))
+#define ws_strchr(p,c) strchr((p),(c))
+#define ws_strspn(p1,p2) strspn((p1),(p2))
+#define ws_strpbrk(p1,p2) strpbrk((p1),(p2))
+#define ws_strtol(p1,p2,n) strtol((p1),(p2),(n))
+#define ws_coll(p1,p2) strcoll((p1),(p2))
+#define ws_fprintf1(fh,fs,x) fprintf((fh),(fs),(x))
+#define ws_fprintf2(fh,fs,x,y) fprintf((fh),(fs),(x),(y))
+#define ws_fprintf3(fh,fs,x,y,z) fprintf((fh),(fs),(x),(y),(z))
+#define ws_fgets(p,n,fh) fgets((p),(n),(fh))
+#define ws_fputs(s,fh) fputs((s),(fh))
+#define ws_fputc(c,fh) fputc((c),(fh))
+
+#endif
+
+#define wc_null wc_lit('\0')
+#define wc_hyphen wc_lit('-')
+#define wc_apostrophe wc_lit('\'')
+#define wc_backquote wc_lit('`')
+#define wc_backslash wc_lit('\\')
+#define wc_lbrace wc_lit('{')
+#define wc_rbrace wc_lit('}')
+#define wc_comma wc_lit(',')
+#define wc_period wc_lit('.')
+#define wc_space wc_lit(' ')
+#define wc_newline wc_lit('\n')
+#define wc_cr wc_lit('\r')
+#define wc_asterisk wc_lit('*')
+#define wc_hash wc_lit('#')
+#define wc_pipe wc_lit('|')
+#define wc_colon wc_lit(':')
+#define wc_semicolon wc_lit(';')
+#define wc_percent wc_lit('%')
+#define wc_tilda wc_lit('~')
+
+#endif
+
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/fileio.c b/Build/source/utils/songs/songs-2.17/src/songidx/fileio.c
new file mode 100644
index 00000000000..2b8d7e44982
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/fileio.c
@@ -0,0 +1,122 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+
+/* fileopen(<fstate>,<filename>)
+ * Open <filename> for reading, storing the file handle in <fstate>. Return
+ * 1 on success or 0 on failure.
+ */
+int
+fileopen(fs,fnam)
+ FSTATE *fs;
+ const char *fnam;
+{
+ if (strcmp(fnam,"-"))
+ {
+ fs->f = fopen(fnam, "r");
+ if (!fs->f)
+ {
+ fprintf(stderr, "songidx: Unable to open %s for reading.\n", fnam);
+ return 0;
+ }
+ }
+ else
+ {
+ fs->f = stdin;
+ fnam = "stdin";
+ }
+ fs->filename = (char *) calloc(strlen(fnam)+1, sizeof(char));
+ if (!fs->filename)
+ {
+ fprintf(stderr, "songidx: Out of memory!\n");
+ fclose(fs->f);
+ return 0;
+ }
+ strcpy(fs->filename, fnam);
+ fs->lineno = 0;
+ return 1;
+}
+
+/* fileclose(<fstate>)
+ * Close file handle <fstate>.
+ */
+void
+fileclose(fs)
+ FSTATE *fs;
+{
+ if (fs->f != stdin) fclose(fs->f);
+ free(fs->filename);
+ fs->f = NULL;
+ fs->filename = NULL;
+ fs->lineno = 0;
+}
+
+/* filereadln(<fstate>,<buffer>,<eof flag>)
+ * Read a line of output into <buffer>, which should be at least MAXLINELEN
+ * wide-characters in size. If the line is too long to fit into the buffer,
+ * close the file and report an error. Eliminate the trailing \n from the
+ * returned line. Return 1 on success or end-of-line, or 0 on failure. If
+ * end-of-line, set <eof flag> to 1. */
+int
+filereadln(fs,buf,eof)
+ FSTATE *fs;
+ WCHAR *buf;
+ int *eof;
+{
+ size_t n;
+
+ ++fs->lineno;
+ if (!ws_fgets(buf, MAXLINELEN, fs->f))
+ {
+ if (!ferror(fs->f))
+ {
+ *eof=1;
+ return 1;
+ }
+ fprintf(stderr, "songidx:%s:%d: read error\n", fs->filename, fs->lineno);
+ fileclose(fs);
+ return 0;
+ }
+ n = ws_strlen(buf);
+ if ((n==0) || ((buf[n-1] != wc_newline) && (buf[n-1] != wc_cr)))
+ {
+ fprintf(stderr, "songidx:%s:%d: line too long\n", fs->filename, fs->lineno);
+ fileclose(fs);
+ return 0;
+ }
+ buf[n-1] = wc_null;
+ if ((n>=2) && ((buf[n-2] == wc_newline) || (buf[n-2] == wc_cr)))
+ buf[n-2] = wc_null;
+ return 1;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/fileio.h b/Build/source/utils/songs/songs-2.17/src/songidx/fileio.h
new file mode 100644
index 00000000000..ed84d19a3ec
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/fileio.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+#ifndef FILEIO_H
+#define FILEIO_H
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+
+#if HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+/* Define the maximum length of lines found in the input file */
+#define MAXLINELEN 1024
+
+/* FSTATE structures model the state of a FILE */
+typedef struct
+{
+ FILE *f;
+ char *filename;
+ int lineno;
+}
+FSTATE;
+
+/* The following functions are in fileio.c */
+extern int fileopen(FSTATE *fs, const char *fnam);
+extern void fileclose(FSTATE *fs);
+extern int filereadln(FSTATE *fs, WCHAR *buf, int *eof);
+
+#endif
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/greek.can b/Build/source/utils/songs/songs-2.17/src/songidx/greek.can
new file mode 100644
index 00000000000..ab8fbc8a933
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/greek.can
@@ -0,0 +1,187 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+#
+#
+# Filename: greek.can
+# Last modified: 2006/06/12
+#
+# The following Canon data file describes the layout of the Greek Orthodox
+# Christian Bible. It includes the deuterocanonical books along with
+# 1 Esdras, 3 & 4 Maccabees, and Odes. Greek Orthodox names for the books
+# are used, including 1-4 Kingdoms, 2 Esdras, and Letter of Jeremiah. The
+# extra verses of Esther and Daniel are also included, as well as the 151st
+# Psalm.
+#
+Genesis
+031 025 024 026 032 022 024 022 029 032 032 020 018 024 021 016 027 033 038 018 034 024 020 067 034 035 046 022 035 043 055 032 020 031 029 043 036 030 023 023 057 038 034 034 028 034 031 022 033 026
+Exodus
+022 025 022 031 023 030 025 032 035 029 010 051 022 031 027 036 016 027 025 026 036 031 033 018 040 037 021 043 046 038 018 035 023 035 035 038 029 031 043 038
+Leviticus
+017 016 017 035 019 030 038 036 024 020 047 008 059 057 033 034 016 030 037 027 024 033 044 023 055 046 034
+Numbers
+054 034 051 049 031 027 089 026 023 036 035 016 033 045 041 050 013 032 022 029 035 041 030 025 018 065 023 031 040 016 054 042 056 029 034 013
+Deuteronomy
+046 037 029 049 033 025 026 020 029 022 032 032 018 029 023 022 020 022 021 020 023 030 025 022 019 019 026 068 029 020 030 052 029 012
+Joshua
+018 024 017 024 015 027 026 035 027 043 023 024 033 015 063 010 018 028 051 009 045 034 016 033
+Judges
+036 023 031 024 031 040 025 035 057 018 040 015 025 020 020 031 013 031 030 048 025
+Ruth
+022 023 018 022
+1 Kingdoms|1 Samuel
+028 036 021 022 012 021 017 022 027 027 015 025 023 052 035 023 058 030 024 042 015 023 029 022 044 025 012 025 011 031 013
+2 Kingdoms|2 Samuel
+027 032 039 012 025 023 029 018 013 019 027 031 039 033 037 023 029 033 043 026 022 051 039 025
+3 Kingdoms|1 Kings
+053 046 028 034 018 038 051 066 028 029 043 033 034 031 034 034 024 046 021 043 029 053
+4 Kingdoms|2 Kings
+018 025 027 044 027 033 020 029 037 036 021 021 025 029 038 020 041 037 037 021 026 020 037 020 030
+1 Chronicles
+054 055 024 043 026 081 040 040 044 014 047 040 014 017 029 043 027 017 019 008 030 019 032 031 031 032 034 021 030
+2 Chronicles
+017 018 017 022 014 042 022 018 031 019 023 016 022 015 019 014 019 034 011 037 020 012 021 027 028 023 009 027 036 027 021 033 025 033 027 023
+1 Esdras
+058 030 024 063 073 034 015 096 055
+2 Esdras
+011 070 013 024 017 022 028 036 015 044 011 020 032 023 019 019 073 018 038 039 036 047 031
+Tobit|Tobias
+025 023 025 023 028 022 020 024 012 013 021 022 023 017
+Judith
+012 018 015 016 029 021 025 034 019 020 021 020 031 018 015 031
+Esther
+022 023 015 017 014 014 010 017 032 013 012 006 018 019 019 024
+1 Macabees|1 Maccabees
+067 070 060 061 068 063 050 032 073 089 074 054 054 049 041 024
+2 Macabees|2 Maccabees
+036 033 040 050 027 031 042 036 029 038 038 046 026 046 040
+3 Macabees|3 Maccabees
+029 033 030 021 051 041 023
+4 Macabees|4 Maccabees
+035 024 021 026 038 035 023 028 032 021 027 019 027 020 032 025 024 024
+Job
+022 013 026 021 027 030 021 022 035 022 020 025 028 022 035 022 016 021 029 029 034 030 017 025 006 014 023 028 025 031 040 022 033 037 016 033 024 041 030 024 034 017
+Psalms|Psalm
+006 012 008 008 012 010 017 009 020 018 007 008 006 007 005 011 015 050 014 009 013 031 006 010 022 012 014 009 011 012 024 011 022 022 028 012 040 022 013 017 013 011 005 026 017 011 009 014 020 023 019 009 006 007 023 013 011 011 017 012 008 012 011 010 013 020 007 035 036 005 024 020 028 023 010 012 020 072 013 019 016 008 018 012 013 017 007 018 052 017 016 015 005 023 011 013 012 009 009 005 008 028 022 035 045 048 043 013 031 007 010 010 009 008 018 019 002 029 176 007 008 009 004 008 005 006 005 006 008 008 003 018 003 003 021 026 009 008 024 013 010 007 012 015 021 010 020 014 009 006 007
+Odes
+019 043 010 018 012 008 020 037 034 009 010 015 004 046
+Proverbs
+033 022 035 027 023 035 027 036 018 032 031 028 025 035 033 033 028 024 029 030 031 029 035 034 028 028 027 028 027 033 031
+Ecclesiastes
+018 026 022 016 020 012 029 017 018 020 010 014
+Song of Songs|Song of Solomon
+017 017 011 016 016 013 013 014
+Wisdom|Wisdom of Solomon
+016 025 019 020 024 027 030 021 019 021 027 027 019 031 019 029 020 025 020
+Sirach|Ecclesiasticus
+040 023 034 036 018 037 040 022 025 034 036 019 032 027 022 031 031 033 028 033 031 033 038 047 036 028 033 030 034 027 042 028 033 031 026 028 034 039 041 032 028 026 037 027 031 023 031 028 019 031 038
+Psalms of Solomon|Psalm of Solomon
+008 037 012 025 019 006 010 034 011 008 009 006 012 010 013 015 046 012
+Isaiah
+031 022 026 006 030 013 025 022 021 034 016 006 022 032 009 014 014 007 025 006 017 025 018 023 012 021 013 029 024 033 009 020 024 017 010 022 038 022 008 031 029 025 028 028 025 013 015 022 026 011 023 015 012 017 013 012 021 014 021 022 011 012 019 012 025 024
+Jeremiah
+019 037 025 031 031 030 034 022 026 025 023 017 027 022 021 021 027 023 015 018 014 030 040 010 038 024 022 017 032 024 040 044 026 022 019 032 021 028 018 016 018 022 013 030 005 028 007 047 039 046 064 034
+Lamentations
+022 022 066 022 022
+Baruch
+022 035 038 037 009
+Letter of Jeremiah
+073
+Ezekiel
+028 010 027 017 017 014 027 018 011 022 025 028 023 023 008 063 024 032 014 049 032 031 049 027 017 021 036 026 021 026 018 032 033 031 015 038 028 023 029 049 026 020 027 031 025 024 023 035
+Daniel
+021 049 100 034 031 028 028 027 027 021 045 013 065 042
+Hosea
+011 023 005 019 015 011 016 014 017 015 012 014 016 009
+Joel
+020 032 021
+Amos
+015 016 015 013 027 014 017 014 015
+Obadiah
+021
+Jonah
+017 010 010 011
+Micah
+016 013 012 013 015 016 020
+Nahum
+015 013 019
+Habakkuk
+017 020 019
+Zephaniah
+018 015 020
+Haggai
+015 023
+Zechariah
+021 013 010 014 011 015 014 023 017 012 017 014 009 021
+Malachi
+014 017 018 006
+Matthew
+025 023 017 025 048 034 029 034 038 042 030 050 058 036 039 028 027 035 030 034 046 046 039 051 046 075 066 020
+Mark
+045 028 035 041 043 056 037 038 050 052 033 044 037 072 047 020
+Luke
+080 052 038 044 039 049 050 056 062 042 054 059 035 035 032 031 037 043 048 047 038 071 056 053
+John
+051 025 036 054 047 071 053 059 041 042 057 050 038 031 027 033 026 040 042 031 025
+Acts
+026 047 026 037 042 015 060 040 043 048 030 025 052 028 041 040 034 028 041 038 040 030 035 027 027 032 044 031
+Romans
+032 029 031 025 021 023 025 039 033 021 036 021 014 026 033 025
+1 Corinthians
+031 016 023 021 013 020 040 013 027 033 034 031 013 040 058 024
+2 Corinthians
+024 017 018 018 021 018 016 024 015 018 033 021 014
+Galatians
+024 021 029 031 026 018
+Ephesians
+023 022 021 032 033 024
+Philippians
+030 030 021 023
+Colossians
+029 023 025 018
+1 Thessalonians
+010 020 013 018 028
+2 Thessalonians
+012 017 018
+1 Timothy
+020 015 016 016 025 021
+2 Timothy
+018 026 017 022
+Titus
+016 015 015
+Philemon
+025
+Hebrews
+014 018 019 016 014 020 028 013 028 039 040 029 025
+James
+027 026 018 017 020
+1 Peter
+025 025 022 019 014
+2 Peter
+021 022 018
+1 John
+010 029 024 021 021
+2 John
+013
+3 John
+014
+Jude
+025
+Revelation
+020 029 022 011 014 017 017 013 021 011 019 017 018 020 008 021 018 024 021 015 027 021
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/protestant.can b/Build/source/utils/songs/songs-2.17/src/songidx/protestant.can
new file mode 100644
index 00000000000..69a362318fa
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/protestant.can
@@ -0,0 +1,160 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+#
+#
+# Filename: protestant.can
+# Last modified: 2006/06/12
+#
+# The following Canon data file describes the layout of the Protestant Bible.
+# Books of the Apocrypha are omitted, as are the extra chapters of Esther
+# and Daniel and the 151st Psalm.
+#
+Genesis
+031 025 024 026 032 022 024 022 029 032 032 020 018 024 021 016 027 033 038 018 034 024 020 067 034 035 046 022 035 043 055 032 020 031 029 043 036 030 023 023 057 038 034 034 028 034 031 022 033 026
+Exodus
+022 025 022 031 023 030 025 032 035 029 010 051 022 031 027 036 016 027 025 026 036 031 033 018 040 037 021 043 046 038 018 035 023 035 035 038 029 031 043 038
+Leviticus
+017 016 017 035 019 030 038 036 024 020 047 008 059 057 033 034 016 030 037 027 024 033 044 023 055 046 034
+Numbers
+054 034 051 049 031 027 089 026 023 036 035 016 033 045 041 050 013 032 022 029 035 041 030 025 018 065 023 031 040 016 054 042 056 029 034 013
+Deuteronomy
+046 037 029 049 033 025 026 020 029 022 032 032 018 029 023 022 020 022 021 020 023 030 025 022 019 019 026 068 029 020 030 052 029 012
+Joshua
+018 024 017 024 015 027 026 035 027 043 023 024 033 015 063 010 018 028 051 009 045 034 016 033
+Judges
+036 023 031 024 031 040 025 035 057 018 040 015 025 020 020 031 013 031 030 048 025
+Ruth
+022 023 018 022
+1 Samuel
+028 036 021 022 012 021 017 022 027 027 015 025 023 052 035 023 058 030 024 042 015 023 029 022 044 025 012 025 011 031 013
+2 Samuel
+027 032 039 012 025 023 029 018 013 019 027 031 039 033 037 023 029 033 043 026 022 051 039 025
+1 Kings
+053 046 028 034 018 038 051 066 028 029 043 033 034 031 034 034 024 046 021 043 029 053
+2 Kings
+018 025 027 044 027 033 020 029 037 036 021 021 025 029 038 020 041 037 037 021 026 020 037 020 030
+1 Chronicles
+054 055 024 043 026 081 040 040 044 014 047 040 014 017 029 043 027 017 019 008 030 019 032 031 031 032 034 021 030
+2 Chronicles
+017 018 017 022 014 042 022 018 031 019 023 016 022 015 019 014 019 034 011 037 020 012 021 027 028 023 009 027 036 027 021 033 025 033 027 023
+Ezra
+011 070 013 024 017 022 028 036 015 044
+Nehemiah
+011 020 032 023 019 019 073 018 038 039 036 047 031
+Esther
+022 023 015 017 014 014 010 017 032 003
+Job
+022 013 026 021 027 030 021 022 035 022 020 025 028 022 035 022 016 021 029 029 034 030 017 025 006 014 023 028 025 031 040 022 033 037 016 033 024 041 030 024 034 017
+Psalms|Psalm
+006 012 008 008 012 010 017 009 020 018 007 008 006 007 005 011 015 050 014 009 013 031 006 010 022 012 014 009 011 012 024 011 022 022 028 012 040 022 013 017 013 011 005 026 017 011 009 014 020 023 019 009 006 007 023 013 011 011 017 012 008 012 011 010 013 020 007 035 036 005 024 020 028 023 010 012 020 072 013 019 016 008 018 012 013 017 007 018 052 017 016 015 005 023 011 013 012 009 009 005 008 028 022 035 045 048 043 013 031 007 010 010 009 008 018 019 002 029 176 007 008 009 004 008 005 006 005 006 008 008 003 018 003 003 021 026 009 008 024 013 010 007 012 015 021 010 020 014 009 006
+Proverbs
+033 022 035 027 023 035 027 036 018 032 031 028 025 035 033 033 028 024 029 030 031 029 035 034 028 028 027 028 027 033 031
+Ecclesiastes
+018 026 022 016 020 012 029 017 018 020 010 014
+Song of Songs|Song of Solomon
+017 017 011 016 016 013 013 014
+Isaiah
+031 022 026 006 030 013 025 022 021 034 016 006 022 032 009 014 014 007 025 006 017 025 018 023 012 021 013 029 024 033 009 020 024 017 010 022 038 022 008 031 029 025 028 028 025 013 015 022 026 011 023 015 012 017 013 012 021 014 021 022 011 012 019 012 025 024
+Jeremiah
+019 037 025 031 031 030 034 022 026 025 023 017 027 022 021 021 027 023 015 018 014 030 040 010 038 024 022 017 032 024 040 044 026 022 019 032 021 028 018 016 018 022 013 030 005 028 007 047 039 046 064 034
+Lamentations
+022 022 066 022 022
+Ezekiel
+028 010 027 017 017 014 027 018 011 022 025 028 023 023 008 063 024 032 014 049 032 031 049 027 017 021 036 026 021 026 018 032 033 031 015 038 028 023 029 049 026 020 027 031 025 024 023 035
+Daniel
+021 049 030 037 031 028 028 027 027 021 045 013
+Hosea
+011 023 005 019 015 011 016 014 017 015 012 014 016 009
+Joel
+020 032 021
+Amos
+015 016 015 013 027 014 017 014 015
+Obadiah
+021
+Jonah
+017 010 010 011
+Micah
+016 013 012 013 015 016 020
+Nahum
+015 013 019
+Habakkuk
+017 020 019
+Zephaniah
+018 015 020
+Haggai
+015 023
+Zechariah
+021 013 010 014 011 015 014 023 017 012 017 014 009 021
+Malachi
+014 017 018 006
+Matthew
+025 023 017 025 048 034 029 034 038 042 030 050 058 036 039 028 027 035 030 034 046 046 039 051 046 075 066 020
+Mark
+045 028 035 041 043 056 037 038 050 052 033 044 037 072 047 020
+Luke
+080 052 038 044 039 049 050 056 062 042 054 059 035 035 032 031 037 043 048 047 038 071 056 053
+John
+051 025 036 054 047 071 053 059 041 042 057 050 038 031 027 033 026 040 042 031 025
+Acts
+026 047 026 037 042 015 060 040 043 048 030 025 052 028 041 040 034 028 041 038 040 030 035 027 027 032 044 031
+Romans
+032 029 031 025 021 023 025 039 033 021 036 021 014 026 033 025
+1 Corinthians
+031 016 023 021 013 020 040 013 027 033 034 031 013 040 058 024
+2 Corinthians
+024 017 018 018 021 018 016 024 015 018 033 021 014
+Galatians
+024 021 029 031 026 018
+Ephesians
+023 022 021 032 033 024
+Philippians
+030 030 021 023
+Colossians
+029 023 025 018
+1 Thessalonians
+010 020 013 018 028
+2 Thessalonians
+012 017 018
+1 Timothy
+020 015 016 016 025 021
+2 Timothy
+018 026 017 022
+Titus
+016 015 015
+Philemon
+025
+Hebrews
+014 018 019 016 014 020 028 013 028 039 040 029 025
+James
+027 026 018 017 020
+1 Peter
+025 025 022 019 014
+2 Peter
+021 022 018
+1 John
+010 029 024 021 021
+2 John
+013
+3 John
+014
+Jude
+025
+Revelation
+020 029 022 011 014 017 017 013 021 011 019 017 018 020 008 021 018 024 021 015 027 021
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/scripidx.c b/Build/source/utils/songs/songs-2.17/src/songidx/scripidx.c
new file mode 100644
index 00000000000..00110f9f186
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/scripidx.c
@@ -0,0 +1,1105 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+
+/* Create a LaTeX scripture index file from a scripture index .dat file. */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+#if HAVE_STRING_H
+# include <string.h>
+#else
+# if HAVE_STRINGS_H
+# include <strings.h>
+# endif
+#endif
+
+/* The following constant should be a large integer (but not greater than
+ * INT_MAX) limiting the maximum number of verses in a single chapter of the
+ * bible. */
+#define MAXVERSES 999
+
+/* A BBOOK struct describes a book of the Bible, including:
+ * name: a \0-separated string of names (the first one is the name used when
+ * printing the scripture index)
+ * verses: an array of numbers giving the number of verses in each chapter
+ * aliases: the number of names in the name field
+ * chapters: the number of chapters in the book */
+typedef struct
+{
+ WCHAR *name;
+ int *verses;
+ int aliases;
+ int chapters;
+}
+BBOOK;
+
+/* A VERSE struct refers to a verse in a book of the Bible.
+ * chapter: the integral chapter number of the verse (1 if the book has only
+ * one chapter)
+ * verse: the integral verse number */
+typedef struct
+{
+ int chapter, verse;
+}
+VERSE;
+
+/* A SONGLIST is a list of songs
+ * num: a string denoting the song number (e.g. "3" or "H10")
+ * link: a string denoting the hyperlink label for the song
+ * int: an integer key used to order songs when sorting
+ * next: next pointer */
+typedef struct songliststruct
+{
+ WCHAR *num;
+ WCHAR *link;
+ int key;
+ struct songliststruct *next;
+}
+SONGLIST;
+
+/* A VERSELIST is the list of verses in a particular book of the Bible at which
+ * the set of songs referencing that verse differs from the set of songs
+ * referencing the previous verse in the book. Such a list allows us to
+ * sparsely represent the set of songs referencing each verse in the book
+ * without having to create a distinct list entry for each verse in the entire
+ * book. For example, if song "H1" references verses 3:1-10, that would
+ * represented by a two-element list:
+ * [ {v={chapter=3, verse=1}, adds=[H1], drops=[]};
+ * {v={chapter=3, verse=10}, adds=[], drops=[H1]} ]
+ * This is more reasonable than creating ten list items to refer to such a
+ * range.
+ * v: the verse at which the set of song references is changing
+ * adds: a list of songs that refer to this verse but not the previous one
+ * drops: a list of songs that refer to this verse but not the next one
+ * next: pointer to next verse at which the set of references changes */
+typedef struct verseliststruct
+{
+ VERSE v;
+ SONGLIST *adds, *drops;
+ struct verseliststruct *next;
+}
+VERSELIST;
+
+/* The bible global variable stores the array of bible books being used to
+ * generate the scripture index. The numbooks variable stores the number of
+ * elements in the bible array. */
+BBOOK *bible = NULL;
+int numbooks = 0;
+
+/* free_bible()
+ * Free the bible array, set it to NULL, and set numbooks to 0. */
+static void
+free_bible()
+{
+ int i;
+
+ if (!bible) return;
+ for (i=0; i<numbooks; ++i)
+ {
+ if (bible[i].name) free(bible[i].name);
+ if (bible[i].verses) free(bible[i].verses);
+ }
+ free(bible);
+ bible = NULL;
+ numbooks = 0;
+}
+
+/* free_songlist(<slist>)
+ * Free song list <slist>. */
+static void
+free_songlist(sl)
+ SONGLIST *sl;
+{
+ SONGLIST *next;
+
+ for (; sl; sl=next)
+ {
+ if (sl->num) free(sl->num);
+ if (sl->link) free(sl->link);
+ next = sl->next;
+ free(sl);
+ }
+}
+
+/* free_verselist(<vlist>)
+ * Free verse list <vlist>. */
+static void
+free_verselist(vl)
+ VERSELIST *vl;
+{
+ VERSELIST *next;
+
+ for (; vl; vl=next)
+ {
+ free_songlist(vl->adds);
+ free_songlist(vl->drops);
+ next = vl->next;
+ free(vl);
+ }
+}
+
+/* freeidxarray(<array>,<len>)
+ * Free the array of verselists given by <array>. The array should have
+ * length <len>. */
+static void
+freeidxarray(idx,len)
+ VERSELIST **idx;
+ int len;
+{
+ int i;
+
+ if (!idx) return;
+ for (i=0; i<len; ++i) free_verselist(idx[i]);
+ free(idx);
+}
+
+/* readbible(<filename>)
+ * Read bible data file <filename> into the bible array and set numbooks to
+ * the number of books read. Return 0 on error or 1 on success. */
+static int
+readbible(filename)
+ const char *filename;
+{
+ FSTATE fs;
+ int eof = 0;
+ WCHAR buf[MAXLINELEN];
+ int verses[MAXLINELEN/2+1];
+ int arraysize, j;
+ WCHAR *p1, *p2;
+
+ if (!fileopen(&fs,filename)) return 0;
+
+ bible = NULL;
+ eof = 0;
+ for (arraysize=numbooks=0; !eof; ++numbooks)
+ {
+ if (!filereadln(&fs,buf,&eof))
+ {
+ free_bible();
+ return 0;
+ }
+ if (eof) break;
+ if (*buf == wc_hash)
+ {
+ --numbooks;
+ continue;
+ }
+ if (numbooks >= arraysize)
+ {
+ BBOOK *temp;
+ arraysize *= 2;
+ if (arraysize==0) arraysize=64;
+ temp = (BBOOK *) realloc(bible,arraysize*sizeof(BBOOK));
+ if (!temp)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many bible books (out of memory)\n",
+ fs.filename, fs.lineno);
+ free_bible();
+ return 0;
+ }
+ bible = temp;
+ }
+ if ((bible[numbooks].name =
+ (WCHAR *) calloc(ws_strlen(buf)+1,sizeof(WCHAR))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: bible book name too large"
+ " (out of memory)\n", fs.filename, fs.lineno);
+ fileclose(&fs);
+ free_bible();
+ return 0;
+ }
+ for(j=1, p1=buf, p2=bible[numbooks].name; *p1!=wc_null; ++p1, ++p2)
+ {
+ if (*p1 == wc_pipe)
+ {
+ ++j;
+ *p2=wc_null;
+ }
+ else *p2=*p1;
+ }
+ *p2 = wc_null;
+ if (j == 0)
+ {
+ fprintf(stderr, "songidx:%s:%d: bible book has no name\n",
+ fs.filename, fs.lineno);
+ free(bible[numbooks].name);
+ fileclose(&fs);
+ free_bible();
+ return 0;
+ }
+ bible[numbooks].aliases = j;
+ do
+ {
+ if (!filereadln(&fs,buf,&eof))
+ {
+ free_bible();
+ return 0;
+ }
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete bible book entry (book"
+ " title with no verses)\n", fs.filename, fs.lineno);
+ free_bible();
+ return 0;
+ }
+ }
+ while (*buf == wc_hash);
+ for (j=0, p1=buf; *p1!=wc_null; ++j)
+ {
+ long v = ws_strtol(p1, &p1, 10);
+ if ((v<=0) || (v>MAXVERSES))
+ {
+ fprintf(stderr, "songidx:%s:%d: illegal verse count for chapter %d\n",
+ fs.filename, fs.lineno, j+1);
+ fileclose(&fs);
+ free_bible();
+ return 0;
+ }
+ verses[j] = (int) v;
+ }
+ if (j == 0)
+ {
+ fprintf(stderr, "songidx:%s:%d: book ", fs.filename, fs.lineno);
+ ws_fputs(bible[numbooks].name, stderr);
+ fprintf(stderr, " has no chapters\n");
+ fileclose(&fs);
+ free_bible();
+ return 0;
+ }
+ bible[numbooks].chapters = j;
+ if ((bible[numbooks].verses = (int *) calloc(j, sizeof(int))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many verses (out of memory)\n",
+ fs.filename, fs.lineno);
+ fileclose(&fs);
+ free_bible();
+ return 0;
+ }
+ for (j=0; j<bible[numbooks].chapters; ++j)
+ bible[numbooks].verses[j] = verses[j];
+ }
+
+ fileclose(&fs);
+ return 1;
+}
+
+/* ws_stricmp(<string1>,<string2>)
+ * Case-insensitive, wide-string comparison function. (Some standard C libs
+ * already have one of these, but not all do; for compatibility I have to
+ * write my own.) */
+static int
+ws_stricmp(p1,p2)
+ const WCHAR *p1;
+ const WCHAR *p2;
+{
+ for (;;)
+ {
+ int diff = wc_tolower(*p1) - wc_tolower(*p2);
+ if (diff != 0) return diff;
+ if (*p1 == wc_null) return 0;
+ ++p1; ++p2;
+ }
+}
+
+/* parseref(<string>,<book>,<verse>)
+ * Interpret <string> as a scripture reference, and store the NUMBER of the
+ * book of the Bible it refers to in <book>, and the chapter and verse that
+ * it refers to in <verse>. Return a pointer into <string> to the suffix of
+ * <string> that was not parsed. The <book> and <verse> should hold the book
+ * and verse of the PREVIOUS scripture reference (if any) on entry to the
+ * function. If book or chapter information is missing, they will be drawn
+ * from this info. That way, successive calls can correctly parse a run-on
+ * string like "Philippians 3:1,5; 4:3", inferring that "5" refers to
+ * "Philippians 3" and "4:3" refers to "Philippians". If the parser
+ * encounters an error in processing the book name (e.g., a book name was
+ * specified but not recognized), <book> is set to numbooks. If no chapter
+ * or no verse is provided (e.g., the reference is just "Philippians" or
+ * "Philippians 3") then the chapter and/or verse fields of <verse> are set
+ * to -1. */
+static WCHAR *
+parseref(r,book,v)
+ WCHAR *r;
+ int *book;
+ VERSE *v;
+{
+ WCHAR *p;
+ WCHAR c;
+ int i;
+ const WCHAR *a;
+
+ while (*r==wc_space) ++r;
+ p = ws_strpbrk(r, ws_lit(",;-"));
+ if (!p) p=r+ws_strlen(r);
+ if (p>r) --p;
+ while ((p>r) && (*p==wc_space)) --p;
+ while ((p>r) && (wc_isdigit(*p) || (*p==wc_colon))) --p;
+ if (p>r)
+ {
+ if (*p==wc_space)
+ {
+ *p++ = wc_null;
+ for (*book=0; *book<numbooks; ++(*book))
+ {
+ for (i=0, a=bible[*book].name;
+ i<bible[*book].aliases;
+ ++i, a+=ws_strlen(a)+1)
+ if (!ws_stricmp(r,a)) break;
+ if (i<bible[*book].aliases) break;
+ }
+ }
+ else
+ {
+ *book=numbooks;
+ }
+ r=p;
+ v->chapter = v->verse = -1;
+ }
+ while (wc_isdigit(*p)) ++p;
+ if (*p==wc_colon)
+ {
+ *p++ = wc_null;
+ v->chapter = ws_strtol(r,NULL,10);
+ r=p;
+ while (wc_isdigit(*p)) ++p;
+ }
+ if (r==p) return NULL;
+ c = *p;
+ *p = wc_null;
+ if ((v->chapter < 0) && (*book>=0) && (*book<numbooks) &&
+ (bible[*book].chapters == 1))
+ {
+ /* Special case: This book only has one chapter. */
+ v->chapter = 1;
+ }
+ if (v->chapter < 0)
+ v->chapter = ws_strtol(r,NULL,10);
+ else
+ v->verse = ws_strtol(r,NULL,10);
+ *p = c;
+ while (*p==wc_space) ++p;
+ if (*p && (*p!=wc_comma) && (*p!=wc_semicolon) && (*p!=wc_hyphen))
+ return NULL;
+ return p;
+}
+
+/* vlt(<v1>,<v2>)
+ * Return 1 if verse <v1> precedes <v2> and 0 otherwise. */
+static int
+vlt(v1,v2)
+ const VERSE v1;
+ const VERSE v2;
+{
+ return ((v1.chapter == v2.chapter) ? (v1.verse < v2.verse)
+ : (v1.chapter < v2.chapter));
+}
+
+/* vcpy(<vdest>,<vsrc>)
+ * Copy the data from verse <vsrc> into verse <vdest>. */
+static void
+vcpy(vdest,vsrc)
+ VERSE *vdest;
+ const VERSE vsrc;
+{
+ vdest->chapter = vsrc.chapter;
+ vdest->verse = vsrc.verse;
+}
+
+/* getvcount(<book>,<chapter>)
+ * Return the number of verses in chapter <chapter> of book number <book> of
+ * the Bible. */
+static int
+getvcount(book,chapter)
+ int book;
+ int chapter;
+{
+ if ((book<0) || (book>=numbooks))
+ {
+ /* This should never happen. */
+ fprintf(stderr, "songidx: Internal error (getvcount):"
+ " Book %d out of range.\n", book);
+ return 0;
+ }
+ if ((chapter<1) || (chapter > bible[book].chapters))
+ return 0;
+ return bible[book].verses[chapter-1];
+}
+
+/* vinc(<book>,<verse>)
+ * Return a reference to the verse immediately following <verse> in book
+ * number <book> of the Bible. The verse returned is static, so successive
+ * calls will overwrite it. If <verse> is the last verse in <book>, the
+ * return value will reference verse 1 of a non-existant chapter. */
+static VERSE
+vinc(book,v)
+ int book;
+ const VERSE v;
+{
+ static VERSE vret;
+ int cnt;
+
+ vret.chapter = v.chapter;
+ vret.verse = v.verse + 1;
+ cnt = getvcount(book, vret.chapter);
+ if (cnt <= 0)
+ {
+ /* This should never happen. */
+ fprintf(stderr, "songidx: Internal Error (vinc): Book ");
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, " has no chapter %d.\n", vret.chapter);
+ }
+ else if (vret.verse > cnt)
+ {
+ ++vret.chapter;
+ vret.verse = 1;
+ }
+ return vret;
+}
+
+/* vdec(<book>,<verse>)
+ * Return a reference to the verse immediately preceding <verse> in book
+ * number <book> of the Bible. The verse returned is static, so successive
+ * calls will overwrite it. If <verse> is the first verse in <book>, the
+ * return value will reference chapter -1 and an error message will be
+ * printed to stderr. */
+static VERSE
+vdec(book,v)
+ int book;
+ const VERSE v;
+{
+ static VERSE vret;
+ vret.chapter = v.chapter;
+ vret.verse = v.verse - 1;
+ if (vret.verse < 1)
+ {
+ --vret.chapter;
+ vret.verse = getvcount(book, vret.chapter);
+ if (vret.verse <= 0)
+ {
+ /* This should never happen. */
+ fprintf(stderr, "songidx: Internal Error (vdec): Book ");
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, " has no chapter %d.\n", vret.chapter);
+ vret.verse = -1;
+ }
+ }
+ return vret;
+}
+
+/* addref(<reflist>,<song>,<link>,<key>)
+ * Add a reference to song (<song>,<link>,<key>) to REFLIST <reflist>. The
+ * <reflist> is assumed to be sorted by <key>. If a reference with the same
+ * <key> already exists, <reflist> is left unchanged. Both <song> and
+ * <link> are COPIED into the list. Return 1 on success or 0 on failure. */
+static int
+addref(sl,n,l,key)
+ SONGLIST **sl;
+ const WCHAR *n;
+ const WCHAR *l;
+ int key;
+{
+ SONGLIST *newsong;
+
+ for (; *sl; sl=&((*sl)->next))
+ if ((*sl)->key >= key) break;
+ if (*sl && ((*sl)->key == key)) return 1;
+
+ if ((newsong = (SONGLIST *) malloc(sizeof(SONGLIST))) == NULL)
+ {
+ fprintf(stderr, "songidx: too many scripture references (out of memory)\n");
+ return 0;
+ }
+ newsong->num = newsong->link = NULL;
+ if (((newsong->num = (WCHAR *) calloc(ws_strlen(n)+1,
+ sizeof(WCHAR))) == NULL) ||
+ ((newsong->link = (WCHAR *) calloc(ws_strlen(l)+1,
+ sizeof(WCHAR))) == NULL))
+ {
+ fprintf(stderr, "songidx: too many scripture references (out of memory)\n");
+ if (newsong->num) free(newsong->num);
+ if (newsong->link) free(newsong->link);
+ free(newsong);
+ return 0;
+ }
+ ws_strcpy(newsong->num, n);
+ ws_strcpy(newsong->link, l);
+ newsong->key = key;
+ newsong->next = *sl;
+ *sl = newsong;
+ return 1;
+}
+
+/* insertref(<type>,<verselist>,<verse>,<song>,<link>,<key>)
+ * If <type> is INSERT_ADD, then insert song (<song>,<link>,<key>) into the
+ * set of "adds" for verse <verse> in <verselist>. If <type> is INSERT_DROP,
+ * then insert the song into the set of "drops" for verse <verse>. In either
+ * case, create a new entry for <verse> in <verselist> if it doesn't already
+ * exist. Return 1 on success or 0 on failure. */
+#define INSERT_ADD 1
+#define INSERT_DROP 0
+
+static int
+insertref(type,vpp,v,n,l,key)
+ char type;
+ VERSELIST **vpp;
+ const VERSE v;
+ const WCHAR *n;
+ const WCHAR *l;
+ int key;
+{
+ for (;;)
+ {
+ if (!*vpp || vlt(v, (*vpp)->v))
+ {
+ VERSELIST *vnew = NULL;
+ SONGLIST *sl = NULL;
+ if (((vnew = (VERSELIST *) malloc(sizeof(VERSELIST))) == NULL) ||
+ ((sl = (SONGLIST *) malloc(sizeof(SONGLIST))) == NULL))
+ {
+ fprintf(stderr, "songidx: too many scripture references"
+ " (out of memory)\n");
+ if (vnew) free(vnew);
+ if (sl) free(sl);
+ return 0;
+ }
+ sl->num = sl->link = NULL;
+ if (((sl->num = (WCHAR *) calloc(ws_strlen(n)+1,
+ sizeof(WCHAR))) == NULL) ||
+ ((sl->link = (WCHAR *) calloc(ws_strlen(l)+1,
+ sizeof(WCHAR))) == NULL))
+ {
+ fprintf(stderr, "songidx: too many scripture references"
+ " (out of memory)\n");
+ if (sl->num) free(sl->num);
+ if (sl->link) free(sl->link);
+ free(vnew);
+ free(sl);
+ return 0;
+ }
+ ws_strcpy(sl->num, n);
+ ws_strcpy(sl->link, l);
+ sl->key = key;
+ sl->next = NULL;
+ vcpy(&(vnew->v), v);
+ if (type)
+ {
+ vnew->adds = sl;
+ vnew->drops = NULL;
+ }
+ else
+ {
+ vnew->adds = NULL;
+ vnew->drops = sl;
+ }
+ vnew->next = *vpp;
+ *vpp = vnew;
+ return 1;
+ }
+ else if (!vlt((*vpp)->v, v))
+ {
+ return addref(type ? &((*vpp)->adds) : &((*vpp)->drops), n, l, key);
+ }
+ vpp=&((*vpp)->next);
+ }
+}
+
+/* addrefs(<dest>,<src>)
+ * Take the union of SONGLIST <dest> and SONGLIST <src>, storing the result
+ * in <dest>. Return 1 on success, or 0 on failure. */
+static int
+addrefs(dest,src)
+ SONGLIST **dest;
+ const SONGLIST *src;
+{
+ for (; src; src=src->next)
+ if (!addref(dest, src->num, src->link, src->key)) return 0;
+ return 1;
+}
+
+/* removerefs(<dest>,<src>)
+ * Take the set difference between SONGLIST <dest> and SONGLIST <src>,
+ * storing the result in <dest>. */
+static void
+removerefs(dest,src)
+ SONGLIST **dest;
+ const SONGLIST *src;
+{
+ SONGLIST **sl;
+
+ for (; src; src=src->next)
+ {
+ for (sl=dest; *sl; sl=&((*sl)->next))
+ if ((*sl)->key >= src->key) break;
+ if (*sl && ((*sl)->key == src->key))
+ {
+ SONGLIST *temp = (*sl)->next;
+ free((*sl)->num);
+ free((*sl)->link);
+ free(*sl);
+ *sl = temp;
+ }
+ }
+}
+
+/* slcmp(<slist1>,<slist2>)
+ * Compare SONGLIST's <slist1> and <slist2>, returning 1 if they are
+ * different and 0 if they are the same. */
+static int
+slcmp(s1,s2)
+ const SONGLIST *s1;
+ const SONGLIST *s2;
+{
+ for (; s1 && s2; s1=s1->next, s2=s2->next)
+ if (s1->key != s2->key) return 1;
+ return (s1 || s2);
+}
+
+/* print_vrange(<file>,<book>,<verse1>,<verse2>,<lastchapter>)
+ * Output LaTeX material to file handle <file> for verse range
+ * <verse1>-<verse2> of book number <book>. Depending on <lastchapter>,
+ * the outputted material might be the start of a new index entry or the
+ * continuation of a previous entry. If <lastchapter> is 0, start a new
+ * index entry. If <lastchapter> is >0, continue the previous entry and
+ * print the chapter of <verse1> only if it differs from <lastchapter>.
+ * If <lastchapter> is <0, continue the previous entry and always print the
+ * chapter number of <verse1>. Return 0 on success or -1 on failure. */
+static int
+print_vrange(f,book,v1,v2,lastchapter)
+ FILE *f;
+ int book;
+ const VERSE v1;
+ const VERSE v2;
+ int lastchapter;
+{
+ if (ws_fputs(lastchapter ? ws_lit(",") : ws_lit("\\idxentry{"), f) < 0)
+ return -1;
+ if (v1.verse <= 0)
+ {
+ if (ws_fprintf1(f, lastchapter ? ws_lit("\\thinspace %d") : ws_lit("%d"),
+ v1.chapter) < 0)
+ return -1;
+ }
+ else if ((book>=0) && (book<numbooks) && (bible[book].chapters == 1))
+ {
+ /* This book has only one chapter. */
+ if (ws_fprintf1(f, lastchapter ? ws_lit("\\thinspace %d") : ws_lit("%d"),
+ v1.verse) < 0)
+ return -1;
+ }
+ else if ((lastchapter<=0) || (lastchapter!=v1.chapter) ||
+ (v1.chapter!=v2.chapter))
+ {
+ if (ws_fprintf2(f, lastchapter ? ws_lit(" %d:%d") : ws_lit("%d:%d"),
+ v1.chapter, v1.verse) < 0)
+ return -1;
+ }
+ else
+ {
+ if (ws_fprintf1(f, lastchapter ? ws_lit("\\thinspace %d") : ws_lit("%d"),
+ v1.verse) < 0)
+ return -1;
+ }
+
+ if (vlt(v1,v2))
+ {
+ if (v2.verse <= 0)
+ {
+ if (ws_fprintf1(f, ws_lit("--%d"), v2.chapter) < 0) return -1;
+ }
+ else if (v1.chapter!=v2.chapter)
+ {
+ if (ws_fprintf2(f, ws_lit("--%d:%d"), v2.chapter, v2.verse) < 0)
+ return -1;
+ }
+ else
+ {
+ if (ws_fprintf1(f, ws_lit("--%d"), v2.verse) < 0) return -1;
+ }
+ }
+ return 0;
+}
+
+/* print_reflist(<file>,<slist>)
+ * Output the list of song references given by <slist> to file handle <file>.
+ * Return 0 on success or -1 on failure. */
+static int
+print_reflist(f,sp)
+ FILE *f;
+ const SONGLIST *sp;
+{
+ char first;
+ for (first=1; sp; sp=sp->next)
+ {
+ if (!first)
+ {
+ if (ws_fputs(ws_lit("\\\\"), f) < 0) return -1;
+ }
+ first = 0;
+ if ((ws_fputs(ws_lit("\\songlink{"), f) < 0) ||
+ (ws_fputs(sp->link, f) < 0) ||
+ (ws_fputs(ws_lit("}{"), f) < 0) ||
+ (ws_fputs(sp->num, f) < 0) ||
+ (ws_fputs(ws_lit("}"), f) < 0))
+ return -1;
+ }
+ return 0;
+}
+
+/* genscriptureindex(<fstate>,<outname>,<biblename>)
+ * Generate a LaTeX file named <outname> containing material suitable to
+ * typeset the scripture index data found in input file handle <file>.
+ * Input Bible data from an ascii file named <biblename>. Return 0 on
+ * success, 1 if there were warnings, and 2 if there was a fatal error. */
+int
+genscriptureindex(fs,outname,biblename)
+ FSTATE *fs;
+ const char *outname;
+ const char *biblename;
+{
+ FILE *f;
+ int eof = 0;
+ VERSELIST **idx;
+ int book, book2;
+ WCHAR ref[MAXLINELEN], songnum[MAXLINELEN], linkname[MAXLINELEN];
+ int songcount;
+ WCHAR *p;
+ VERSE v1, v2;
+ char hadwarnings = 0;
+
+ fprintf(stderr, "songidx: Parsing scripture index data file %s...\n",
+ fs->filename);
+
+ /* Read the bible data file into the bible array. */
+ if (!readbible(biblename)) return 2;
+ if ((idx = (VERSELIST **) calloc(numbooks, sizeof(VERSELIST *))) == NULL)
+ {
+ fprintf(stderr, "songidx: too many books of the bible (out of memory)\n");
+ free_bible();
+ return 2;
+ }
+ for (book=0; book<numbooks; ++book) idx[book] = NULL;
+
+ /* Walk through the input file and construct a VERSELIST for each book
+ * of the Bible. Each VERSELIST represents the set of verses in that book
+ * referred to by songs in the song book. */
+ songcount = 0;
+ book = -1;
+ v1.chapter = -1;
+ v1.verse = -1;
+ for (;;)
+ {
+ /* Get the next song data record. */
+ if (!filereadln(fs,ref,&eof))
+ {
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+ if (eof) break;
+ if (!filereadln(fs,songnum,&eof) || eof ||
+ !filereadln(fs,linkname,&eof) || eof)
+ {
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete entry\n",
+ fs->filename, fs->lineno);
+ fileclose(fs);
+ }
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+
+ /* Add all scripture references for this song to the VERSELIST array */
+ p = ref;
+ while (*p != wc_null)
+ {
+ /* Parse the next reference. */
+ p = parseref(p, &book, &v1);
+ if (!p)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Malformed scripture reference"
+ " for song ", fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, ". Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ if (book<0)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Scripture reference for song ",
+ fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " doesn't include a book name. Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ if (book>=numbooks)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Scripture reference for song ",
+ fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " references unknown book. Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ if (v1.chapter < 1)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Scripture reference for song ",
+ fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " has no chapter or verse. Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ /* Unless the reference ended in a "-", it consists of just one verse. */
+ v2.chapter = v1.chapter;
+ v2.verse = v1.verse;
+ if (*p==wc_hyphen)
+ {
+ /* This reference ended in a "-", which means it starts a range.
+ * Parse the next reference to find the range's end. */
+ book2 = book;
+ p = parseref(++p, &book2, &v2);
+ if (!p)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Malformed scripture"
+ " reference for song ", fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, ". Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ if (book2!=book)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Scripture reference for"
+ " song ", fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " appears to span books! Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ }
+ if (*p!=wc_null) ++p;
+ /* If either the start or end references of the range were incomplete
+ * (e.g., the range was something like "Philippians 3", where the verse
+ * numbers are not explicit), try to fill in the missing information
+ * based on how many verses are in the chapter and how many chapters are
+ * in the book. */
+ if (v1.verse <= 0) v1.verse = 1;
+ if (v2.verse <= 0)
+ {
+ v2.verse = getvcount(book,v2.chapter);
+ if (v2.verse <= 0)
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Scripture reference for "
+ " song ", fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " refers implicitly to chapter %d of ", v2.chapter);
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, ", which doesn't exist. Ignoring it.\n");
+ hadwarnings = 1;
+ break;
+ }
+ }
+ if (v1.verse > getvcount(book,v1.chapter))
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Song ",
+ fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " references ");
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, " %d:%d, which doesn't exist! Ignoring it.\n",
+ v1.chapter, v1.verse);
+ hadwarnings = 1;
+ break;
+ }
+ if (v2.verse > getvcount(book,v2.chapter))
+ {
+ fprintf(stderr, "songidx:%s:%d: WARNING: Song ",
+ fs->filename, fs->lineno);
+ ws_fputs(songnum, stderr);
+ fprintf(stderr, " references ");
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, " %d:%d, which doesn't exist! Ignoring it.\n",
+ v2.chapter, v2.verse);
+ hadwarnings = 1;
+ break;
+ }
+
+ /* Add the range to the SONGLIST array. */
+ if (!insertref(INSERT_ADD, &(idx[book]), v1, songnum, linkname,
+ songcount) ||
+ !insertref(INSERT_DROP, &(idx[book]), v2, songnum, linkname,
+ songcount))
+ {
+ fileclose(fs);
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+ }
+ /* finished adding all refs for this song */
+ ++songcount;
+ }
+ /* finished adding all refs for all songs */
+ fileclose(fs);
+
+ /* Now create the index .sbx file */
+ fprintf(stderr, "songidx: Generating scripture index TeX file %s...\n",
+ outname);
+ if (strcmp(outname,"-"))
+ {
+ if ((f = fopen(outname, "w")) == NULL)
+ {
+ fprintf(stderr, "songidx: Unable to open %s for writing.\n", outname);
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+ }
+ else
+ {
+ f = stdout;
+ outname = "stdout";
+ }
+
+#define TRYWRITE(x) \
+ if (!(x)) \
+ { \
+ fprintf(stderr, "songidx:%s: write error\n", outname); \
+ if (f == stdout) fflush(f); else fclose(f); \
+ freeidxarray(idx,numbooks); \
+ free_bible(); \
+ return 2; \
+ }
+
+ /* For each book of the Bible that has songs that reference it, go through
+ * its VERSELIST and generate a sequence of index entries. Wherever
+ * possible, compact adjacent entries that have identical SONGLISTS so that
+ * we never have two consecutive index entries with identical right-hand
+ * sides. */
+ for (book=0; book<numbooks; ++book)
+ if (idx[book])
+ {
+ VERSE vrstart;
+ VERSELIST *vp;
+ SONGLIST *sl = NULL;
+ int lastchapter; /* 0=none, -1=force printing of chapter */
+
+ TRYWRITE((ws_fputs(ws_lit("\\begin{idxblock}{"), f) >=0)
+ && (ws_fputs(bible[book].name, f) >= 0)
+ && (ws_fputs(ws_lit("}\n"), f) >=0))
+ lastchapter = 0;
+ vcpy(&vrstart, idx[book]->v);
+ for (vp=idx[book]; vp; vp=vp->next)
+ {
+ if (!addrefs(&sl, vp->adds))
+ {
+ fclose(f);
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+ if (!slcmp(vp->drops, vp->next ? vp->next->adds : NULL))
+ {
+ /* Set of drops here equals set of adds next time. There's at least
+ * a chance that we can combine this item and the next one into a
+ * single index entry. */
+ if (vp->next && !vlt(vinc(book,vp->v), vp->next->v))
+ {
+ /* If the next item is adjacent to this one, do nothing. Just let
+ * the range in progress be extended. We'll output a single entry
+ * for all of these adjacent verses when we reach the end. */
+ continue;
+ }
+ else if (vp->next && !slcmp(sl, vp->drops))
+ {
+ /* Otherwise, if the next item is not adjacent but all refs are
+ * dropped here, then print a partial entry to be continued with a
+ * comma next time. */
+ TRYWRITE(print_vrange(f, book, vrstart, vp->v, lastchapter) >= 0)
+ lastchapter = (vrstart.chapter != vp->v.chapter) ?
+ -1 : vp->v.chapter;
+ vcpy(&vrstart, vp->next->v);
+ continue;
+ }
+ }
+ if (vp->drops)
+ {
+ /* Some songs get dropped here, and either the next item is not
+ * adjacent to this one, or it's adjacent and the set of adds is not
+ * the same. In either case, that means the set of refs changes at
+ * this point, so we need to output a full entry (or finish the one
+ * in progress). */
+ TRYWRITE((print_vrange(f, book, vrstart, vp->v, lastchapter) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (print_reflist(f, sl) >= 0) &&
+ (ws_fputs(ws_lit("}\n"), f) >= 0))
+ removerefs(&sl, vp->drops);
+ lastchapter = 0;
+ vcpy(&vrstart, (!sl && vp->next) ? vp->next->v : vinc(book,vp->v));
+ }
+ if (sl && vp->next && vp->next->adds && vlt(vrstart, vp->next->v))
+ {
+ /* There are verses between this item and the next which have refs,
+ * but the refs change at the beginning of the next item. Make an
+ * entry for the intermediate block of verses. */
+ VERSE vrend;
+ vcpy(&vrend, vdec(book,vp->next->v));
+ TRYWRITE((print_vrange(f, book, vrstart, vrend, lastchapter) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (print_reflist(f, sl) >= 0) &&
+ (ws_fputs(ws_lit("}\n"), f) >= 0))
+ lastchapter = 0;
+ vcpy(&vrstart, vp->next->v);
+ }
+ }
+ if (sl)
+ {
+ fprintf(stderr, "songidx: scripture references in ");
+ ws_fputs(bible[book].name, stderr);
+ fprintf(stderr, " appear to extend past the end of the book!"
+ " Aborting.\n");
+ fclose(f);
+ freeidxarray(idx,numbooks);
+ free_bible();
+ return 2;
+ }
+ TRYWRITE(ws_fputs(ws_lit("\\end{idxblock}\n"), f) >= 0)
+ }
+
+#undef TRYWRITE
+
+ fclose(f);
+ freeidxarray(idx,numbooks);
+ free_bible();
+
+ return hadwarnings;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/songidx.c b/Build/source/utils/songs/songs-2.17/src/songidx/songidx.c
new file mode 100644
index 00000000000..343a309af06
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/songidx.c
@@ -0,0 +1,265 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ *
+ *
+ * This program generates an index.sbx file from an index.sxd file. Index.sxd
+ * files are generated by the song book LaTeX files while you compile a song
+ * book. They contain lists of all the song titles, song numbers, and
+ * scripture references. Once the .sxd files exist, run this program to
+ * convert them in to .sbx files. This program will sort the song titles
+ * alphabetically, group all the scripture entries into the appropriate
+ * chunks, etc. The TeX files that it creates are then used by the LaTeX
+ * files next time you compile the song book.
+ *
+ * The syntax for running the program is:
+ * songidx input.sxd output.sbx
+ * or, if you're compiling a scripture index:
+ * songidx -b bible.can input.sxd output.sbx
+ *
+ * The program should compile on unix with
+ *
+ * cc *.c -o songidx
+ *
+ * On Windows, you'll need to find a C compiler in order to compile it,
+ * or go to http://songs.sourceforge.net to obtain a Windows self-installer
+ * with pre-compiled binaries.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+#if HAVE_STRING_H
+# include <string.h>
+#elif HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#if HAVE_SETLOCALE
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
+#endif
+
+#define BIBLEDEFAULT "bible.can"
+
+#if HAVE_STRRCHR
+# define STRRCHR(x,y) strrchr((x),(y))
+#else
+# define STRRCHR(x,y) local_strrchr((x),(y))
+char *
+local_strrchr(s,c)
+ const char *s;
+ int c;
+{
+ const char *t;
+ if (!s) return NULL;
+ for (t=s; *t; ++s) ;
+ for (; t>=s; --s)
+ if (*t == c) return t;
+ return NULL;
+}
+#endif
+
+int
+main(argc,argv)
+ int argc;
+ char *argv[];
+{
+ FSTATE fs;
+ int eof = 0;
+ WCHAR buf[MAXLINELEN];
+ int retval;
+ const char *bible, *inname, *outname, *locale;
+ int i;
+
+ bible = inname = outname = locale = NULL;
+ for (i=1; i<argc; ++i)
+ {
+ if (!strcmp(argv[i],"-v") || !strcmp(argv[i],"--version"))
+ {
+ printf("songidx " VERSION "\n"
+ "Copyright (C) 2013 Kevin W. Hamlen\n"
+ "License GPLv2: GNU GPL version 2 or later"
+ " <http://gnu.org/licenses/gpl.html>\n"
+ "This is free software: you are free to change and redistribute it.\n"
+ "There is NO WARRANTY, to the extent permitted by law.\n");
+ return 0;
+ }
+ else if (!strcmp(argv[i],"-h") || !strcmp(argv[i],"--help"))
+ {
+ printf("Syntax: %s [options] input.sxd [output.sbx]\n", argv[0]);
+ printf(
+ "Available options:\n"
+ " -b FILE Sets the bible format when generating a\n"
+ " --bible FILE scripture index (default: " BIBLEDEFAULT ")\n"
+ "\n"
+ " -l LOCALE Overrides the default system locale (affects\n"
+ " --locale LOCALE (how non-English characters are parsed).\n"
+ " See local system help for valid LOCALE's.\n"
+ "\n"
+ " -h Displays this help file and stops.\n"
+ " --help\n"
+ "\n"
+ " -o FILE Sets the output filename.\n"
+ " --output FILE\n"
+ "\n"
+ " -v Print version information and stop.\n"
+ " --version\n"
+ "\n"
+ "If omitted, [output.sbx] defaults to the input filename but with\n"
+ "the file extension renamed to '.sbx'. To read or write to stdin or\n"
+ "stdout, use '-' in place of input.sxd or output.sbx.\n"
+ "\n"
+ "See http://songs.sourceforge.net for support.\n");
+ return 0;
+ }
+ else if (!strcmp(argv[i],"-b") || !strcmp(argv[i],"--bible"))
+ {
+ if (bible)
+ {
+ fprintf(stderr, "songidx: multiple bible files specified\n");
+ return 2;
+ }
+ else if (++i < argc)
+ bible = argv[i];
+ else
+ {
+ fprintf(stderr, "songidx: %s option requires an argument\n", argv[i-1]);
+ return 2;
+ }
+ }
+ else if (!strcmp(argv[i],"-l") || !strcmp(argv[i],"--locale"))
+ {
+ if (locale)
+ {
+ fprintf(stderr, "songidx: multiple locales specified\n");
+ return 2;
+ }
+ else if (++i < argc)
+ locale = argv[i];
+ else
+ {
+ fprintf(stderr, "songidx: %s option requires an argument\n", argv[i-1]);
+ return 2;
+ }
+ }
+ else if (!strcmp(argv[i],"-o") || !strcmp(argv[i],"--output"))
+ {
+ if (outname)
+ {
+ fprintf(stderr, "songidx: multiple output files specified\n");
+ return 2;
+ }
+ else if (++i < argc)
+ outname = argv[i];
+ else
+ {
+ fprintf(stderr, "songidx: %s option requires an argument\n", argv[i-1]);
+ return 2;
+ }
+ }
+ else if ((argv[i][0] == '-') && (argv[i][1] != '\0'))
+ {
+ fprintf(stderr, "songidx: unknown option %s\n", argv[i]);
+ return 2;
+ }
+ else if (!inname) inname=argv[i];
+ else if (!outname) outname=argv[i];
+ else
+ {
+ fprintf(stderr, "songidx: too many command line arguments\n");
+ return 2;
+ }
+ }
+
+#if HAVE_SETLOCALE
+ if (!locale)
+ (void) setlocale(LC_ALL, "");
+ else if (!setlocale(LC_ALL, locale))
+ {
+ fprintf(stderr, "songidx: invalid locale: %s\n", locale);
+ return 2;
+ }
+#endif
+
+ if (!inname)
+ {
+ fprintf(stderr, "songidx: no input file specified\n");
+ return 2;
+ }
+ if (!outname)
+ {
+ if (!strcmp(inname,"-"))
+ outname = "-";
+ else
+ {
+ char *b;
+ const char *p1 = STRRCHR(inname,'.');
+ if ((p1 < STRRCHR(inname,'/')) || (p1 < STRRCHR(inname,'\\')))
+ p1 = inname+strlen(inname);
+ b = (char *) malloc(p1-inname+5);
+ strncpy(b,inname,p1-inname);
+ strcpy(b+(p1-inname),".sbx");
+ outname = b;
+ }
+ }
+ if (!bible) bible = BIBLEDEFAULT;
+
+ if (!fileopen(&fs, inname)) return 2;
+
+ /* The first line of the input file is a header line that dictates which kind
+ * of index the data file is for. */
+ if (!filereadln(&fs, buf, &eof)) return 2;
+ retval = 2;
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s: file is empty\n", fs.filename);
+ fileclose(&fs);
+ }
+ else if (!ws_strcmp(buf, ws_lit("TITLE INDEX DATA FILE")))
+ retval = gentitleindex(&fs, outname);
+ else if (!ws_strcmp(buf, ws_lit("SCRIPTURE INDEX DATA FILE")))
+ retval = genscriptureindex(&fs, outname, bible);
+ else if (!ws_strcmp(buf, ws_lit("AUTHOR INDEX DATA FILE")))
+ retval = genauthorindex(&fs, outname);
+ else
+ {
+ fprintf(stderr, "songidx:%s:%d: file has unrecognized format\n",
+ fs.filename, fs.lineno);
+ fileclose(&fs);
+ }
+
+ /* Report the outcome to the user. */
+ if (retval == 0)
+ fprintf(stderr, "songidx: Done!\n");
+ else if (retval == 1)
+ fprintf(stderr, "songidx: COMPLETED WITH ERRORS. SEE ABOVE.\n");
+ else
+ fprintf(stderr, "songidx: FAILED. SEE ERROR MESSAGES ABOVE.\n");
+
+ return retval;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/songidx.h b/Build/source/utils/songs/songs-2.17/src/songidx/songidx.h
new file mode 100644
index 00000000000..c7be4dba87f
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/songidx.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+#ifndef SONGIDX_H
+#define SONGIDX_H
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "fileio.h"
+
+/* A SONGENTRY struct consists of three fields:
+ * title: a string representing the title of the song
+ * num: a string representing the song's number in the book (might be
+ * something like "H10")
+ * linkname: a string denoting the internal hyperlink label for this song
+ * idx: a unique integer key that should be used to sort songs with
+ * identical titles */
+typedef struct
+{
+ WCHAR *title;
+ WCHAR *num;
+ WCHAR *linkname;
+ int idx;
+}
+SONGENTRY;
+
+/* The following functions are in songsort.c */
+extern void skipesc(const WCHAR **p, int stop_on_space, int skipover_groups);
+extern int songcmp(const void *s1, const void *s2);
+
+/* The following function is in titleidx.c */
+extern int gentitleindex(FSTATE *fs, const char *outname);
+
+/* The following function is in scripidx.c */
+extern int genscriptureindex(FSTATE *fs, const char *outname,
+ const char *biblename);
+
+/* The following function is in authidx.c */
+extern int genauthorindex(FSTATE *fs, const char *outname);
+
+#endif
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/songsort.c b/Build/source/utils/songs/songs-2.17/src/songidx/songsort.c
new file mode 100644
index 00000000000..7720f205fdb
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/songsort.c
@@ -0,0 +1,164 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+/* skipesc(<ptr>,<sm_flag>,<group_flag>)
+ * Walk <ptr> past any LaTeX macros or braces until we reach the next "real"
+ * character. If <sm_flag> is 1, then space macros "\ " cause p to stop on
+ * the space; otherwise they are skipped as macros. If <group_flag> is 1
+ * then content between (non-escaped) braces is skipped; otherwise braces
+ * are ignored. */
+void
+skipesc(p, stop_on_space, skipover_groups)
+ const WCHAR **p;
+ int stop_on_space;
+ int skipover_groups;
+{
+ unsigned int group_depth = 0;
+
+ for (;;)
+ {
+ if (**p == wc_backslash)
+ {
+ ++(*p);
+ if (stop_on_space && !group_depth && wc_isspace(**p)) return;
+ if (wc_isalpha(**p)) {
+ while (wc_isalpha(**p)) ++(*p);
+ while (wc_isspace(**p)) ++(*p);
+ } else if (**p != wc_null) ++(*p);
+ }
+ else if (**p == wc_lbrace)
+ {
+ ++(*p);
+ if (skipover_groups) ++group_depth;
+ while (wc_isspace(**p)) ++(*p);
+ }
+ else if (**p == wc_rbrace)
+ {
+ ++(*p);
+ if (group_depth) --group_depth;
+ }
+ else if (group_depth)
+ ++(*p);
+ else
+ break;
+ }
+}
+
+/* inword(<char>)
+ * Return 0 if <char> is a word-delimiter (for sorting purposes) and 1
+ * otherwise. Other than TeX macros (which are handled by skipesc above),
+ * words only have alphabetics and apostrophes. */
+static int
+inword(c)
+ WCHAR c;
+{
+ return (wc_isalpha(c) || (c==wc_apostrophe) || (c==wc_backquote));
+}
+
+/* songcmp(<song1>,<song2>)
+ * Return a negative number if <song1> is less than <song2>, a positive
+ * number if <song1> is greater than <song2>, and 0 if <song1> and <song2>
+ * are equal. The ordering is first by title, then by index. This function
+ * is suitable for use with qsort(). */
+int
+songcmp(s1,s2)
+ const void *s1;
+ const void *s2;
+{
+ static WCHAR buf1[MAXLINELEN+1], *bp1;
+ static WCHAR buf2[MAXLINELEN+1], *bp2;
+ const WCHAR *t1 = (*((SONGENTRY * const *) s1))->title;
+ const WCHAR *t2 = (*((SONGENTRY * const *) s2))->title;
+ int diff;
+
+ for (;;)
+ {
+ /* Find the next word or number in each string. */
+ skipesc(&t1,0,0);
+ while(*t1 && !wc_isalpha(*t1) && !wc_isdigit(*t1))
+ {
+ ++t1;
+ skipesc(&t1,0,0);
+ }
+ skipesc(&t2,0,0);
+ while(*t2 && !wc_isalpha(*t2) && !wc_isdigit(*t2))
+ {
+ ++t2;
+ skipesc(&t2,0,0);
+ }
+
+ /* If there is no next word/number in one or both, sort the shorter
+ * string before the longer one. */
+ if ((*t1==wc_null) || (*t2==wc_null))
+ {
+ if ((*t1==wc_null) && (*t2==wc_null)) break;
+ return (t1!=wc_null) ? 1 : -1;
+ }
+
+ /* If one is a number, sort the number before the word. If both are
+ * numbers, sort in numerical order. */
+ if (wc_isdigit(*t1) || wc_isdigit(*t2))
+ {
+ long n1, n2;
+ WCHAR *p1, *p2;
+ if (!wc_isdigit(*t1)) return 1;
+ if (!wc_isdigit(*t2)) return -1;
+ n1 = ws_strtol(t1, &p1, 10);
+ t1 = p1;
+ n2 = ws_strtol(t2, &p2, 10);
+ t2 = p2;
+ if (n1 == n2) continue;
+ return n1-n2;
+ }
+
+ /* Otherwise, both are words. Copy the words into scratch buffers,
+ * omitting any macros or braces. Then lexographically compare the buffer
+ * contents to determine how the original strings should be sorted. */
+ for (bp1=buf1; inword(*t1); skipesc(&t1,1,0)) *bp1++=wc_tolower(*t1++);
+ for (bp2=buf2; inword(*t2); skipesc(&t2,1,0)) *bp2++=wc_tolower(*t2++);
+ *bp1 = *bp2 = wc_null;
+ if ((diff = ws_coll(buf1,buf2)) != 0) return diff;
+ }
+
+ /* If each corresponding word/number is identical, then sort alternate-
+ * form entries (e.g., lyrics) after normal entries (e.g., titles). */
+ if (((*((SONGENTRY * const *) s1))->title[0] == wc_asterisk)
+ && ((*((SONGENTRY * const *) s2))->title[0] != wc_asterisk))
+ return 1;
+ if (((*((SONGENTRY * const *) s1))->title[0] != wc_asterisk)
+ && ((*((SONGENTRY * const *) s2))->title[0] == wc_asterisk))
+ return -1;
+
+ /* If everything is the same, sort by the right-hand sides of the index
+ * entries (e.g., the song or page numbers). */
+ return (*((SONGENTRY * const *) s1))->idx - (*((SONGENTRY * const *) s2))->idx;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/tanakh.can b/Build/source/utils/songs/songs-2.17/src/songidx/tanakh.can
new file mode 100644
index 00000000000..96559d03ce7
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/tanakh.can
@@ -0,0 +1,100 @@
+# Copyright (C) 2013 Kevin W. Hamlen
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# The latest version of this program can be obtained from
+# http://songs.sourceforge.net.
+#
+#
+# Filename: tanakh.can
+# Last modified: 2006/06/12
+#
+# The following Canon data file describes the layout of the Jewish Tanakh.
+# This includes the books of the Protestant Old Testament, but in a different
+# order and with Chronicles as one book (spanning the Protestant books of
+# 1 & 2 Chronicles) and Ezra as one book (spanning the Protestant books of
+# Ezra and Nehemiah).
+#
+Genesis
+031 025 024 026 032 022 024 022 029 032 032 020 018 024 021 016 027 033 038 018 034 024 020 067 034 035 046 022 035 043 055 032 020 031 029 043 036 030 023 023 057 038 034 034 028 034 031 022 033 026
+Exodus
+022 025 022 031 023 030 025 032 035 029 010 051 022 031 027 036 016 027 025 026 036 031 033 018 040 037 021 043 046 038 018 035 023 035 035 038 029 031 043 038
+Leviticus
+017 016 017 035 019 030 038 036 024 020 047 008 059 057 033 034 016 030 037 027 024 033 044 023 055 046 034
+Numbers
+054 034 051 049 031 027 089 026 023 036 035 016 033 045 041 050 013 032 022 029 035 041 030 025 018 065 023 031 040 016 054 042 056 029 034 013
+Deuteronomy
+046 037 029 049 033 025 026 020 029 022 032 032 018 029 023 022 020 022 021 020 023 030 025 022 019 019 026 068 029 020 030 052 029 012
+Joshua
+018 024 017 024 015 027 026 035 027 043 023 024 033 015 063 010 018 028 051 009 045 034 016 033
+Judges
+036 023 031 024 031 040 025 035 057 018 040 015 025 020 020 031 013 031 030 048 025
+Samuel
+028 036 021 022 012 021 017 022 027 027 015 025 023 052 035 023 058 030 024 042 015 023 029 022 044 025 012 025 011 031 013 027 032 039 012 025 023 029 018 013 019 027 031 039 033 037 023 029 033 043 026 022 051 039 025
+Kings
+053 046 028 034 018 038 051 066 028 029 043 033 034 031 034 034 024 046 021 043 029 053 018 025 027 044 027 033 020 029 037 036 021 021 025 029 038 020 041 037 037 021 026 020 037 020 030
+Isaiah
+031 022 026 006 030 013 025 022 021 034 016 006 022 032 009 014 014 007 025 006 017 025 018 023 012 021 013 029 024 033 009 020 024 017 010 022 038 022 008 031 029 025 028 028 025 013 015 022 026 011 023 015 012 017 013 012 021 014 021 022 011 012 019 012 025 024
+Jeremiah
+019 037 025 031 031 030 034 022 026 025 023 017 027 022 021 021 027 023 015 018 014 030 040 010 038 024 022 017 032 024 040 044 026 022 019 032 021 028 018 016 018 022 013 030 005 028 007 047 039 046 064 034
+Ezekiel
+028 010 027 017 017 014 027 018 011 022 025 028 023 023 008 063 024 032 014 049 032 031 049 027 017 021 036 026 021 026 018 032 033 031 015 038 028 023 029 049 026 020 027 031 025 024 023 035
+Hosea
+011 023 005 019 015 011 016 014 017 015 012 014 016 009
+Joel
+020 032 021
+Amos
+015 016 015 013 027 014 017 014 015
+Obadiah
+021
+Jonah
+017 010 010 011
+Micah
+016 013 012 013 015 016 020
+Nahum
+015 013 019
+Habakkuk
+017 020 019
+Zephaniah
+018 015 020
+Haggai
+015 023
+Zechariah
+021 013 010 014 011 015 014 023 017 012 017 014 009 021
+Malachi
+014 017 018 006
+Psalms|Psalm
+006 012 008 008 012 010 017 009 020 018 007 008 006 007 005 011 015 050 014 009 013 031 006 010 022 012 014 009 011 012 024 011 022 022 028 012 040 022 013 017 013 011 005 026 017 011 009 014 020 023 019 009 006 007 023 013 011 011 017 012 008 012 011 010 013 020 007 035 036 005 024 020 028 023 010 012 020 072 013 019 016 008 018 012 013 017 007 018 052 017 016 015 005 023 011 013 012 009 009 005 008 028 022 035 045 048 043 013 031 007 010 010 009 008 018 019 002 029 176 007 008 009 004 008 005 006 005 006 008 008 003 018 003 003 021 026 009 008 024 013 010 007 012 015 021 010 020 014 009 006
+Proverbs
+033 022 035 027 023 035 027 036 018 032 031 028 025 035 033 033 028 024 029 030 031 029 035 034 028 028 027 028 027 033 031
+Job
+022 013 026 021 027 030 021 022 035 022 020 025 028 022 035 022 016 021 029 029 034 030 017 025 006 014 023 028 025 031 040 022 033 037 016 033 024 041 030 024 034 017
+Song of Songs|Song of Solomon
+017 017 011 016 016 013 013 014
+Ruth
+022 023 018 022
+Lamentations
+022 022 066 022 022
+Ecclesiastes
+018 026 022 016 020 012 029 017 018 020 010 014
+Esther
+022 023 015 017 014 014 010 017 032 003
+Daniel
+021 049 030 037 031 028 028 027 027 021 045 013
+Ezra
+011 070 013 024 017 022 028 036 015 044 011 020 032 023 019 019 073 018 038 039 036 047 031
+Chronicles
+054 055 024 043 026 081 040 040 044 014 047 040 014 017 029 043 027 017 019 008 030 019 032 031 031 032 034 021 030 017 018 017 022 014 042 022 018 031 019 023 016 022 015 019 014 019 034 011 037 020 012 021 027 028 023 009 027 036 027 021 033 025 033 027 023
diff --git a/Build/source/utils/songs/songs-2.17/src/songidx/titleidx.c b/Build/source/utils/songs/songs-2.17/src/songidx/titleidx.c
new file mode 100644
index 00000000000..9ead78009bc
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songidx/titleidx.c
@@ -0,0 +1,375 @@
+/* Copyright (C) 2013 Kevin W. Hamlen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * The latest version of this program can be obtained from
+ * http://songs.sourceforge.net.
+ */
+
+
+/* Create a LaTeX title index file from a title .sxd file. */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "vsconfig.h"
+#endif
+
+#include "chars.h"
+#include "songidx.h"
+#include "fileio.h"
+
+#if HAVE_STRING_H
+# include <string.h>
+#elif HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+/* By convention, some word prefixes always get moved to the end of a title
+ * before it is indexed. For example, in English "The Song Title" becomes
+ * "Song Title, The". The following structure stores the list of these prefix
+ * words. The default is "The" and "A". */
+typedef struct prefix
+{
+ struct prefix *next;
+ WCHAR *s;
+}
+PREFIX;
+
+PREFIX pre_A = { NULL, ws_lit("A") };
+PREFIX pre_defaults = { &pre_A, ws_lit("The") };
+
+/* freeprefixes(<list>)
+ * Free prefix list <list>. */
+static void
+freeprefixes(pl)
+ PREFIX *pl;
+{
+ if (pl == &pre_defaults) return;
+ while (pl)
+ {
+ PREFIX *nxt = pl->next;
+ free(pl->s);
+ free(pl);
+ pl = nxt;
+ }
+}
+
+/* rotate(<title>, <prelist>)
+ * If the first word of <title> is any word in list <prelist>, then <title>
+ * is modified in-place so that the word is shifted to the end of the string
+ * and preceded by a comma and a space. So for example, rotate("The Title",
+ * <prelist>) where <prelist> is the default results in "Title, The". Words
+ * in <prelist> are matched case-insensitively. If <title> begins with the
+ * marker character '*', that character is ignored and left unchanged. Note
+ * that <title> MUST be allocated with ONE EXTRA WCHAR OF STORAGE in order
+ * to leave room for the extra comma.
+ * Return Value: 1 if <title> was modified and 0 otherwise. */
+static int
+rotate(s,pl)
+ WCHAR *s;
+ PREFIX *pl;
+{
+ const WCHAR *s2, *w2;
+
+ w2 = NULL;
+ if (*s==wc_asterisk) ++s;
+ for (; pl; pl=pl->next)
+ {
+ for (s2=s, w2=pl->s; *w2; ++s2, ++w2)
+ if (wc_tolower(*s2)!=wc_tolower(*w2)) break;
+ if ((*w2 == wc_null) && (*s2 != wc_null) && !wc_isalpha(*s2)) break;
+ }
+ if (pl)
+ {
+ WCHAR buf[MAXLINELEN];
+ size_t slen = ws_strlen(s);
+ size_t wlen = w2 - pl->s;
+ ws_strncpy(buf, s, wlen);
+ buf[wlen] = wc_null;
+ ws_memmove(s, s+wlen+1, slen-wlen-1);
+ *s = wc_toupper(*s);
+ *(s+slen-wlen-1) = wc_comma;
+ *(s+slen-wlen) = wc_tilda;
+ ws_strcpy(s+slen-wlen+1, buf);
+ return 1;
+ }
+ return 0;
+}
+
+/* getstartchar(<string>)
+ * Find the first non-escaped, alphanumeric character of <string> if any.
+ * If alphabetic, return it in upper case. If numeric, return '#'. If
+ * none, return space. */
+static WCHAR
+getstartchar(s)
+ const WCHAR *s;
+{
+ if (!s) return wc_space;
+ skipesc(&s,0,0);
+ while (*s && !wc_isalpha(*s) && !wc_isdigit(*s))
+ {
+ ++s;
+ skipesc(&s,0,0);
+ }
+ return wc_isalpha(*s) ? wc_toupper(*s) : (*s ? wc_hash : wc_space);
+}
+
+/* freesongarray(<array>,<len>)
+ * Free song array <array>, which should have length <len>. */
+static void
+freesongarray(songs,len)
+ SONGENTRY **songs;
+ int len;
+{
+ int i;
+
+ if (!songs) return;
+ for (i=0; i<len; ++i)
+ {
+ if (songs[i])
+ {
+ if (songs[i]->title) free(songs[i]->title);
+ if (songs[i]->num) free(songs[i]->num);
+ if (songs[i]->linkname) free(songs[i]->linkname);
+ free(songs[i]);
+ }
+ }
+ free(songs);
+}
+
+/* gentitleindex(<file>,<outname>)
+ * Reads a title index data file from file handle <file> and generates a new
+ * file named <outfile> containing a LaTeX title index.
+ * Return Value: 0 on success, 1 on warnings, or 2 on failure */
+int
+gentitleindex(fs,outname)
+ FSTATE *fs;
+ const char *outname;
+{
+ FILE *f;
+ int eof = 0;
+ int numsongs, arraysize, i;
+ PREFIX *prelist = &pre_defaults;
+ SONGENTRY **songs;
+ WCHAR buf[MAXLINELEN], *bp;
+ WCHAR startchar;
+
+ fprintf(stderr, "songidx: Parsing title index data file %s...\n",
+ fs->filename);
+
+ songs = NULL;
+ eof = 0;
+ for (arraysize=numsongs=0; !eof; ++numsongs)
+ {
+ if (!filereadln(fs,buf,&eof))
+ {
+ freesongarray(songs,numsongs);
+ return 2;
+ }
+ if (eof) break;
+ if (buf[0] == wc_percent)
+ {
+ if (!ws_strncmp(buf, wc_lit("%prefix "), 8))
+ {
+ PREFIX *temp = (prelist==&pre_defaults) ? NULL : prelist;
+ prelist = (PREFIX *) malloc(sizeof(PREFIX));
+ prelist->next = temp;
+ prelist->s = (WCHAR *) calloc(ws_strlen(buf)-7, sizeof(WCHAR));
+ ws_strcpy(prelist->s, buf+8);
+ }
+ --numsongs;
+ continue;
+ }
+ if (numsongs >= arraysize)
+ {
+ SONGENTRY **temp;
+ arraysize *= 2;
+ if (arraysize==0) arraysize=64;
+ temp = (SONGENTRY **) realloc(songs,arraysize*sizeof(SONGENTRY *));
+ if (!temp)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many songs (out of memory)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs);
+ return 2;
+ }
+ songs = temp;
+ }
+ if ((songs[numsongs] = (SONGENTRY *) malloc(sizeof(SONGENTRY))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many songs (out of memory)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs);
+ return 2;
+ }
+ songs[numsongs]->title = songs[numsongs]->num =
+ songs[numsongs]->linkname = NULL;
+ for (bp=buf+ws_strlen(buf)-1; (bp > buf) && wc_isspace(*bp); --bp) ;
+ if (wc_isspace(*bp)) *bp = wc_null;
+ for (bp=buf; wc_isspace(*bp); ++bp) ;
+ /* The following allocates one extra char of storage because we might add
+ * a comma later. */
+ if ((songs[numsongs]->title =
+ (WCHAR *) calloc(ws_strlen(bp)+2, sizeof(WCHAR))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many songs (out of memory)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ ws_strcpy(songs[numsongs]->title, bp);
+ rotate(songs[numsongs]->title, prelist);
+ if (!filereadln(fs,buf,&eof))
+ {
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete song entry (orphan title)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ if ((songs[numsongs]->num =
+ (WCHAR *) calloc(ws_strlen(buf)+1, sizeof(WCHAR))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many songs (out of memory)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ ws_strcpy(songs[numsongs]->num, buf);
+ if (!filereadln(fs,buf,&eof))
+ {
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ if (eof)
+ {
+ fprintf(stderr, "songidx:%s:%d: incomplete song entry"
+ " (missing hyperlink)\n", fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs+1);
+ return 2;
+ }
+ if ((songs[numsongs]->linkname =
+ (WCHAR *) calloc(ws_strlen(buf)+1, sizeof(WCHAR))) == NULL)
+ {
+ fprintf(stderr, "songidx:%s:%d: too many songs (out of memory)\n",
+ fs->filename, fs->lineno);
+ freeprefixes(prelist);
+ freesongarray(songs,numsongs);
+ return 2;
+ }
+ ws_strcpy(songs[numsongs]->linkname, buf);
+ songs[numsongs]->idx = numsongs;
+ }
+ fileclose(fs);
+ freeprefixes(prelist);
+
+ /* Sort the song array */
+ qsort(songs, numsongs, sizeof(*songs), songcmp);
+
+ /* Write the sorted data out to the output file. */
+ fprintf(stderr, "songidx: Generating title index TeX file %s...\n", outname);
+ if (strcmp(outname,"-"))
+ {
+ if ((f = fopen(outname, "w")) == NULL)
+ {
+ fprintf(stderr, "songidx: Unable to open %s for writing.\n", outname);
+ return 2;
+ }
+ }
+ else
+ {
+ f = stdout;
+ outname = "stdout";
+ }
+
+#define TRYWRITE(x) \
+ if (!(x)) \
+ { \
+ fprintf(stderr, "songidx:%s: write error\n", outname); \
+ if (f == stdout) fflush(f); else fclose(f); \
+ freesongarray(songs,numsongs); \
+ return 2; \
+ }
+
+ startchar = 0;
+ for (i=0; i<numsongs; ++i)
+ {
+ if ((i>0) && !ws_coll(songs[i]->title, songs[i-1]->title))
+ {
+ TRYWRITE((ws_fputs(ws_lit("\\\\\\songlink{"), f) >= 0) &&
+ (ws_fputs(songs[i]->linkname, f) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (ws_fputs(songs[i]->num, f) >= 0) &&
+ (ws_fputc(wc_rbrace, f) == wc_rbrace))
+ }
+ else
+ {
+ WCHAR c = getstartchar(songs[i]->title);
+ if (startchar != c)
+ {
+ startchar = c;
+ TRYWRITE((ws_fputs((i<=0) ? ws_lit("\\begin{idxblock}{")
+ : ws_lit("}\n\\end{idxblock}\n\\begin{idxblock}{"), f) >= 0)
+ && ((startchar!=wc_hash) ||
+ (ws_fputc(wc_backslash, f)==wc_backslash))
+ && (ws_fputc(startchar, f)==startchar))
+ }
+ if (songs[i]->title[0] == wc_asterisk)
+ {
+ TRYWRITE((ws_fputs(ws_lit("}\n\\idxaltentry{"), f) >= 0) &&
+ (ws_fputs(songs[i]->title+1, f) >= 0) &&
+ (ws_fputs(ws_lit("}{\\songlink{"), f) >= 0) &&
+ (ws_fputs(songs[i]->linkname, f) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (ws_fputs(songs[i]->num, f) >= 0) &&
+ (ws_fputc(wc_rbrace, f) == wc_rbrace))
+ }
+ else
+ {
+ TRYWRITE((ws_fputs(ws_lit("}\n\\idxentry{"), f) >= 0) &&
+ (ws_fputs(songs[i]->title, f) >= 0) &&
+ (ws_fputs(ws_lit("}{\\songlink{"), f) >= 0) &&
+ (ws_fputs(songs[i]->linkname, f) >= 0) &&
+ (ws_fputs(ws_lit("}{"), f) >= 0) &&
+ (ws_fputs(songs[i]->num, f) >= 0) &&
+ (ws_fputc(wc_rbrace, f) == wc_rbrace))
+ }
+ }
+ }
+ if (numsongs>0)
+ {
+ TRYWRITE(ws_fputs(ws_lit("}\n\\end{idxblock}\n"), f) >= 0)
+ }
+
+#undef TRYWRITE
+
+ if (f == stdout) fflush(f); else fclose(f);
+ freesongarray(songs,numsongs);
+ return 0;
+}
diff --git a/Build/source/utils/songs/songs-2.17/src/songs/GNUmakefile.am b/Build/source/utils/songs/songs-2.17/src/songs/GNUmakefile.am
new file mode 100644
index 00000000000..e2ab1b3fe94
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songs/GNUmakefile.am
@@ -0,0 +1,54 @@
+docdir = ${datadir}/doc/${PACKAGE}
+doc_DATA = songs.pdf
+EXTRA_DIST = Makefile songs.dtx songs.ins
+SUFFIXES = .sty .ins .dtx .dvi .pdf .ps
+
+all-local: songs.sty songs.pdf
+
+dvi-local: songs.dvi
+
+ps-local: songs.ps
+
+pdf-local: songs.pdf
+
+%.sty: %.ins %.dtx
+ $(latex) $<
+
+%.dvi: %.dtx %.sty
+ $(latex) $<
+ $(makeindex) -s gind.ist -o $*.ind $*.idx
+ $(makeindex) -s gglo.ist -o $*.gls $*.glo
+ $(latex) $<
+ $(makeindex) -s gind.ist -o $*.ind $*.idx
+ $(makeindex) -s gglo.ist -o $*.gls $*.glo
+ $(latex) $<
+
+%.pdf: %.dtx %.sty
+ $(pdflatex) $<
+ $(makeindex) -s gind.ist -o $*.ind $*.idx
+ $(makeindex) -s gglo.ist -o $*.gls $*.glo
+ $(pdflatex) $<
+ $(makeindex) -s gind.ist -o $*.ind $*.idx
+ $(makeindex) -s gglo.ist -o $*.gls $*.glo
+ $(pdflatex) $<
+
+%.ps: %.dvi
+ $(dvips) $< -o $@
+
+installdirs-local:
+ -$(MKDIR_P) $(DESTDIR)$(texmfdir)/tex/latex/songs
+
+install-data-local: songs.sty
+ -$(MKDIR_P) $(DESTDIR)$(texmfdir)/tex/latex/songs
+ $(INSTALL_DATA) songs.sty $(DESTDIR)$(texmfdir)/tex/latex/songs
+ $(texhash)
+
+uninstall-local:
+ -rm -rf $(DESTDIR)$(texmfdir)/tex/latex/songs
+
+mostlyclean-local:
+ -rm -f *.aux *.log *.out *.ind *.idx *.gls *.glo *.ilg
+
+clean-local:
+ -rm -f songs.sty songs.dvi songs.pdf songs.ps
+
diff --git a/Build/source/utils/songs/songs-2.17/src/songs/Makefile b/Build/source/utils/songs/songs-2.17/src/songs/Makefile
new file mode 100644
index 00000000000..541958b50bb
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songs/Makefile
@@ -0,0 +1,5 @@
+.DEFAULT:
+ @echo This software requires a GNU-compatible make program.
+ @echo Please try "gmake" or "gnumake" instead of "make".
+ @false
+
diff --git a/Build/source/utils/songs/songs-2.17/src/songs/songs.dtx b/Build/source/utils/songs/songs-2.17/src/songs/songs.dtx
new file mode 100644
index 00000000000..d8a800fa09f
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songs/songs.dtx
@@ -0,0 +1,12090 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2013 Kevin W. Hamlen
+%
+% This program is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License
+% as published by the Free Software Foundation; either version 2
+% of the License, or (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+% MA 02110-1301, USA.
+%
+% The latest version of this program can be obtained from
+% http://songs.sourceforge.net.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{songs.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{songs}
+%<*package>
+ [2013/07/10 v2.17 Songs package]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[bookmarks]{hyperref}
+\usepackage[nopdfindex]{songs}
+\let\oldSE\StopEventually
+
+% Configure the document:
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%\OnlyDescription
+
+% Create the \Songs logo, if appropriate fonts are available:
+\IfFileExists{harmony.sty}{
+ \usepackage{harmony}
+ \usepackage{graphics}
+ \newcommand\Songs{\texorpdfstring{{\sffamily s\kern.07ex\resizebox{!}{1ex}{\Ganz}\kern-.09ex ngs}}{songs}}
+}{
+ \newcommand\Songs{\texorpdfstring{{\sffamily songs}}{songs}}
+}
+
+% Create the logo for Christopher Rath's Songbook package:
+\newcommand{\Rath}{{\sffamily Song$\flat$ook}}
+
+% Define some environments to simulate the interior of a verse,
+% for showing samples in the documentation:
+{\makeatletter
+ \gdef\likeverse{%
+ \SB@insongtrue\SB@inversetrue%
+ \SB@loadactives%
+ \global\SB@ctail\SB@cr@%
+ }
+ \gdef\chordheight{\SB@setbaselineskip}
+}
+
+% Typeset a block of LaTeX code:
+\newenvironment{codeblock}{%
+ \medskip%
+ \vbox\bgroup\begingroup%
+ \narrower\rightskip=0pt plus1fil%
+ \parindent=0pt%
+ \obeylines%
+}{%
+ \endgroup\egroup%
+ \medskip%
+}
+
+% Typeset a sample song or scripture quotation:
+\songcolumns{0}
+\newenvironment{sample}{%
+ \medskip%
+ \noindent\hfil%
+ \vbox\bgroup%
+ \hsize.5\hsize%
+ \advance\hsize-.5\columnsep%
+ \versesep=5pt%
+}{%
+ \egroup%
+ \medskip%
+}
+
+% Typeset a sample lyric book fragment:
+\newenvironment{lyrics}{%
+ \medskip%
+ \noindent\hfil%
+ \vbox\bgroup\begingroup%
+ \hsize=.7\textwidth%
+ \leftskip=20pt\rightskip=0pt plus1fil%
+ \parindent=-20pt%
+ \likeverse\obeylines%
+}{%
+ \par\endgroup\egroup%
+ \hfil\par%
+ \medskip%
+}
+
+% Typeset a sample chord book fragment:
+\newenvironment{chorded}{%
+ \medskip%
+ \noindent\hfil%
+ \vbox\bgroup\begingroup%
+ \hsize=.7\textwidth%
+ \leftskip=20pt\rightskip=0pt plus1fil%
+ \parindent=-20pt%
+ \likeverse\obeylines%
+ \versesep=5pt\chordheight%
+}{%
+ \par\endgroup\egroup%
+ \hfil\par%
+ \medskip%
+}
+
+% Typeset a "<code> produces <text>" example:
+\newlength\prodlen
+\setlength{\prodlen}{2.7in}
+\newbox\prodbox
+\newcommand{\example}{%
+ \medskip\setbox\prodbox\hbox\bgroup%
+}
+\newcommand{\produces}{%
+ \egroup%
+ \indent%
+ \vbox{\hbox to\prodlen{\unhbox\prodbox\hfil}}%
+ \ {\it produces}\quad%
+ \afterassignment\prodprefix%
+ \setbox\prodbox\hbox}
+\newcommand{\prodprefix}{%
+ \likeverse\chordheight%
+ \aftergroup\prodsuffix}
+\newcommand{\prodsuffix}{\unhbox\prodbox\par\medskip}
+\newbox\vcbox
+\newdimen\vcadjust
+\newcommand{\vcenterbox}[1]{%
+ \setbox\vcbox\vbox{\hbox{#1}}%
+ \vcadjust=.5\ht\vcbox%
+ \advance\vcadjust by-6pt%
+ \lower\vcadjust\box\vcbox%
+}
+
+% Recode \DescribeMacro and \DescribeEnv to make nice pdfbookmark entries.
+% Also create some \MainImpl macros that make pdfbookmarks to help the reader
+% find the "real" implementations of important macros.
+\newcount\seclevel%
+\newcommand{\getseclevel}{%
+ \ifnum\value{subsection}=0 \seclevel=2 %
+ \else\ifnum\value{subsubsection}=0 \seclevel=3 %
+ \else\seclevel=4 \fi\fi%
+}
+{\makeatletter
+ \xdef\bschar{\@backslashchar}
+ \global\let\For\@for}
+\newcommand\DescMacro[1]{%
+ \getseclevel%
+ \pdfbookmark[\the\seclevel]{\bschar\bschar#1}{macdef-#1}%
+ \expandafter\DescribeMacro\expandafter{\csname#1\endcsname}%
+ \hyperdef{macro}{#1}{}\kern0pt%
+}
+\newcommand\DescMacroGroup[3]{%
+ \getseclevel%
+ \pdfbookmark[\the\seclevel]{\bschar\bschar#2}{macdef-#1}%
+ \expandafter\DescribeMacro\expandafter{\csname#2\endcsname}%
+ \For\temp:=#3\do{\hyperdef{macro}{\temp}{}}%
+}
+\newcommand\MainImpl[1]{%
+ \pdfbookmark[3]{\bschar\bschar#1}{mimpl-#1}%
+}
+\newcommand{\DescEnv}[1]{%
+ \getseclevel%
+ \pdfbookmark[\the\seclevel]{#1}{envdef-#1}%
+ \DescribeEnv{#1}%
+ \hyperdef{env}{#1}{}\kern0pt%
+}
+\newcommand{\MainEnvImpl}[1]{%
+ \getseclevel%
+ \pdfbookmark[\the\seclevel]{#1}{eimpl-#1}%
+}
+
+% Create macros to hyperlink macro and environment names to their
+% documentation points.
+\newcommand{\mac}[1]{{\tt\hyperlink{macro.#1}{\char92 #1}}}
+\newcommand{\env}[1]{{\tt\hyperlink{env.#1}{#1}}}
+
+% Defining bookmarks for definitions of active characters is a little trickier
+% because many of these characters have special meanings either to TeX or to
+% PDF. The only reliable way is to insert an "\ooo" escape sequence into the
+% bookmark text, where ooo is the ascii number of the character expressed in
+% octal. To achieve this, we use `\string<symbol> to obtain the decimal
+% ascii number d of the symbol, then do some math (implemented in \octalize)
+% to compute the decimal number n whose digits correspond to the octal
+% representation of d, and then write n to the bookmark text using \the.
+\newcount\cnta
+\newcount\cntb
+\newcount\cntc
+\newcommand{\octalize}[2]{%
+ \cntb\cnta
+ \divide\cntb#1
+ \multiply\cntb#2
+ \advance\cntc\cntb
+ \divide\cntb#2
+ \multiply\cntb#1
+ \advance\cnta-\cntb
+}
+\newcommand{\DescChar}[2]{%
+ \expandafter\let\csname string#1\expandafter\endcsname
+ \expandafter=\string#2%
+ \getseclevel
+ \cnta\expandafter`\string#2%
+ \cntc0
+ \octalize{64}{100}%
+ \octalize{8}{10}%
+ \octalize{1}{1}%
+ \pdfbookmark[\the\seclevel]{\bschar\the\cntc}{#1def}%
+ \expandafter\DescribeEnv\string#2%
+ \hyperdef{env}{#1}{}\kern0pt%
+}
+\newcommand{\refchar}[1]{{\tt\hyperlink{env.#1}{\csname string#1\endcsname}}}
+
+% At the end of the implementation section we'll have a code line index of
+% macro definitions and usages. To make it look a bit less ragged than the
+% default index style and to conserve some space, we'll customize a few of
+% the parameters:
+
+\IndexPrologue{%
+ \subsection{Codeline Index}%
+ Numbers underlined refer to the code line where the corresponding entry
+ is defined; numbers in roman refer to the code lines where the entry
+ is used.}
+
+{\makeatletter
+
+ \gdef\IndexParms{%
+ \sfcode`,=1750
+ \parindent0pt
+ \columnsep15pt
+ \parskip0pt plus1pt
+ \rightskip0pt
+ \mathsurround0pt
+ \parfillskip0pt
+ \small
+ \def\@idxitem{\par\hangindent15pt}%
+ \def\subitem{\@idxitem\hspace*{15pt}}%
+ \def\subsubitem{\@idxitem\hspace*{25pt}}%
+ \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}}
+
+ \gdef\SpecialMainOptIndex#1{%
+ \@bsphack
+ \special@index{%
+ #1\actualchar{\string\ttfamily\space#1} (option)\encapchar main}%
+ \special@index{%
+ options:\levelchar
+ #1\actualchar{\string\ttfamily\space#1}\encapchar main}%
+ \@esphack}
+}
+
+% Create a conditional that typesets its first argument if we're including
+% the implementation section, otherwise typesets its second argument.
+\newcommand\ImplOrDesc[2]{%
+ \ifx\StopEventually\oldSE#1\else#2\fi%
+}
+
+% Hyphenating the word "choruses" looks weird. No "ruses" please!
+\hyphenation{choruses}
+
+% An environment for describing the implementation of a package option:
+\let\oldsmei\SpecialMainEnvIndex
+\newenvironment{option}[1]{%
+ \let\SpecialMainEnvIndex\SpecialMainOptIndex%
+ \begin{environment}{#1}%
+ \let\SpecialMainEnvIndex\oldsmei%
+}{%
+ \end{environment}%
+ \let\SpecialMainEnvIndex\oldsmei%
+}
+
+% Describe the default setting for an option:
+\newcommand\optdef[1]{\noindent{\it(Default: #1)}\hspace{.5cm}}
+
+% Typeset a chord name:
+\newcommand{\chord}[1]{{\sffamily\slshape#1}}
+
+% Here are a few macros to produce nice syntax parameters:
+\newcommand{\argp}[1]{\meta{arg#1}}
+\newcommand\Meta[1]{\textrm{\meta{#1}}}
+\newcommand\OR{\,$\mid$\,}
+\newcommand\SPC{\char`\ }
+
+% Now let's quell those annoying "Marginpar has moved" warning messages.
+{\makeatletter
+ \global\let\oldamp=\@addmarginpar
+ \global\let\oldlwnl=\@latex@warning@no@line
+ \gdef\@addmarginpar{%
+ \let\@latex@warning@no@line\@gobble%
+ \oldamp%
+ \let\@latex@warning@no@line\oldlwnl%
+ }
+}
+
+% The \eat macro just gobbles its argument. I use it to appease my syntax
+% highlighter when it gets confused.
+\newcommand{\eat}[1]{}
+
+\begin{document}
+ \DocInput{songs.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{8731}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \changes{v1.0}{2001/12/01}{Initial version}
+% \changes{v1.1}{2005/04/03}{Change log introduced and first release of this documentation}
+% \changes{v1.17}{2005/09/24}{Transformed the source from a class to a package}
+% \changes{v1.18}{2005/09/29}{Verse numbering added}
+% \changes{v2.0}{2007/06/20}{Keyval syntax and chord-replay system added}
+%
+% \iffalse
+% Here we list all the macros that should not be indexed because they are:
+% (a) too common and therefore the index would be too large if we listed them,
+% (b) not useful in an index because they are predefined TeX macros, or
+% (c) not really macros but rather control sequence names given to \string.
+% \fi
+% \DoNotIndex{\@M,\@depth,\@empty,\@firstofone,\@firstoftwo,\@gobble,\@gobbletwo,\@height,\@m,\@minus,\@ne,\@plus,\@secondoftwo,\@width,\m@ne,\p@,\thr@@,\tw@,\voidb@x,\@xpt,\z@,\z@skip}
+% \DoNotIndex{\advance,\char,\count,\divide,\font,\fontdimen,\maxdimen,\multiply,\setcounter,\setlength,\settoheight,\settowidth,\stepcounter}
+% \DoNotIndex{\begin,\begingroup,\bgroup,\egroup,\end,\endgroup}
+% \DoNotIndex{\box,\copy,\dp,\hbox,\ht,\leavevmode,\lower,\null,\prevdepth,\raise,\rlap,\setbox,\unhbox,\unhcopy,\unpenalty,\unskip,\unvbox,\unvcopy,\vbox,\vtop,\wd}
+% \DoNotIndex{\csname,\def,\edef,\endcsname,\futurelet,\gdef,\global,\let,\long,\mathchardef,\newcommand,\renewcommand,\renewenvironment,\xdef}
+% \DoNotIndex{\@ifundefined,\@for,\do,\else,\fi,\ifcase,\ifcat,\ifdim,\iffalse,\ifhmode,\ifmmode,\ifinner,\ifnum,\ifodd,\ifvbox,\ifvmode,\ifvoid,\ifx,\loop,\or,\repeat,\undefined}
+% \DoNotIndex{\afterassignment,\aftergroup,\expandafter,\ignorespaces,\immediate,\noexpand,\protect,\relax,\space,\string,\the}
+% \DoNotIndex{\hfil,\hfilneg,\hskip,\hss,\indent,\kern,\nobreak,\noindent,\nointerlineskip,\offinterlineskip,\par,\penalty,\strut,\thinspace,\vadjust,\vfil,\vfilneg,\vphantom,\vskip}
+% \DoNotIndex{\@octets,\four,\three,\two,\UTFviii@,\UTFviii@zero@octets,\0,\1,\2,\3,\4,\5,\6,\7,\8,\9,\X,\O}
+%
+%
+% \GetFileInfo{songs.dtx}
+%
+% \title{The \Songs{} package\thanks{This document corresponds to
+% \textsf{songs}~\fileversion, dated~\filedate,
+% \copyright~2013 Kevin W.~Hamlen, and
+% distributed under version~2 the GNU General Public License
+% as published by the Free Software Foundation.}}
+% \author{Kevin W. Hamlen}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \Songs{} package produces songbooks that contain lyrics and chords
+% (but not full sheet music).
+% It allows lyric books, chord books, overhead slides, and digital projector
+% slides to all be maintained and generated from a single \LaTeX{} source
+% document.
+% Automatic transposition, guitar tablature diagrams, handouts, and
+% a variety of specialized song indexes are supported.
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% The \Songs{} \LaTeX{} package produces books of songs that contain lyrics and
+% (optionally) chords.
+% A single source document yields a lyric book for singers, a chord book for
+% musicians, and overhead or digital projector slides for corporate singing.
+%
+% The software is especially well suited for churches and religious
+% fellowships desiring to create their own books of worship songs.
+% Rather than purchasing a fixed hymnal of songs, the \Songs{} package allows
+% worship coordinators to maintain a constantly evolving repertoire of music
+% to which they can add and remove songs over time.
+% As the book content changes, the indexes, spacing, and other formatting
+% details automatically adjust to stay consistent.
+% Songs can also be quickly selected and arranged for specific events or
+% services through the use of scripture indexes, automatic transposition,
+% and handout and slide set creation features.
+%
+% \section{Terms of Use}
+%
+% \noindent
+% The \Songs{} package is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License
+% as published by the Free Software Foundation; either version~2
+% of the License, or (at your option) any later version.
+% A copy of the license can be found in \S\ref{sec:license}.
+%
+% \medskip
+%
+% \noindent
+% This program is distributed in the hope that it will be useful,
+% but {\sc without any warranty}; without even the implied warranty of
+% {\sc merchantability} or {\sc fitness for a particular purpose}. See the
+% GNU General Public License in \S\ref{sec:license} for more details.
+% A copy of the license can also be obtained by writing to the
+% Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+% Boston, MA 02110-1301, USA.
+%
+% \medskip
+%
+% \noindent
+% This software is copyright \copyright~2013 Kevin W.~Hamlen.
+% For contact information or the latest version, see the project webpage at:
+%
+% \vskip1.5ex
+% \begingroup\centering\noindent
+% \href{http://songs.sourceforge.net}{{\tt http://songs.sourceforge.net}}\par
+% \endgroup
+%
+% \section{Sample Document}
+%
+% For those who would like to start making song books quickly, the
+% following is a sample document that yields a simple song book with
+% one song and one title index.
+% Starting from this template, you can begin to add songs and customizations
+% to create a larger book.
+% Instructions for compiling this sample song book follow the listing.
+%
+% \begin{verbatim}
+% \documentclass{article}
+% \usepackage[chorded]{songs}
+%
+% \newindex{titleidx}{titleidx}
+% \noversenumbers
+%
+% \begin{document}
+% \showindex{Complete Index of Songs}{titleidx}
+% \songsection{Worship Songs}
+%
+% \begin{songs}{titleidx}
+% \beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
+% sr={Revelation 5:13},
+% cr={Public domain.},
+% index={Praise God, from Whom all blessings flow}]
+% \beginverse
+% \[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;
+% \[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;
+% \[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav'n\[D]ly \[Em]host;
+% \[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.
+% \[C]A\[G]men.
+% \endverse
+% \endsong
+% \end{songs}
+%
+% \end{document}
+% \end{verbatim}
+%
+% To compile this book, execute three commands.
+% First, use \LaTeX{} (|pdflatex| is recommended) to compile the document:
+%
+% \begin{codeblock}
+% |pdflatex mybook.tex|
+% \end{codeblock}
+%
+% \noindent
+% (where |mybook.tex| is the name of the source document above).
+% Next, use the |songidx| program provided with this distribution to
+% generate the indexes:
+%
+% \begin{codeblock}
+% |songidx titleidx.sxd titleidx.sbx|
+% \end{codeblock}
+%
+% \noindent
+% Finally, regenerate the document using \LaTeX{} so that the newly
+% generated index data will be included:
+%
+% \begin{codeblock}
+% |pdflatex mybook.tex|
+% \end{codeblock}
+%
+% \noindent
+% The final document is named |mybook.pdf| if you use |pdflatex| or
+% |mybook.dvi| if you use regular |latex|.
+%
+% \begin{figure}
+% \noindent\vbox{\begingroup\hsize=352pt
+% \versesep=12pt\columnsep=7pt\parindent=20pt
+% \def\colbotglue{0pt}\def\lastcolglue{0pt}
+% \baselineadj=-1pt\relax
+% \noversenumbers
+% \setlength\textwidth{352pt}
+% \setlength\textheight{498pt}
+% \songcolumns{2}
+% \vskip-3.5ex plus-1ex minus-.2ex
+% \nointerlineskip\null\nointerlineskip
+% \songsection*{Worship Songs}
+% \begin{songs}{}
+% \beginsong{Doxology}[
+% by={Louis Bourgeois and Thomas Ken},
+% sr={Revelation 5:13},
+% cr={Public domain.}]
+% \beginverse
+% \[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;
+% \[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;
+% \[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav'n\[D]ly \[Em]host;
+% \[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.
+% \[C]A\[G]men.
+% \endverse
+% \endsong\eat\]
+% \parindent=15pt
+% \beginscripture{Psalm 18:2-6}
+% \Acolon The LORD is my rock and my fortress and my deliverer,
+% \Bcolon my God, my rock, in whom I take refuge,
+% \Bcolon my shield, and the horn of my salvation, my stronghold.
+% \Acolon I call upon the LORD, who is worthy to be praised,
+% \Bcolon and I am saved from my enemies.
+% \strophe
+% \Acolon The cords of death encompassed me;
+% \Bcolon the torrents of destruction assailed me;
+% \Acolon the cords of Sheol entangled me;
+% \Bcolon the snares of death confronted me.
+% \strophe
+% \Acolon In my distress I called upon the LORD;
+% \Bcolon to my God I cried for help.
+% \Acolon From his temple he heard my voice,
+% \Bcolon and my cry to him reached his ears.
+% \endscripture
+% \parindent=20pt
+% \beginsong{A Mighty Fortress Is Our God}[
+% by={Martin Luther},
+% cr={Public Domain.}]
+% \beginverse
+% A \[A]mighty \[C#m]Fortress \[B7]is our \[E]God,
+% A \[D]bulwark \[A]never \[E7]fail\[A]ing.
+% Our helper \[C#m]He, a\[B7]mid the \[E]flood
+% Of \[D]mortal \[A]ills pre\[E7]vail\[A]ing.
+% For still our \[B7sus4]an\[B7]cient \[E]foe
+% Doth \[A]seek to \[E/G#]work us \[F#m]woe;
+% His craft and \[B7]pow'r are \[E]great,
+% And, \[Bm]armed with cruel \[C#]hate,
+% On \[D]earth is \[A]not his \[E7]e\[A]qual.
+% \endverse
+% \beginverse
+% Did ^we in ^our own ^strength con^fide,
+% Our ^striving ^would be ^los^ing.
+% Were not the ^right Man ^on our ^side,
+% The ^Man of ^God's own ^choos^ing.
+% Dost ask who ^that ^may ^be?
+% Christ ^Jesus, ^it is ^He;
+% Lord Saba^oth His ^Name,
+% From ^age to age the ^same;
+% And ^He must ^win the ^bat^tle.
+% \endverse
+% \endsong\eat\]
+% \end{songs}
+% \endgroup}\par
+% \caption{Sample page from a chord book}\label{fig:sample}
+% \end{figure}
+% A copy of the first page of a sample song section is shown in
+% Figure~\ref{fig:sample}.
+% The page shown in that figure is from a chorded version of the book.
+% When generating a lyric version, the chords are omitted.
+% See \S\ref{sec:options} for information on how to generate different
+% versions of the same book.
+%
+% \section{Initialization and Options}\label{sec:options}
+%
+% Each \LaTeX{} document that uses the \Songs{} package should contain a
+% line like the following near the top of the document:
+%
+% \begin{codeblock}
+% |\usepackage[|\meta{options}|]{songs}|
+% \end{codeblock}
+%
+% \noindent
+% Supported \meta{options} include the following:
+%
+% \paragraph{Output Type.}
+% \DescEnv{lyric}
+% \DescEnv{chorded}
+% \DescEnv{slides}
+% \DescEnv{rawtext}
+% The \Songs{} package can produce four kinds of books: lyric books, chord
+% books, books of overhead slides, and raw text output.
+% You can specify which kind of book is to be produced by specifying one of
+% |lyric|, |chorded|, |slides|, or |rawtext| as an option.
+% If none of these are specified, |chorded| is the default.
+%
+% Lyric books omit all chords, whereas chord books include chords and
+% additional information for musicians (specified using \mac{musicnote}).
+% Books of overhead slides omit all chords and typeset
+% one song per page in a large font, centered.
+%
+% Raw text output yields an ascii text file named \meta{jobname}|.txt|
+% (where \meta{jobname} is the root filename) containing lyrics without chords.
+% This can be useful for importing song books into another program, such as a
+% spell-checker.
+%
+% \DescMacro{chordson}
+% \DescMacro{chordsoff}
+% Chords can be turned on or off in the middle of the document
+% by using the |\chordson| or |\chordsoff| macros.
+%
+% \DescMacro{slides}
+% Slides mode can be activated in the middle of the document by using the
+% |\slides| macro.
+% For best results, this should typically only be done in the document
+% preamble or at the beginning of a fresh page.
+%
+% \paragraph{Measure Bars.}
+% \DescEnv{nomeasures}
+% \DescEnv{showmeasures}
+% \DescMacro{measureson}
+% \DescMacro{measuresoff}
+% The \Songs{} package includes a facility for placing measure bars in chord
+% books (see \S\ref{sec:measures}).
+% To omit these measure bars, use the |nomeasures| option;
+% to display them, use the |showmeasures| option (the default).
+% Measure bars can also be turned on or off in the middle of the document by
+% using the |\measureson| or |\measuresoff| macros.
+%
+% \paragraph{Transposition.}
+% \DescEnv{transposecapos}
+% The |transposecapos| option changes the effect of the \mac{capo} macro.
+% Normally, using |\capo{|\meta{n}|}| within a song environment produces a
+% textual note in chord books that suggests the use of a guitar capo on fret
+% \meta{n}.
+% However, when the |transposecapos| option is active, these textual notes
+% are omitted and instead the effect of |\capo{|\meta{n}|}| is the
+% same as for \mac{transpose}|{|\meta{n}|}|.
+% That is, chords between the \mac{capo} macro and the end of the song are
+% automatically transposed up by \meta{n} half-steps.
+% This can be useful for adapting a chord book for guitarists to one that can
+% be used by pianists, who don't have the luxury of capos.
+% See \S\ref{sec:notes} and \S\ref{sec:transpose} for more information on the
+% \mac{capo} and \mac{transpose} macros.
+%
+% \paragraph{Indexes.}
+% \DescEnv{noindexes}
+% \DescMacro{indexeson}
+% \DescMacro{indexesoff}
+% The |noindexes| option suppresses the typesetting of any in-document indexes.
+% Display of indexes can also be turned on or off using the |\indexeson| and
+% |\indexesoff| macros.
+%
+% \DescEnv{nopdfindex}
+% PDF bookmark entries and hyperlinks can be suppressed with the |nopdfindex|
+% option.
+% For finer control of PDF indexes, see \S\ref{sec:idxcust}.
+%
+% \paragraph{Scripture Quotations.}
+% \DescEnv{noscripture}
+% \DescMacro{scriptureon}
+% \DescMacro{scriptureoff}
+% The |noscripture| option omits scripture quotations (see
+% \S\ref{sec:scripture}) from the output.
+% You can also turn scripture quotations on or off in the middle of the
+% document by using |\scriptureon| or |\scriptureoff|, respectively.
+%
+% \paragraph{Shaded Boxes.}
+% \DescEnv{noshading}
+% The |noshading| option causes all shaded boxes, such as those that surround
+% song numbers and textual notes, to be omitted.
+% You might want to use this option if printing such shaded boxes causes
+% problems for your printer or uses too much ink.
+%
+% \paragraph{Partial Song Sets.}
+% \DescMacro{includeonlysongs}
+% Often it is useful to be able to extract a subset of songs from the master
+% document---e.g.~to create a handout or set of overhead slides for a specific
+% worship service.
+% To do this, you can type |\includeonlysongs{|\meta{songlist}|}| in the
+% document preamble (i.e., before the |\begin{document}| line), where
+% \meta{songlist} is a comma-separated list of the song numbers to include.
+% For example,
+%
+% \begin{codeblock}
+% |\includeonlysongs{37,50,2}|
+% \end{codeblock}
+%
+% \noindent
+% creates a document consisting only of songs 37, 50, and 2, in that order.
+%
+% Partial books generated with |\includeonlysongs| omit all scripture
+% quotations (\S\ref{sec:scripture}), and ignore uses of
+% \mac{nextcol}, \mac{brk}, \mac{sclearpage}, and \mac{scleardpage}
+% between songs unless they are followed by a star (e.g., \mac{nextcol}|*|).
+% To force a column- or page-break at a specific point in a partial book,
+% add the word |nextcol|, |brk|, |sclearpage|, or |scleardpage| at the
+% corresponding point in the \meta{songlist}.
+%
+% The |\includeonlysongs| macro only reorders songs within each
+% \env{songs} environment (see \S\ref{sec:songs}), not between different
+% \env{songs} environments.
+% It also cannot be used in conjunction with the \env{rawtext} option.
+%
+% \section{Book Sections}\label{sec:sections}
+%
+% \paragraph{Section Titles.}
+% \DescMacro{songsection}
+% \DescMacro{songchapter}
+% Section titles in a song book can be produced with
+%
+% \begin{codeblock}
+% |\songsection{|\meta{title}|}|
+% \end{codeblock}
+%
+% \noindent
+% which acts like \LaTeX's |\section| command except that it centers
+% the \meta{title} text in sans serif font and omits the section number.
+% When using the |book| document class, use |\songchapter|
+% instead of |\songsection|.
+%
+% \paragraph{Indexes.}
+% \DescMacro{newindex}
+% \DescMacro{newauthorindex}
+% \DescMacro{newscripindex}
+% The \Songs{} package supports three kinds of indexes: indexes by title and/or
+% notable lyrics, indexes by author, and indexes by scripture reference.
+% To generate an index, first declare the index in the document preamble
+% (i.e., before the |\begin{document}| line) with one of the following:
+%
+% \begin{codeblock}
+% |\newindex{|\meta{id}|}{|\meta{filename}|}|
+% |\newauthorindex{|\meta{id}|}{|\meta{filename}|}|
+% |\newscripindex{|\meta{id}|}{|\meta{filename}|}|
+% \end{codeblock}
+%
+% \noindent
+% The \meta{id} should be an alphabetic identifier that will be used to
+% identify the index in other macros that reference it.
+% The \meta{filename} should be a string that, when appended with an
+% extension, constitutes a valid filename on the system.
+% Auxiliary files named \meta{filename}|.sxd| and \meta{filename}|.sbx|
+% are generated during the automatic index generation process.
+% For example:
+%
+% \begin{codeblock}
+% |\newindex{mainindex}{idxfile}|
+% \end{codeblock}
+%
+% \noindent
+% creates a title index named ``|mainindex|'' whose data is
+% stored in files named |idxfile.sxd| and |idxfile.sbx|.
+%
+% \DescMacro{showindex}
+% To display the index in the document, use:
+%
+% \begin{codeblock}
+% |\showindex[|\meta{columns}|]{|\meta{title}|}{|\meta{id}|}|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{id} is the same identifier used in the \mac{newindex},
+% \mac{newauthorindex}, or \mac{newscripindex} command, and where
+% the \meta{title} is the title of the index, which should consist only of
+% simple text (no font or formatting macros, since those cannot be used in
+% pdf bookmark indexes).
+% The |[|\meta{columns}|]| part is optional; if specified it dictates the
+% number of columns if the index can't fit in a single column.
+% For example, for a 2-column title index, write:
+%
+% \begin{codeblock}
+% |\showindex[2]{Index of Song Titles}{mainindex}|
+% \end{codeblock}
+%
+% \section{Compiling}\label{sec:compiling}
+%
+% As with a typical \LaTeX{} document, compiling a song book document requires
+% three steps.
+% First, use \LaTeX{} (|pdflatex| is recommended) to generate auxiliary files
+% from the |.tex| file:
+%
+% \begin{codeblock}
+% |pdflatex mybook.tex|
+% \end{codeblock}
+%
+% Second, use the |songidx| program to generate an index for each index that
+% you declared with \mac{newindex}, \mac{newauthorindex}, or
+% \mac{newscripindex}.
+% The syntax of the |songidx| command is:
+%
+% \begin{codeblock}
+% |songidx |[|-b| \meta{canon}|.can|] \meta{filename}|.sxd| \meta{filename}|.sbx|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{filename} is the same \meta{filename} that was used in the
+% \mac{newindex}, \mac{newauthorindex}, or \mac{newscripindex} macro.
+% If the index was declared with \mac{newscripindex}, then the |-b| option
+% is used to specify which version of the bible you wish to use as a basis
+% for sorting your scripture index.
+% The \meta{canon} part can be any of the |.can| files provided with
+% the |songidx| distribution.
+% If you are using a Protestant, Catholic, or Greek Orthodox Christian bible
+% with book names in English, then the |bible.can| canon file should work
+% well.
+% For other bibles, you should create your own |.can| file by copying and
+% modifying one of the existing |.can| files.
+%
+% For example, if your song book |.tex| file contains the lines
+%
+% \begin{codeblock}
+% \mac{newindex}|{titleidx}{titlfile}|
+% \mac{newauthorindex}|{authidx}{authfile}|
+% \mac{newscripindex}|{scripidx}{scrpfile}|
+% \end{codeblock}
+%
+% \noindent
+% then the commands to generate indexes sorted according to a Christian
+% English bible are:
+%
+% \begin{codeblock}
+% |songidx titlfile.sxd titlfile.sbx|
+% |songidx authfile.sxd authfile.sbx|
+% |songidx -b bible.can scrpfile.sxd scrpfile.sbx|
+% \end{codeblock}
+%
+% Once the indexes are generated, generate the final book by invoking
+% \LaTeX{} one more time:
+%
+% \begin{codeblock}
+% |pdflatex mybook.tex|
+% \end{codeblock}
+%
+% \section{Songs}\label{sec:songs}
+%
+% \subsection{Beginning a Song}
+%
+% \paragraph{Song Sets.}
+% \DescEnv{songs}
+% Songs are contained within |songs| environments.
+% Each |songs| environment begins and ends with:
+%
+% \begin{codeblock}
+% |\begin{songs}{|\meta{indexes}|}|
+% $\vdots$
+% |\end{songs}|
+% \end{codeblock}
+%
+% \noindent
+% \meta{indexes} is a comma-separated list of index identifiers
+% (the \meta{id}'s specified with \mac{newindex})---one identifier
+% for each index that is to include songs in this song set.
+% Between the |\begin{songs}| and |\end{songs}| lines of
+% a song section can appear only songs (see below)
+% or inter-song environments (see \S\ref{sec:between}).
+% No text in a |songs| environment may lie outside of these environments.
+%
+% \paragraph{Songs.}
+% \DescMacro{beginsong}
+% \DescMacro{endsong}
+% A song begins and ends with:
+%
+% \begin{codeblock}
+% |\beginsong{|\meta{titles}|}[|\meta{otherinfo}|]|
+% $\vdots$
+% |\endsong|
+% \end{codeblock}
+%
+% \noindent
+% Songs should appear only within \env{songs} environments (see above)
+% unless you are supplying your own page-builder (see \S\ref{sec:layout}).
+%
+% In the \mac{beginsong} line, \meta{titles} is one or more song titles
+% separated by |\\|.
+% If multiple titles are provided, the first is typeset normally
+% atop the song and the rest are each typeset in parentheses on
+% separate lines.
+%
+% The |[|\meta{otherinfo}|]| part is an optional comma-separated list of
+% key-value pairs (keyvals) of the form \meta{key}|=|\meta{value}.
+% The possible keys and their values are:
+%
+% \medskip
+% \noindent\hfil\vbox{\halign{#\hfil&\kern2em{\it#}\hfil\cr
+% |by={|\meta{authors}|}|&authors, composers, and other contributors\cr
+% |cr={|\meta{copyright}|}|&copyright information\cr
+% |li={|\meta{license}|}|&licensing information\cr
+% |sr={|\meta{refs}|}|&related scripture references\cr
+% |index={|\meta{lyrics}|}|&an extra index entry for a line of lyrics\cr
+% |ititle={|\meta{title}|}|&an extra index entry for a hidden title\cr}}
+% \medskip
+%
+% \noindent
+% For example, a song that begins and ends with
+%
+% \begin{codeblock}
+% |\beginsong{Title1 \\ Title2}[by={Joe Smith}, sr={Job 3},|
+% | cr={\copyright~|\unskip\expandafter|\the\year|| XYZ.}, li={Used with permission.}]|
+% |\endsong|
+% \end{codeblock}
+%
+% \noindent looks like
+%
+% \begin{sample}
+% \setcounter{songnum}{1}%
+% \vskip1pt%
+% \beginsong{Title1 \\ Title2}[by={Joe Smith}, sr={Job 3},
+% cr={\copyright~\the\year{} XYZ.}, li={Used with permission.}]
+% \endsong
+% \end{sample}
+%
+% The four keyvals used in the above example are described in detail in the
+% remainder of this section;
+% the final two are documented in \S\ref{sec:ientry}.
+% You can also create your own keyvals (see \S\ref{sec:newkey}).
+%
+% \paragraph{Song Authors.}
+% \DescEnv{by=}
+% The |by={|\meta{authors}|}| keyval lists one or more authors,
+% composers, translators, etc.
+% An entry is added to each author index associated with the current
+% \env{songs} environment for each contributor listed.
+% Contributors are expected to be separated by commas, semicolons, or the
+% word |and|.
+% For example:
+%
+% \begin{codeblock}
+% |by={Fred Smith, John Doe, and Billy Bob}|
+% \end{codeblock}
+%
+% \noindent
+% Words separated by a macro-space (\verb*@\ @\eat*) or tie (|~|)
+% instead of a regular space are treated as single words by the indexer.
+% For example, \verb*@The Vienna Boys' Choir@\eat* is indexed as
+% ``Choir, The Vienna Boys'\thinspace'' but
+% \verb*@The Vienna\ Boys'\ Choir@\eat* is indexed as
+% ``Vienna Boys' Choir, The''.
+%
+% \paragraph{Copyright Info.}
+% \DescEnv{cr=}
+% The |cr={|\meta{copyright}|}| keyval specifies the copyright-holder of the
+% song, if any.
+% For example:
+%
+% \begin{codeblock}
+% |cr={\copyright~2000 ABC Songs, Inc.}|
+% \end{codeblock}
+%
+% \noindent
+% Copyright information is typeset in fine print at the bottom of the song.
+%
+% \paragraph{Licensing Info.}
+% \DescEnv{li=}
+% \DescMacro{setlicense}
+% Licensing information is provided by |li={|\meta{license}|}|, where
+% \meta{license} is any text.
+% Licensing information is displayed in fine print under the song just
+% after the copyright information (if any).
+% Alternatively, writing |\setlicense{|\meta{license}|}| anywhere between
+% the \mac{beginsong} and \mac{endsong} lines is equivalent to using
+% |li={|\meta{license}|}| in the \mac{beginsong} line.
+%
+% When many songs in a book are covered by a common license, it is
+% usually convenient to create a macro to abbreviate the licensing
+% information.
+% For example, if your organization has a music license from Christian
+% Copyright Licensing International with license number 1234567, you might
+% define a macro like
+%
+% \begin{codeblock}
+% |\newcommand{\CCLI}{(CCLI \#1234567)}|
+% \end{codeblock}
+%
+% \noindent
+% Then you could write |li=\CCLI| in the \mac{beginsong} line of each song
+% covered by CCLI.
+%
+% \paragraph{Scripture References.}
+% \DescEnv{sr=}
+% The \Songs{} package has extensive support for scripture citations and
+% indexes of scripture citations.
+% To cite scripture references for the song, use the keyval
+% |sr={|\meta{refs}|}|, where \meta{refs} is a list of scripture
+% references.
+% Index entries are added to all scripture indexes associated
+% with the current \env{songs} environment for each such reference.
+% The |songidx| index generation program expects \meta{refs} to be a list
+% of references in which semicolons are used to separate references to
+% different books, and commas are used to separate references to to
+% different chapters and verses within the same book.
+% For example, one valid scripture citation is
+%
+% \begin{codeblock}
+% |sr={John 3:16,17, 4:1-5; Jude 3}|
+% \end{codeblock}
+%
+% The full formal syntax of a valid \meta{refs} argument is given in
+% Figure~\ref{fig:srsyntax}.
+% \begin{figure}
+% \noindent\hfil\vbox{\advance\baselineskip2pt
+% \halign{\hfil{\tt#}\,$\longrightarrow$\,&{\tt#}\hfil\cr
+% \Meta{refs}&\Meta{nothing}\OR\Meta{ref};\SPC\Meta{ref};$\ldots$;\SPC\Meta{ref}\cr
+% \Meta{ref}&\Meta{many-chptr-book}\SPC\Meta{chapters}\OR\Meta{one-chptr-book}\SPC\Meta{verses}\cr
+% \Meta{many-chptr-book}&Genesis\OR Exodus\OR Leviticus\OR Numbers\OR $\ldots$\cr
+% \Meta{one-chptr-book}&Obadiah\OR Philemon\OR 2 John\OR 3 John\OR Jude\cr
+% \Meta{chapters}&\Meta{chref},\SPC\Meta{chref},$\ldots$,\SPC\Meta{chref}\cr
+% \Meta{chref}&\Meta{chapter}\OR\Meta{chapter}-\Meta{chapter}\OR\Meta{chapter}:\Meta{verses}\OR\cr
+% \omit&\quad\Meta{chapter}:\Meta{verse}-\Meta{chapter}:\Meta{verse}\cr
+% \Meta{verses}&\Meta{vref},\Meta{vref},$\ldots$,\Meta{vref}\cr
+% \Meta{vref}&\Meta{verse}\OR\Meta{verse}-\Meta{verse}\cr}}
+% \caption{Formal syntax rules for song scripture references}\label{fig:srsyntax}
+% \end{figure}
+% In those syntax rules, \meta{chapter} and \meta{verse} stand for arabic
+% numbers denoting a valid chapter number for the given book, and a valid
+% verse number for the given chapter, respectively.
+% Note that when referencing a book that has only one chapter,
+% one should list only its verses after the book name
+% (rather than |1:|\meta{verses}).
+%
+% \subsection{Verses and Choruses}
+%
+% \paragraph{Starting A Verse Or Chorus.}
+% \DescMacro{beginverse}
+% \DescMacro{endverse}
+% \DescMacro{beginchorus}
+% \DescMacro{endchorus}
+% Between the \mac{beginsong} and \mac{endsong} lines of a song can
+% appear any number of verses and choruses.
+% A verse begins and ends with:
+%
+% \begin{codeblock}
+% |\beginverse|
+% $\vdots$
+% |\endverse|
+% \end{codeblock}
+%
+% \noindent and a chorus begins and ends with:
+%
+% \begin{codeblock}
+% |\beginchorus|
+% $\vdots$
+% |\endchorus|
+% \end{codeblock}
+%
+% \noindent
+% Verses are numbered (unless \mac{noversenumbers} has been used to
+% suppress verse numbering) whereas choruses have a vertical line placed to
+% their left.
+%
+% To create an unnumbered verse, begin the verse with |\beginverse*| instead.
+% This can be used for things that aren't really verses but should be
+% typeset like a verse (e.g.~intros, endings, and the like).
+% A verse that starts with |\beginverse*| should still end with |\endverse|
+% (not |\endverse*|).
+%
+% Within a verse or chorus you should enter one line of text for
+% each line of lyrics.
+% Each line of the source document produces a separate line in the resulting
+% document (like \LaTeX's |\obeylines| macro).
+% Lines that are too long to fit are wrapped with hanging indentation
+% of width |\parindent|.
+%
+% \paragraph{Repeating Choruses.}
+% \DescMacro{repchoruses}
+% When making overhead slides, it is often convenient to repeat the song's
+% chorus after the first verse on each page, so that the projector-operator
+% need not flip back to the first slide each time the chorus is to be sung.
+% You can say |\repchoruses| to automate this process.
+% This causes the first chorus in each song to be automatically repeated
+% after the first verse on each subsequent page of the song (unless that
+% verse is already immediately followed by a chorus).
+% If the first chorus is part of a set of two or more consecutive choruses,
+% then the whole set of choruses is repeated.
+% (A set of choruses is assumed to consist of things like pre-choruses that
+% should always be repeated along with the chorus.)
+% Choruses are not automatically inserted immediately after unnumbered
+% verses (i.e., verses that begin with \mac{beginverse}|*|).
+% Unnumbered verses are assumed to be bridges or endings that aren't
+% followed by a chorus.
+%
+% \DescMacro{norepchoruses}
+% The above covers the common cases, but some songs have more complex forms
+% that demand a manual approach.
+% Before a song with irregular form, say |\norepchoruses| to turn automatic
+% chorus-repeating off.
+% Then, at points within the song where you want a chorus to be repeated on
+% the overhead slides, type a construction like,
+%
+% \begin{codeblock}
+% \mac{ifslides}
+% \mac{beginchorus}
+% $\vdots$
+% \mac{endchorus}
+% |\fi|
+% \end{codeblock}
+%
+% \noindent
+% and copy and paste the desired chorus into the middle.
+% This inserts a repeated chorus at that point when generating slides,
+% but not when generating a lyric book or chord book.
+% After the song is concluded, type
+%
+% \begin{codeblock}
+% \mac{ifslides}\mac{repchoruses}|\fi|
+% \end{codeblock}
+%
+% \noindent
+% to turn automatic chorus-repeating back on, if desired.
+%
+% \subsection{Chords}\label{sec:chords}
+%
+% \DescMacro{[}
+% \DescChar{hash}{#}
+% \DescChar{amp}{&}
+% Between the \mac{beginverse} and \mac{endverse} lines, or between
+% the \mac{beginchorus} and \mac{endchorus} lines,
+% chords can be produced using the macro |\[|\meta{chordname}|]|\eat\].
+% Chords only appear in chord books; they are omitted from lyric books.
+% The \meta{chordname} may consist of arbitrary text.
+% To produce sharp and flat symbols, use |#| and |&| respectively.
+%
+% Any text that immediately follows the |\[]|\eat\] macro with no
+% intervening whitespace is assumed to be the word or syllable
+% that is to be sung as the chord is struck, and is therefore
+% typeset directly under the chord.
+% For example:
+%
+% \example|\[E&]peace and \[Am]joy|\produces{\[E&]peace and \[Am]joy}
+% \eat\]
+%
+% \noindent
+% If whitespace (a space or \meta{return}) immediately follows,
+% then the chord name be typeset without any lyric text
+% below it, indicating that the chord is to be struck between
+% any surrounding words.
+% For example:
+%
+% \example|\[E&]peace and \[Am] joy|\produces{\[E&]peace and \[Am] joy}
+% \eat\]
+%
+% If the lyric text that immediately follows the chord contains
+% another chord, and if the width of the chord name exceeds the
+% width of the lyric text, then hyphenation is added automatically.
+% For example:
+%
+% \example|\[F#sus4]e\[A]ternal|\produces{\[F#sus4]e\[A]ternal}
+% \eat\]
+%
+% Sequences of chords that sit above a single word can be written
+% back-to-back with no intervening space, or as a single chord:
+%
+% \example|\[A]\[B]\[Em]joy|\produces{\[A]\[B]\[Em]joy}
+% \example|\[A B Em]joy|\produces{\[A B Em]joy}
+% \eat\]
+%
+% \noindent
+% The only difference between the two examples above is that the chords
+% in the first example can later be replayed separately (see
+% \S\ref{sec:replay}) whereas the chords in the second example can only be
+% replayed as a group.
+%
+% You can explicitly dictate how much of the text following a
+% chord macro is to appear under the chord name by using braces.
+% To exclude text that would normally be drawn under the chord,
+% use a pair of braces that includes the chord macro.
+% For example:
+%
+% \example|{\[G A]e}ternal|\produces{{\[G A]e}ternal}
+% \eat\]
+%
+% \noindent
+% (Without the braces, the syllables ``ternal'' would not be
+% pushed out away from the chord.)
+% This might be used to indicate that the chord transition occurs
+% on the first syllable rather than as the second syllable is
+% sung.
+%
+% Contrastingly, braces that do not include the chord itself can
+% be used to include text under a chord that would otherwise be
+% excluded.
+% For example:
+%
+% \example|\[Gmaj7sus4]{th' eternal}|\produces{\[Gmaj7sus4]{th' eternal}}
+% \eat\]
+%
+% \noindent
+% Without the braces, the word ``eternal'' would be pushed out away
+% from the chord so that the chord would appear only over
+% the partial word ``th'\thinspace''.
+%
+% \paragraph{Chords Without Lyrics.}
+% \DescMacro{nolyrics}
+% Sometimes you may want to write a line of chords with no lyrics in it at all,
+% such as for an instrumental intro or solo.
+% To make the chords in such a line sit on the baseline instead of raised above
+% it, use the |\nolyrics| macro.
+% For example:
+%
+% \example|{\nolyrics Intro: \[G] \[A] \[D]}|\produces{\nolyrics Intro: \[G] \[A] \[D]}
+% \eat\]
+%
+% \noindent
+% Note the enclosing braces that determine how long the effect should last.
+% Multiple lines can be included in the braces.
+% Instrumental solos should typically not appear in lyric books, so such
+% lines should usually also be surrounded by \mac{ifchorded} and |\fi|
+% (see \S\ref{sec:conditionals}).
+%
+% \paragraph{Symbols Under Chords.}
+% \DescMacro{DeclareLyricChar}
+% If you are typesetting songs in a language whose alphabet contains symbols
+% that \LaTeX{} treats as punctuation, you can use the |\DeclareLyricChar|
+% macro to instruct the \Songs{} package to treat the symbol as
+% non-chord-ending, so that it is included under chords by default just
+% like an alphabetic character.
+%
+% \begin{codeblock}
+% |\DeclareLyricChar{|\meta{token}|}|
+% \end{codeblock}
+%
+% \noindent
+% Here, \meta{token} must be a single \TeX{} macro control sequence,
+% active character, letter (something \TeX{} assigns catcode 11), or
+% punctuation symbol (something \TeX{} assigns catcode 12).
+% For example, by default,
+%
+% \example|\[Fmaj7]s\dag range|\produces{\[Fmaj7]s\dag range}
+% \eat\]
+%
+% \noindent
+% because |\dag| is not recognized as an alphabetic symbol;
+% but if you first type,
+%
+% \begin{codeblock}
+% |\DeclareLyricChar{\dag}|
+% \end{codeblock}
+%
+% \noindent
+% then instead you will get:
+%
+% \DeclareLyricChar{\dag}
+% \example|\[Fmaj7]s\dag range|\produces{\[Fmaj7]s\dag range}
+% \eat\]
+%
+% \noindent
+% \DescMacro{DeclareNonLyric}
+% Likewise, you can type
+%
+% \begin{codeblock}
+% |\DeclareNonLyric{|\meta{token}|}|
+% \end{codeblock}
+%
+% \noindent
+% to reverse the above effect and force a token to be lyric-ending.
+% Such tokens are pushed out away from long chord names so that they
+% never fall under a chord, and hyphenation is added to the resulting gap.
+%
+% \DescMacro{DeclareNoHyphen}
+% To declare a token to be lyric-ending but without the added hyphenation,
+% use |\DeclareNoHyphen{|\meta{token}|}| instead.
+% Such tokens are pushed out away from long chord names so that they never
+% fall under the chord, but hyphenation is not added to the resulting gap.
+%
+% \paragraph{Extending Chords Over Adjacent Words.}
+% \DescMacro{MultiwordChords}
+% The |\MultiwordChords| macro forces multiple words to be squeezed under one
+% chord by default.
+% Normally a long chord atop a short lyric pushes subsequent
+% lyrics away to make room for the chord:
+%
+% \example|\[Gmaj7sus4]my life|\produces{\[Gmaj7sus4]my life}
+% \eat\]
+%
+% \noindent
+% But if you first type |\MultiwordChords|, then instead you get the more
+% compact:
+%
+% \begingroup\MultiwordChords
+% \example|\[Gmaj7sus4]my life|\produces{\[Gmaj7sus4]my life}
+% \eat\]
+% \endgroup
+%
+% \noindent
+% Authors should exercise caution when using |\MultiwordChords| because
+% including many words under a single chord can often produce output that
+% is ambiguous or misleading to musicians.
+% For example,
+%
+% \begingroup\MultiwordChords
+% \example|\[F G Am]me free|\produces{\[F G Am]me free}\par
+% \eat\]
+% \endgroup
+%
+% \noindent
+% This might be misleading to musicians if all three chords are intended
+% to be played while singing the word ``me.''
+% Liberal use of braces is therefore required to make |\MultiwordChords|
+% produce good results, which is why it isn't the default.
+%
+% \paragraph{Accidentals Outside Chords.}
+% \DescMacro{shrp}
+% \DescMacro{flt}
+% Sharp and flat symbols can be produced with |#| and |&| when they appear
+% in chord macros, but if you wish to produce those symbols in
+% other parts of the document, you must use the |\shrp| and |\flt| macros.
+% For example, to define a macro that produces a \chord{C\shrp} chord, use:
+%
+% \begin{codeblock}
+% |\newcommand{\Csharp}{C\shrp}|
+% \end{codeblock}
+%
+% \subsection{Replaying Chords}\label{sec:replay}
+%
+% \DescChar{hat}{^}
+% Many songs consist of multiple verses that use the same chords.
+% The \Songs{} package simplifies this common case by providing a means to
+% replay the chord sequence of a previous verse without having to retype
+% all the chords.
+% To replay a chord from a previous verse, type a hat symbol (|^|) anywhere
+% you would otherwise use a chord macro (|\[]|\eat\]).
+% For example,
+%
+% \begin{codeblock}
+% \mac{beginverse}
+% |\[G]This is the \[C]first \[G]verse.|\eat\]
+% \mac{endverse}
+% \mac{beginverse}
+% |The ^second verse ^ has the same ^chords.|
+% \mac{endverse}
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{chorded}\memorize
+% \[G]This is the \[C]first \[G]verse.\eat\]
+% \end{chorded}
+% \begin{chorded}
+% The ^second verse ^ has the same ^chords.
+% \end{chorded}
+%
+% Normal chords can appear amidst replayed chords without disrupting the
+% sequence of chords being replayed.
+% Thus, a third verse could say,
+%
+% \begin{codeblock}
+% \mac{beginverse}
+% |The ^third verse ^has a \[Cm]new ^chord.|\eat\]
+% \mac{endverse}
+% \end{codeblock}
+%
+% \noindent to produce
+%
+% \begin{chorded}
+% The ^third verse ^has a \[Cm]new ^chord.\eat\]
+% \end{chorded}
+%
+% Replaying can be used in combination with automatic transposition to produce
+% modulated verses.
+% See \S\ref{sec:transpose} for an example.
+%
+% \DescMacro{memorize}
+% By default, chords are replayed from the current song's first verse, but
+% you can replay the chords of a different verse or chorus by saying
+% |\memorize| at the beginning of any verse or chorus whose chords you want
+% to later replay.
+% Subsequent verses or choruses that use \refchar{hat} replay chords
+% from the most recently memorized verse or chorus.
+%
+% \paragraph{Selective Memorization.}
+% It is also possible to inject unmemorized chords into a memorized verse
+% so that they are not later replayed.
+% To suppress memorization of a chord, begin the chord's name with a hat
+% symbol.
+% For example,
+%
+% \begin{codeblock}
+% \mac{beginverse}\mac{memorize}
+% |The \[G]third \[C]chord will \[^Cm]not be re\[G]played.|\eat\]
+% \mac{endverse}
+% \mac{beginverse}
+% |When ^replaying, the ^unmemorized chord is ^skipped.|
+% \mac{endverse}
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{chorded}\memorize
+% The \[G]third \[C]chord will \[^Cm]not be re\[G]played.\eat\]
+% \vskip5pt%
+% When ^replaying, the ^unmemorized chord is ^skipped.
+% \end{chorded}
+%
+% \noindent
+% This is useful when the first verse of a song has something unique,
+% like an intro that won't be repeated in subsequent verses, but has
+% other chords that you wish to replay.
+%
+% \paragraph{Memorizing Multiple Chord Sequences.}
+% By default, the \Songs{} package only memorizes one sequence of chords
+% at a time and \refchar{hat} replays chords from that most recently
+% memorized sequence.
+% However, you can memorize and replay multiple independent sequences
+% using the macros described in the following paragraphs.
+%
+% \DescMacro{newchords}
+% Memorized or replayed chord sequences are stored in chord-replay registers.
+% To declare a new chord-replay register, type
+%
+% \begin{codeblock}
+% |\newchords{|\meta{regname}|}|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{regname} is any unique alphabetic name.
+%
+% Once you've declared a register, you can memorize into that register
+% by providing the \meta{regname} as an optional argument to
+% \mac{memorize}:
+%
+% \begin{codeblock}
+% \mac{memorize}|[|\meta{regname}|]|
+% \end{codeblock}
+%
+% \noindent
+% Memorizing into a non-empty register replaces the contents of that
+% register with the new chord sequence.
+%
+% \DescMacro{replay}
+% To replay chord from a particular register, type
+%
+% \begin{codeblock}
+% |\replay[|\meta{regname}|]|
+% \end{codeblock}
+%
+% \noindent
+% Subsequent uses of \refchar{hat} reproduce chords from the sequence
+% stored in register \meta{regname}.
+%
+% Register contents are global, so you can memorize a chord sequence from one
+% song and replay it in others.
+% You can also use |\replay| multiple times in the same verse or chorus to
+% replay a sequence more than once.
+%
+% \subsection{Line and Column Breaks}
+%
+% \paragraph{Line Breaking.}
+% \DescMacro{brk}
+% To cause a long line of lyrics to be broken in a particular place, put the
+% |\brk| macro at that point in the line.
+% This does not affect lines short enough to fit without breaking.
+% For example,
+%
+% \begin{codeblock}
+% |\beginverse|
+% {\tt\frenchspacing This is a |\brk| short line.
+% But this is a particularly long line of lyrics |\brk| that will need to be wrapped.
+% } |\endverse|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{lyrics}
+% This is a \brk short line.
+% But this is a particularly long line of lyrics \brk that will need to be wrapped.
+% \end{lyrics}
+%
+% \paragraph{Column Breaks Within Songs.}
+% To suggest a column break within a verse or chorus too long to fit in a
+% single column, use |\brk| on a line by itself.
+% If there are no |\brk| lines in a long verse, it is broken
+% somewhere that a line does not wrap.
+% (A wrapped line is never divided by a column break.)
+% If there are no |\brk| lines in a long chorus, it overflows the column,
+% yielding an overfull vbox warning.
+%
+% \paragraph{Column Breaks Between Songs.}
+% \DescMacro{nextcol}
+% \DescMacro{sclearpage}
+% \DescMacro{scleardpage}
+% To force a column break between songs, use |\nextcol|, |\brk|, |\sclearpage|,
+% or |\scleardpage| between songs.
+% The |\nextcol| macro ends the column by leaving blank space at the bottom.
+% The |\brk| macro ends the current column in lyric books by stretching
+% the preceeding text so that the column ends flush with the bottom
+% of the page.
+% (In non-lyric books |\brk| is identical to |\nextcol|.)
+% The |\sclearpage| macro is like |\nextcol| except that it shifts to the next
+% blank page if the current page is nonempty.
+% The |\scleardpage| macro is like |\sclearpage| except that it shifts to the
+% next blank even-numbered page in two-sided documents.
+% Column breaks usually need to be in different places in different book types.
+% To achieve this, use a conditional block from \S\ref{sec:conditionals}.
+% For example,
+%
+% \begin{codeblock}
+% \mac{ifchorded}|\else|\mac{ifslides}|\else\brk\fi\fi|
+% \end{codeblock}
+%
+% \noindent
+% forces a column break only in lyric books but does not affect chord books
+% or books of overhead slides.
+%
+% When a partial list of songs is being extracted with \mac{includeonlysongs},
+% |\brk|, |\nextcol|, |\clearpage|, and |\cleardpage| macros between songs
+% must be followed by a star to have any effect.
+% To force a column-break at a specific point in a partial book, add the
+% word |nextcol|, |brk|, |clearpage|, or |cleardpage| at the corresponding
+% point in the argument to \mac{includeonlysongs}.
+%
+% \subsection{Echoes and Repeats}
+%
+% \paragraph{Echo Parts.}
+% \DescMacro{echo}
+% To typeset an echo part, use |\echo{|\meta{lyrics and chords}|}|.
+% Echo parts are parenthesized and italicized.
+% For example,
+%
+% \example|Alle\[G]luia! \echo{Alle\[A]luia!}|\produces{Alle\[G]luia! \echo{Alle\[A]luia!}}
+% \eat\]
+%
+% \paragraph{Repeated Lines.}
+% \DescMacro{rep}
+% To indicate that a line should be sung multiple times by all singers, put
+% |\rep{|\meta{n}|}| at the end of the line.
+% For example,
+%
+% \example|Alleluia! \rep{4}|\produces{Alleluia! \rep{4}}
+%
+% \DescMacro{lrep}
+% \DescMacro{rrep}
+% To indicate exactly where repeated parts begin and end, use |\lrep| and
+% |\rrep| to create begin- and end-repeat signs.
+% For example,
+%
+% \example|\lrep \[G]Alleluia!\rrep \rep{4}|\produces{\lrep \[G]Alleluia!\rrep \rep{4}}
+% \eat\]
+%
+% \subsection{Measure Bars}\label{sec:measures}
+%
+% \DescMacro{measurebar}
+% \DescChar{pipe}{|}
+% Measure bars can be added to chord books in order to help musicians
+% keep time when playing unfamiliar songs.
+% To insert a measure bar, type either |\measurebar| or type the
+% vertical pipe symbol (``\verb@|@'').
+% For example,
+%
+% \example\verb@Alle|\[G]luia@\produces{Alle\meter{}{}\measurebar\[G]luia}
+% \eat\]
+%
+% \noindent
+% In order for measure bars to be displayed, the \env{showmeasures}
+% option must be enabled.
+% Measure bars are only displayed by default in chord books.
+%
+% \DescMacro{meter}
+% The first measure bar in a song has meter numbers placed above
+% it to indicate the time signature of the piece.
+% By default, these numbers are 4/4, denoting four quarter notes
+% per measure.
+% To change the default, type |\meter{|\meta{n}|}{|\meta{d}|}|
+% somewhere after the \mac{beginsong} line of the song but before the
+% first measure bar, to declare a time signature of \meta{n} \meta{d}th
+% notes per measure.
+%
+% \DescMacro{mbar}
+% You can also change meters mid-song either by using |\meter| in the
+% middle of the song or by typing |\mbar{|\meta{n}|}{|\meta{d}|}|
+% to produce a measure bar with a time signature of \meta{n}/\meta{d}.
+% For example,
+%
+% \begin{codeblock}
+% |\meter{6}{8}|
+% |\beginverse|
+% \verb@|Sing to the |heavens, ye \mbar{4}{4}saints of |old!@
+% |\endverse|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{chorded}
+% \meter{6}{8}%
+% \measurebar Sing to the \measurebar heavens, ye \mbar{4}{4}saints of \measurebar old!
+% \end{chorded}
+%
+% \subsection{Textual Notes}\label{sec:notes}
+%
+% \DescMacro{textnote}
+% \DescMacro{musicnote}
+% Aside from verses and choruses, songs can also contain textual notes
+% that provide instructions to singers and musicians.
+% To create a textual note that is displayed in both lyric books
+% and chord books, use:
+%
+% \begin{codeblock}
+% |\textnote{|\meta{text}|}|
+% \end{codeblock}
+%
+% \noindent
+% To create a textual note that is displayed only in chord books, use:
+%
+% \begin{codeblock}
+% |\musicnote{|\meta{text}|}|
+% \end{codeblock}
+%
+% \noindent
+% Both of these create a shaded box containing \meta{text}.
+% For example,
+%
+% \begin{codeblock}
+% |\textnote{Sing as a two-part round.}|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{lyrics}
+% \textnote{Sing as a two-part round.}
+% \end{lyrics}
+%
+% \noindent
+% Textual notes can be placed anywhere within a song, either within
+% verses and choruses or between them.
+%
+% \paragraph{Guitar Capos.}
+% \DescMacro{capo}
+% One special kind of textual note suggests to guitarists a fret on which
+% they should put their capos.
+% Macro |\capo{|\meta{n}|}| should be used for this purpose.
+% It normally has the same effect as \mac{musicnote}|{capo |\meta{n}|}|;
+% however, if the \env{transposecapos} option is active then it
+% instead has the effect of \mac{transpose}|{|\meta{n}|}|.
+% See \S\ref{sec:transpose} for more information on automatic chord
+% transposition.
+%
+% \subsection{Index Entries}\label{sec:ientry}
+%
+% Every song automatically gets entries in the current section's title
+% index(es).
+% However, you can also add extra index entries for a song to any index.
+%
+% \paragraph{Indexing Lyrics.}
+% \DescEnv{index=}
+% For example, title indexes often have entries for memorable lines
+% of lyrics in a song in addition to the song's title.
+% You can add an index entry for the current song to the section's
+% title index(es) by adding |index={|\meta{lyrics}|}| to the song's
+% \mac{beginsong} line.
+% For example,
+%
+% \begin{codeblock}
+% \mac{beginsong}|{Doxology}|
+% | [index={Praise God from Whom all blessings flow}]|
+% \end{codeblock}
+%
+% \noindent
+% causes the song to be indexed both as ``\textit{Doxology}'' and as
+% ``Praise God from Whom all blessings flow'' in the section's title index(es).
+% You can use |index=| multiple times in a \mac{beginsong} line to produce
+% multiple additional index entries.
+% Index entries produced with |index={|\meta{lyrics}|}| are
+% typeset in an upright font instead of in italics to distinguish
+% them from song titles.
+%
+% \paragraph{Indexing Extra Song Titles.}
+% \DescEnv{ititle=}
+% To add a regular index entry typeset in italics to the title
+% index(es), use:
+%
+% \begin{codeblock}
+% |ititle={|\meta{title}|}|
+% \end{codeblock}
+%
+% \noindent
+% in the \mac{beginsong} line instead.
+% Like \env{index=} keyvals, |ititle=| can be used multiple times to produce
+% multiple additional index entries.
+%
+% \DescMacro{indexentry}
+% \DescMacro{indextitleentry}
+% You can also create index entries by saying
+% |\indexentry[|\meta{indexes}|]{|\meta{lyrics}|}| (which creates an
+% entry like \env{index=}) or
+% |\indextitleentry[|\meta{indexes}|]{|\meta{title}|}| (which
+% creates an entry like \env{ititle=}).
+% These two macros can be used anywhere between the song's \mac{beginsong}
+% and \mac{endsong} lines, and can be used multiple times to produce
+% multiple entries.
+% If specified, \meta{indexes} is a comma-separated list of the identifiers
+% of indexes to which the entry should be added.
+% Otherwise the new entry is added to all of the title indexes for the current
+% \env{songs} environment.
+%
+% \subsection{Chords in Ligatures}
+%
+% This subsection covers an advanced topic and can probably be
+% skipped by those creating song books for non-professional use.
+%
+% The \mac{[\eat]} macro is the normal means by which chords should be inserted
+% into a song; however, a special case occurs when a chord falls within a
+% ligature.
+% Ligatures are combinations of letters or symbols that \TeX{} normally
+% typesets as a single font character so as to produce cleaner-looking
+% output.
+% The only ligatures in English are: ff, fi, fl, ffi, and ffl.
+% Other languages have additional ligatures like \ae{} and \oe.
+% Notice that in each of these cases, the letters are ``squished''
+% together to form a single composite symbol.
+%
+% \DescMacro{ch}
+% When a chord macro falls inside a ligature, \LaTeX{} fails to compact
+% the ligature into a single font character even in non-chorded versions of
+% the book.
+% To avoid this minor typographical error, use the |\ch| macro to typeset
+% the chord:
+%
+% \begin{codeblock}
+% |\ch{|\meta{chord}|}{|\meta{pre}|}{|\meta{post}|}{|\meta{full}|}|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{chord} is the chord text, \meta{pre} is the text to
+% appear before the hyphen if the ligature is broken by auto-hyphenation,
+% \meta{post} is the text to appear after the hyphen if the ligature
+% is broken by auto-hyphenation, and \meta{full} is the full ligature
+% if it is not broken by hyphenation.
+% For example, to correctly typeset |\[Gsus4]dif\[G]ficult|\eat\],
+% in which the \chord{G} chord falls in the middle of the ``ffi''
+% ligature, one should use:
+%
+% \example|di\ch{G}{f}{fi}{ffi}cult|\produces{di\ch{G}{f}{fi}{ffi}cult}
+%
+% \noindent
+% This causes the ``ffi'' ligature to appear intact yet still correctly
+% places the \chord{G} chord over the second f.
+% To use the |\ch| macro with a replayed chord name (see \S\ref{sec:replay}),
+% use |^| as the \meta{chord}.
+%
+% \DescMacro{mch}
+% The |\mch| macro is exactly like the \mac{ch} macro except that it
+% also places a measure bar into the ligature along with the chord.
+% For example,
+%
+% \example|di\mch{G}{f}{fi}{ffi}cult|\produces{di\mch{G}{f}{fi}{ffi}cult}
+%
+% \noindent
+% places both a measure bar and a \chord{G} chord after the first ``f''
+% in ``difficult'', yet correctly produces an unbroken ``ffi'' ligature
+% in copies of the book in which measure bars are not displayed.
+%
+% In the unusual case that a meter change is required within a
+% ligature, this can be achieved with a construction like:
+%
+% \example|\meter{6}{8}di\mch{G}{f}{fi}{ffi}cult|\produces{\meter{6}{8}di\mch{G}{f}{fi}{ffi}cult}
+%
+% \noindent
+% The \mac{meter} macro sets the new time signature, which appears
+% above the next measure bar---in this case the measure bar
+% produced by the |\mch| macro.
+%
+% Chords and measure bars produced with \refchar{hat} or
+% \refchar{pipe} are safe to use in ligatures.
+% Thus, |dif|\refchar{pipe}\refchar{hat}|ficult| requires
+% no special treatment; it leaves the ``ffi'' ligature intact when measure
+% bars are not being displayed.
+%
+% \section{Between Songs}\label{sec:between}
+%
+% Never put any material directly into the top level of a \env{songs}
+% environment.
+% Doing so will disrupt the page-builder, usually producing strange page
+% breaks and blank pages.
+% To safely put material between songs, use one of the environments
+% described in this section.
+%
+% \subsection{Intersong Displays}\label{sec:intersong}
+%
+% \DescEnv{intersong}
+% To put column-width material between the songs in a \env{songs} environment,
+% use an |intersong| environment:
+%
+% \begin{codeblock}
+% |\begin{intersong}|
+% $\vdots$
+% |\end{intersong}|
+% \end{codeblock}
+%
+% \noindent
+% Material contributed in an |intersong| environment is subject to the same
+% column-breaking rules as songs (see \S\ref{sec:layout}), but all other
+% formatting is up to you.
+% By default, \LaTeX{} inserts interline glue below the last line of an
+% |intersong| environment.
+% To suppress this, end the |intersong| content with |\par\nointerlineskip|.
+%
+% \DescEnv{intersong*}
+% To instead put page-width material above a song, use an |intersong*|
+% environment:
+%
+% \begin{codeblock}
+% |\begin{intersong*}|
+% $\vdots$
+% |\end{intersong*}|
+% \end{codeblock}
+%
+% \noindent
+% This starts a new page if the current page already has column-width
+% material in it.
+%
+% \DescEnv{songgroup}
+% By default, all intersong displays are omitted when generating a partial
+% book with \mac{includeonlysongs}.
+% You can force them to be included whenever a particular song is included
+% by using a |songgroup| environment:
+%
+% \begin{codeblock}
+% |\begin{songgroup}|
+% $\vdots$
+% |\end{songgroup}|
+% \end{codeblock}
+%
+% \noindent
+% Each |songgroup| environment may include any number of \env{intersong},
+% \env{intersong*}, or scripture quotations (see \S\ref{sec:scripture}),
+% but must include exactly one song.
+% When using \mac{includeonlysongs}, the entire group is included in the
+% book if the enclosed song is included; otherwise the entire group is
+% omitted.
+%
+% \subsection{Scripture Quotations}\label{sec:scripture}
+%
+% \paragraph{Starting a Scripture Quotation.}
+% \DescMacro{beginscripture}
+% \DescMacro{endscripture}
+% A special form of intersong block typesets a scripture quotation.
+% Scripture quotations begin and end with
+%
+% \begin{codeblock}
+% |\beginscripture{|\meta{ref}|}|
+% $\vdots$
+% |\endscripture|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{ref} is a scripture reference that is
+% typeset at the end of the quotation.
+% The \meta{ref} argument should conform to the same syntax
+% rules as for the \meta{ref} arguments passed to \mac{beginsong}
+% macros (see \S\ref{sec:songs}).
+%
+% The text of the scripture quotation between the |\beginscripture| and
+% |\endscripture| lines are parsed in normal paragraph mode.
+% For example:
+%
+% \begin{codeblock}
+% |\beginscripture{James 5:13}|
+% {\tt\frenchspacing%
+% Is any one of you in trouble? He should pray. Is anyone happy? Let him sing songs of praise.
+% } |\endscripture|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{sample}
+% \beginscripture{James 5:13}
+% Is any one of you in trouble? He should pray. Is anyone happy? Let him sing songs of praise.
+% \endscripture
+% \end{sample}
+%
+% \paragraph{Tuplets.}
+% \DescMacro{Acolon}
+% \DescMacro{Bcolon}
+% To typeset biblical poetry the way it appears in most bibles, begin each
+% line with either |\Acolon| or |\Bcolon|.
+% A-colons are typeset flush with the left margin, while B-colons are
+% indented.
+% Any lines too long to fit are wrapped with double-width hanging indentation.
+% For example,
+%
+% \begin{codeblock}
+% |\beginscripture{Psalm 1:1}|
+% {\tt\frenchspacing%
+% |\Acolon| Blessed is the man
+% |\Bcolon| who does not walk in the counsel of the wicked
+% |\Acolon| or stand in the way of sinners
+% |\Bcolon| or sit in the seat of mockers.
+% } |\endscripture|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{sample}
+% \beginscripture{Psalm 1:1}
+% \Acolon Blessed is the man
+% \Bcolon who does not walk in the counsel of the wicked
+% \Acolon or stand in the way of sinners
+% \Bcolon or sit in the seat of mockers.
+% \endscripture
+% \end{sample}
+%
+% \paragraph{Stanzas.}
+% \DescMacro{strophe}
+% Biblical poetry is often grouped into stanzas or ``strophes'',
+% each of which is separated from the next by a small vertical
+% space.
+% You can create that vertical space by typing |\strophe|.
+% For example,
+%
+% \begin{codeblock}
+% |\beginscripture{Psalm 88:2-3}|
+% {\tt\frenchspacing%
+% |\Acolon| May my prayer come before you;
+% |\Bcolon| turn your ear to my cry.
+% |\strophe|
+% |\Acolon| For my soul is full of trouble
+% |\Bcolon| and my life draws near the grave.
+% } |\endscripture|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{sample}
+% \beginscripture{Psalm 88:2-3}
+% \Acolon May my prayer come before you;\par
+% \Bcolon turn your ear to my cry.\par
+% \strophe
+% \Acolon For my soul is full of trouble\par
+% \Bcolon and my life draws near the grave.
+% \endscripture
+% \end{sample}
+%
+% \paragraph{Indented Blocks.}
+% \DescMacro{scripindent}
+% \DescMacro{scripoutdent}
+% Some bible passages, such as those that mix prose and poetry, contain
+% indented blocks of text.
+% You can increase the indentation level within a scripture quotation
+% by using |\scripindent| and decrease it by using |\scripoutdent|.
+% For example,
+%
+% \begin{codeblock}
+% |\beginscripture{Hebrews 10:17-18}|
+% {\tt\frenchspacing%
+% Then he adds:
+% |\scripindent|
+% |\Acolon ``|Their sins and lawless acts
+% |\Bcolon| I will remember no more.|''|
+% |\scripoutdent|
+% And where these have been forgiven, there is no longer any sacrifice for sin.
+% } |\endscripture|
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{sample}
+% \beginscripture{Hebrews 10:17-18}
+% Then he adds:\par
+% \scripindent
+% \Acolon ``Their sins and lawless acts\par
+% \Bcolon I will remember no more.''\par
+% \scripoutdent
+% And where these have been forgiven, there is no longer any sacrifice for sin.
+% \endscripture
+% \end{sample}
+%
+% \section{Guitar Tablatures}\label{sec:tablatures}
+%
+% \DescMacro{gtab}
+% Guitar tablature diagrams can be created by using the construct
+%
+% \begin{codeblock}
+% |\gtab{|\meta{chord}|}{|\meta{fret}|:|\meta{strings}|:|\meta{fingering}|}|
+% \end{codeblock}
+%
+% \noindent
+% where the \meta{fret} and \meta{fingering} parts are both optional
+% (and you may omit any colon that borders an omitted argument).
+%
+% \meta{chord} is a chord name to be placed above the diagram.
+%
+% \meta{fret} is an optional digit (any number from 2 to 9) placed to the
+% left of the diagram.
+%
+% \meta{strings} should be a series of symbols, one for each string
+% of the guitar from lowest pitch to highest.
+% Each symbol should be one of:
+% |X| if that string is not to be played,
+% |0| (zero or the letter O) if that string is to be played open, or
+% one of |1| through |9| if that string is to be played on the given
+% numbered fret.
+%
+% \meta{fingering} is an optional series of digits, one for each
+% string of the guitar from lowest pitch to highest.
+% Each digit should be one of:
+% |0| if no fingering information is to be displayed for that string (e.g., if
+% the string is not being played or is being played open), or
+% one of |1| through |4| to indicate that the given numbered finger is to be
+% used to hold down that string.
+%
+% Here are some examples to illustrate:
+%
+% \example|\gtab{A}{X02220:001230}|\produces{\vcenterbox{\gtab{A}{{\hphantom{4}}:X02220:001230}}}
+% \example|\gtab{C#sus4}{4:XX3341}|\produces{\vcenterbox{\gtab{C\shrp sus4}{4:XX3341}}}
+% \example|\gtab{B&}{X13331}|\produces{\vcenterbox{\gtab{B\flt}{{\hphantom{4}}:X13331:}}}
+%
+% \DescMacro{minfrets}
+% By default, tablature diagrams always consist of at least 4 fret rows
+% (more if the \meta{strings} argument contains a number larger than 4).
+% To change the minimum number of fret rows, change the value of |\minfrets|.
+% For example, typing
+%
+% \begin{codeblock}
+% |\minfrets=1|
+% \end{codeblock}
+%
+% \noindent
+% causes tablature diagrams to have only as many rows are required to
+% accommodate the largest digit appearing in the \meta{strings} argument.
+%
+% \section{Automatic Transposition}\label{sec:transpose}
+%
+% \DescMacro{transpose}
+% You can automatically transpose some or all of the chords in a song up by
+% \meta{n} half-steps by adding the line
+%
+% \begin{codeblock}
+% |\transpose{|\meta{n}|}|
+% \end{codeblock}
+%
+% \noindent
+% somewhere between the song's \mac{beginsong} line and the first chord to
+% be transposed.
+% For example, if a song's first chord is |\[D]|\eat\], and the line
+% |\transpose{2}| appears before it, then the chord appears as an
+% \chord{E} in the resulting document.
+% Specifying a negative number for \meta{n} transposes subsequent chords
+% down instead of up.
+%
+% The |\transpose| macro affects all chords appearing after it until the
+% \mac{endsong} line.
+% If two |\transpose| macros appear in the same song, their effects are
+% cumulative.
+%
+% When the \env{transposecapos} option is active, the \mac{capo}
+% macro acts like |\transpose|.
+% See \S\ref{sec:notes} for more information.
+%
+% \paragraph{Enharmonics.}
+% \DescMacro{preferflats}
+% \DescMacro{prefersharps}
+% When using \mac{transpose} to automatically transpose the chords of a song,
+% the \Songs{} package code chooses between enharmonically equivalent
+% names for ``black key'' notes based on the first chord of the song.
+% For example, if |\transpose{1}| is used, and if the first chord of the
+% song is an \chord{E}, then all \chord{A} chords that appear in
+% the song are transcribed as \chord{B\flt} chords rather than
+% \chord{A\shrp} chords, since the key of \chord{F}-major (\chord{E}
+% transposed up by one half-step) has a flatted key signature.
+% Usually this guess produces correct results, but if not, you can use
+% either |\preferflats| or |\prefersharps| after the \mac{transpose} line
+% to force all transcription to use flatted names or sharped names
+% respectively, when resolving enharmonic equivalents.
+%
+% \paragraph{Modulated Verses.}
+% Automatic transposition can be used in conjunction with chord-replaying
+% (see \S\ref{sec:chords}) to produce modulated verses.
+% For example,
+%
+% \begin{codeblock}
+% \mac{beginverse}\mac{memorize}
+% |\[F#]This is a \[B/F#]memorized \[F#]verse. \[E&7]|\eat\]
+% \mac{endverse}
+% \mac{transpose}|{2}|
+% \mac{beginverse}
+% |^This verse is ^modulated up two ^half-steps.|
+% \mac{endverse}
+% \end{codeblock}
+%
+% \noindent produces
+%
+% \begin{chorded}\memorize
+% \[F#]This is a \[B/F#]memorized \[F#]verse. \[E&7]\eat\]
+% \vskip5pt\replay\transpose{2}%
+% ^This verse is ^modulated up two ^half-steps.
+% \transpose{-2}%
+% \end{chorded}
+%
+% \paragraph{Both Keys.}
+% \DescMacro{trchordformat}
+% By default, when chords are automatically transposed using \mac{transpose},
+% only the transposed chords are printed.
+% However, in some cases you may wish to print the old chords and the
+% transposed chords together so that musicians playing transposing and
+% non-transposing instruments can play from the same piece of music.
+% This can be achieved by redefining the |\trchordformat| macro, which
+% receives two arguments---the original chord name and the transposed chord
+% name, respectively.
+% For example, to print the old chord above the new chord above each lyric,
+% define
+%
+% \begin{codeblock}
+% |\renewcommand{\trchordformat}[2]{\vbox{\hbox{#1}\hbox{#2}}}|
+% \end{codeblock}
+%
+% \paragraph{Changing Note Names.}
+% \DescMacro{solfedge}
+% \DescMacro{alphascale}
+% In many countries it is common to use the solfedge names for the notes of
+% the scale (\chord{LA, SI, DO, RE, MI, FA, SOL\/}) instead of the
+% alphabetic names (\chord{A, B, C, D, E, F, G\/}).
+% By default, the transposition logic only understands alphabetic names, but
+% you can tell it to look for solfedge names by typing |\solfedge|.
+% To return to alphabetic names, type |\alphascale|.
+%
+% \DescMacro{notenames}
+% You can use other note names as well.
+% To define your own note names, type
+%
+% \begin{codeblock}
+% |\notenames{|\meta{nameA}|}{|\meta{nameB}|}|$\ldots$|{|\meta{nameG}|}|
+% \end{codeblock}
+%
+% \noindent
+% where each of \meta{nameA} through \meta{nameG} must consist entirely of
+% a sequence of one or more \emph{uppercase} letters.
+% For example, some solfedge musicians use \chord{TI} instead of \chord{SI}
+% for the second note of the scale.
+% To automatically transpose such music, use:
+%
+% \begin{codeblock}
+% |\notenames{LA}{TI}{DO}{RE}{MI}{FA}{SOL}|
+% \end{codeblock}
+%
+% \DescMacro{notenamesin}
+% \DescMacro{notenamesout}
+% The \Songs{} package can also automatically convert one set of note names
+% to another.
+% For example, suppose you have a large song book in which chords have been
+% typed using alphabetic note names, but you wish to produce a book that
+% uses the equivalent solfedge names.
+% You could achieve this by using the |\notenamesin| macro to tell the
+% \Songs{} package which note names you typed in the input file, and then
+% using |\notenamesout| to tell the \Songs{} package how you want it to
+% typeset each note name in the output file.
+% The final code looks like this:
+%
+% \begin{codeblock}
+% |\notenamesin{A}{B}{C}{D}{E}{F}{G}|
+% |\notenamesout{LA}{SI}{DO}{RE}{MI}{FA}{SOL}|
+% \end{codeblock}
+%
+% \noindent
+% The syntaxes of |\notenamesin| and |\notenamesout| are identical to that
+% of \mac{notenames} (see above), except that the arguments of |\notenamesout|
+% can consist of any \LaTeX{} code that is legal in horizontal mode, not just
+% uppercase letters.
+%
+% To stop converting between note names, use \mac{alphascale}, \mac{solfedge},
+% or \mac{notenames} to reset all note names back to identical input and
+% output scales.
+%
+% \paragraph{Transposing Chords In Macros.}
+% \DescMacro{transposehere}
+% The automatic transposition logic won't find chord names that are hidden
+% inside macro bodies.
+% For example, if you abbreviate a chord by typing,
+%
+% \begin{codeblock}
+% |\newcommand{\mychord}{F|\mac{shrp}| sus4/C|\mac{shrp}|}|
+% \mac{transpose}|{4}|
+% |\[\mychord]|\eat\]
+% \end{codeblock}
+%
+% \noindent
+% then the \mac{transpose} macro fails to transpose it; the
+% resulting chord is still an \chord{F\shrp sus4/C\shrp} chord.
+% To fix the problem, you can use |\transposehere| in your macros to
+% explicitly invoke the transposition logic on chord names embedded in
+% macro bodies.
+% The above example could be corrected by instead defining:
+%
+% \begin{codeblock}
+% |\newcommand{\mychord}{\transposehere{F|\mac{shrp}| sus4/C|\mac{shrp}|}}|
+% \end{codeblock}
+%
+% \DescMacro{notrans}
+% Transposition can be suppressed within material that would otherwise be
+% transposed by using the |\notrans| macro.
+% For example, writing
+%
+% \begin{codeblock}
+% \mac{transposehere}|{G = \notrans{G}}|
+% \end{codeblock}
+%
+% \noindent
+% would typeset a transposed \chord{G} followed by a non-transposed
+% \chord{G} chord.
+% This does not suppress note name conversion (see \mac{notenames}).
+% To suppress both transposition and note name conversion, just use
+% braces (e.g., |{G}| instead of |\notrans{G}|).
+%
+% \paragraph{Transposing Guitar Tablatures.}
+% \DescMacro{gtabtrans}
+% The songs package cannot automatically transpose tablature diagrams
+% (see \S\ref{sec:tablatures}).
+% Therefore, when automatic transposition is taking place, only the chord
+% names of \mac{gtab} macros are displayed (and transposed); the diagrams
+% are omitted.
+% To change this default, redefine the |\gtabtrans| macro, whose two
+% arguments are the two arguments to \mac{gtab}.
+% For example, to display original tablatures without transposing them even
+% when transposition has been turned on, write
+%
+% \begin{codeblock}
+% |\renewcommand{\gtabtrans}[2]{|\mac{gtab}|{|\mac{notrans}|{#1}}{#2}}|
+% \end{codeblock}
+%
+% \noindent
+% To transpose the chord name but not the diagram under it, replace
+% \mac{notrans}|{#1}| with simply |#1| in the above.
+% To restore the default behavior, write
+%
+% \begin{codeblock}
+% |\renewcommand{\gtabtrans}[2]{|\mac{transposehere}|{#1}}|
+% \end{codeblock}
+%
+% \section{Customizing the Book}
+%
+% \subsection{Song and Verse Numbering}\label{sec:numbering}
+%
+% \paragraph{Song Numbering.}
+% \DescEnv{songnum}
+% The |songnum| counter defines the next song's number.
+% It is set to 1 at the beginning of a \env{songs} environment and is
+% increased by 1 after each \mac{endsong}.
+% It can be redefined anywhere except within a song.
+% For example,
+%
+% \begin{codeblock}
+% |\setcounter{songnum}{3}|
+% \end{codeblock}
+%
+% \noindent sets the next song's number to be 3.
+%
+% \DescMacro{thesongnum}
+% You can change the song numbering style for a song section by redefining
+% |\thesongnum|.
+% For example, to cause songs to be numbered A1, A2, etc., in the current
+% song section, type
+%
+% \begin{codeblock}
+% |\renewcommand{\thesongnum}{A\arabic{songnum}}|
+% \end{codeblock}
+%
+% \noindent
+% The expansion of |\thesongnum| must always produce plain text with no
+% font formatting or unexpandable macro tokens, since its text is
+% exported to auxiliary index generation files where it is sorted.
+%
+% \DescMacro{printsongnum}
+% To change the formatting of song numbers as they appear at the beginning
+% of each song, redefine the |\printsongnum| macro,
+% which expects the text yielded by \mac{thesongnum} as its only argument.
+% For example, to typeset song numbers in italics atop each song, define
+%
+% \begin{codeblock}
+% |\renewcommand{\printsongnum}[1]{\it\LARGE#1}|
+% \end{codeblock}
+%
+% \DescMacro{songnumwidth}
+% The |\songnumwidth| length defines the width of the shaded boxes that contain
+% song numbers at the beginning of each song.
+% For example, to make each such box 2 centimeters wide, you could define
+%
+% \begin{codeblock}
+% |\setlength{\songnumwidth}{2cm}|
+% \end{codeblock}
+%
+% \noindent
+% If |\songnumwidth| is set to zero, song numbers are not shown at all.
+%
+% \DescMacro{nosongnumbers}
+% To turn off song numbering entirely, type |\nosongnumbers|.
+% This inhibits the display of the song number atop each song
+% (but song numbers are still be displayed elsewhere, such as in indexes).
+% The same effect can be achieved by setting \mac{songnumwidth} to zero.
+%
+% \paragraph{Verse Numbering.}
+% \DescEnv{versenum}
+% The |versenum| counter defines the next verse's number.
+% It is set to 1 after each \mac{beginsong} line and is increased by 1 after
+% each \mac{endverse} (except if the verse begins with \mac{beginverse}|*|).
+% The |versenum| counter can be redefined anywhere within a song.
+% For example,
+%
+% \begin{codeblock}
+% |\setcounter{versenum}{3}|
+% \end{codeblock}
+%
+% \noindent sets the next verse's number to be 3.
+%
+% \DescMacro{theversenum}
+% You can change the verse numbering style by redefining |\theversenum|.
+% For example, to cause verses to be numbered in uppercase roman numerals,
+% define
+%
+% \begin{codeblock}
+% |\renewcommand{\theversenum}{\Roman{versenum}}|
+% \end{codeblock}
+%
+% \DescMacro{printversenum}
+% To change the formatting of verse numbers as they appear at the beginning
+% of each verse, redefine the |\printversenum| macro,
+% which expects the text yielded by \mac{theversenum} as its only argument.
+% For example, to typeset verse numbers in italics, define
+%
+% \begin{codeblock}
+% |\renewcommand{\printversenum}[1]{\it\LARGE#1.\ }|
+% \end{codeblock}
+%
+% \DescMacro{versenumwidth}
+% The |\versenumwidth| length defines the horizontal space reserved for verse
+% numbers to the left of each verse text.
+% Verse text is shifted right by this amount.
+% For example, to reserve half a centimeter of space for verse numbers, define
+%
+% \begin{codeblock}
+% |\setlength{\versenumwidth}{0.5cm}|
+% \end{codeblock}
+%
+% Verse numbers whose widths exceed |\versenumwidth| indent the first
+% line of the verse an additional amount to make room, but subsequent lines
+% of the verse are only indented by |\versenumwidth|.
+%
+% \DescMacro{noversenumbers}
+% To turn off verse numbering entirely, use |\noversenumbers|.
+% This is equivalent to saying
+%
+% \begin{codeblock}
+% |\renewcommand{|\mac{printversenum}|}[1]{}|
+% |\setlength{\versenumwidth}{0pt}|
+% \end{codeblock}
+%
+% \DescMacro{placeversenum}
+% The horizontal placement of verse numbers within the first line of each
+% verse is controlled by the |\placeversenum| macro.
+% By default, each verse number is placed flush-left.
+% \ImplOrDesc
+% {Authors interested in changing the placement of verse numbers should
+% consult \S\ref{sec:impparams} of the implementation section for more
+% information on this macro.}
+% {For more information on this macro, recompile this documentation with
+% the implementation section included.}
+%
+% \subsection{Song Appearance}
+%
+% \paragraph{Font Selection.}
+% \DescMacro{lyricfont}
+% By default, lyrics are typeset using the document-default font
+% (|\normalfont|) and with the document-default point size (|\normalsize|).
+% You can change these defaults by redefining |\lyricfont|.
+% For example, to cause lyrics to be typeset in small sans serif font,
+% you could define
+%
+% \begin{codeblock}
+% |\renewcommand{\lyricfont}{\sffamily\small}|
+% \end{codeblock}
+%
+% \DescMacro{stitlefont}
+% Song titles are typeset in a sans-serif, slanted font by default
+% (sans-serif, upright if producing slides).
+% You can change this default by redefining |\stitlefont|.
+% For example, to cause titles to be typeset in a roman font, you could
+% define
+%
+% \begin{codeblock}
+% |\renewcommand{\stitlefont}{\rmfont\Large}|
+% \end{codeblock}
+%
+% \DescMacro{versefont}
+% \DescMacro{chorusfont}
+% \DescMacro{notefont}
+% You can apply additional font changes to verses, choruses, and
+% textual notes produced with \mac{textnote} and \mac{musicnote} by
+% redefining |\versefont|, |\chorusfont|, and |\notefont|, respectively.
+% For example, to typeset choruses in italics, you could define
+%
+% \begin{codeblock}
+% |\renewcommand{\chorusfont}{\it}|
+% \end{codeblock}
+%
+% \DescMacro{notebgcolor}
+% \DescMacro{snumbgcolor}
+% The colors of shaded boxes containing textual notes and song numbers
+% can be changed by redefining the |\notebgcolor| and |\snumbgcolor|
+% macros.
+% For example:
+%
+% \begin{codeblock}
+% |\renewcommand{\notebgcolor}{red}|
+% \end{codeblock}
+%
+% \DescMacro{printchord}
+% By default, chords are typeset in sans serif oblique (slanted) font.
+% You can customize chord appearance by redefining |\printchord|, which
+% accepts the chord text as its argument.
+% For example, to cause chords to be printed in roman boldface font,
+% you could define
+%
+% \begin{codeblock}
+% |\renewcommand{\printchord}[1]{\rmfamily\bf#1}|
+% \end{codeblock}
+%
+% \paragraph{Accidental Symbols.}
+% \DescMacro{sharpsymbol}
+% \DescMacro{flatsymbol}
+% By default, sharp and flat symbols are typeset using \LaTeX's
+% |\#| ($\#$) and |\flat| ($\flat$) macros.
+% Users can change this by redefining |\sharpsymbol| and |\flatsymbol|.
+% For example, to use |\sharp| ($\sharp$) instead of $\#$, one could
+% redefine |\sharpsymbol| as follows.
+%
+% \begin{codeblock}
+% |\renewcommand{\sharpsymbol}{\ensuremath{^\sharp}}|
+% \end{codeblock}
+%
+% \paragraph{Verse and Chorus Titles.}
+% \DescMacro{everyverse}
+% \DescMacro{everychorus}
+% The |\everyverse| macro is executed at the beginning of each verse, and
+% |\everychorus| is executed at the beginning of each chorus.
+% Thus, to begin each chorus with the word ``Chorus:'' one could type,
+%
+% \begin{codeblock}
+% |\renewcommand{\everychorus}{|\mac{textnote}|{Chorus:}}|
+% \end{codeblock}
+%
+% \paragraph{Spacing Options.}
+% \DescMacro{versesep}
+% The vertical distance between song verses and song choruses is defined by
+% the skip register |\versesep|.
+% For example, to put 12 points of space between each pair of verses and
+% choruses, with a flexibility of plus or minus 2 points, you could define
+%
+% \begin{codeblock}
+% |\versesep=12pt plus 2pt minus 2pt|
+% \end{codeblock}
+%
+% \DescMacro{afterpreludeskip}
+% \DescMacro{beforepostludeskip}
+% The vertical distance between the song's body and its prelude and postlude
+% material is controlled by skips |\afterpreludeskip| and
+% |\beforepostludeskip|.
+% This glue can be made stretchable for centering effects.
+% For example, to cause each song body to be centered on the page with one
+% song per page, you could write:
+%
+% \begin{codeblock}
+% \mac{songcolumns}|{1}|
+% \mac{spenalty}|=-10000|
+% |\afterpreludeskip=2pt plus 1fil|
+% |\beforepostludeskip=2pt plus 1fil|
+% \end{codeblock}
+%
+% \DescMacro{baselineadj}
+% The vertical distance between the baselines of consecutive lines of
+% lyrics is computed by the \Songs{} package based on several factors
+% including the lyric font size, the chord font size (if in \env{chorded}
+% mode), and whether \env{slides} mode is currently active.
+% You can adjust the results of this computation by redefining skip
+% register |\baselineadj|.
+% For example, to reduce the natural distance between baselines by 1 point
+% but allow an additional 1 point of stretching when attempting to balance
+% columns, you could define
+%
+% \begin{codeblock}
+% |\baselineadj=-1pt plus 1pt minus 0pt|
+% \end{codeblock}
+%
+% \DescMacro{clineparams}
+% To change the vertical distance between chords and the lyrics below them,
+% redefine the |\clineparams| macro with a definition that adjusts the
+% \LaTeX{} parameters |\baselineskip|, |\lineskiplimit|, and |\lineskip|.
+% For example, to cause the baselines of chords and their lyrics to be
+% 12 points apart with at least 1 point of space between the bottom of the
+% chord and the top of the lyric, you could write:
+%
+% \begin{codeblock}
+% |\renewcommand{\clineparams}{|
+% | \baselineskip=12pt|
+% | \lineskiplimit=1pt|
+% | \lineskip=1pt|
+% |}|
+% \end{codeblock}
+%
+% \DescMacro{cbarwidth}
+% The width of the vertical line that appears to the left of choruses is
+% controlled by the |\cbarwidth| length.
+% To eliminate the line entirely (and the spacing around it), you can set
+% |\cbarwidth| to |0pt|:
+%
+% \begin{codeblock}
+% |\setlength{\cbarwidth}{0pt}|
+% \end{codeblock}
+%
+% \DescMacro{sbarheight}
+% The height of the horizontal line that appears between each pair of songs
+% is controlled by the |\sbarheight| length.
+% To eliminate the line entirely (and the spacing around it), you can set
+% |\sbarheight| to |0pt|:
+%
+% \begin{codeblock}
+% |\setlength{\sbarheight}{0pt}|
+% \end{codeblock}
+%
+% \paragraph{Song Top and Bottom Material.}
+% You can adjust the header and footer material that precedes and concludes
+% each song by redefining |\extendprelude| and |\extendpostlude|.
+%
+% \DescMacro{extendprelude}
+% \DescMacro{showauthors}
+% \DescMacro{showrefs}
+% By default, |\extendprelude| displays the song's authors and scripture
+% references using the macros |\showauthors| and |\showrefs|.
+% The following definition changes it to also print copyright info:
+%
+% \begin{codeblock}
+% |\renewcommand{\extendprelude}{|
+% | |\mac{showrefs}\mac{showauthors}
+% | {\bfseries|\mac{songcopyright}|\par}|
+% |}|
+% \end{codeblock}
+%
+% \DescMacro{extendpostlude}
+% By default, |\extendpostlude| prints the song's copyright and licensing
+% information as a single paragraph using \mac{songcopyright} and
+% \mac{songlicense}.
+% The following definition changes it to also print the words
+% ``Used with permission'' at the end of every song's footer information:
+%
+% \begin{codeblock}
+% |\renewcommand{\extendpostlude}{|
+% | |\mac{songcopyright}|\ |\mac{songlicense}|\unskip|
+% | \ Used with permission.|
+% |}|
+% \end{codeblock}
+%
+% In general, any macro documented in \S\ref{sec:songinfo} can be used
+% in |\extendprelude| and |\extendpostlude| to print song information, such
+% as \mac{songauthors}, \mac{songrefs}, \mac{songcopyright}, and
+% \mac{songlicense}.
+% For convenience, the \mac{showauthors} and \mac{showrefs} macros display
+% author and scripture reference information as a pre-formatted paragraph
+% the way it appears in the default song header blocks.
+%
+% See \S\ref{sec:newkey} for how to define new \mac{beginsong} keyvals and
+% use them in |\extendprelude|.
+%
+% \DescMacro{makeprelude}
+% \DescMacro{makepostlude}
+% For complete control over the appearance of the header and footer material
+% that precedes and concludes each song, you can redefine the macros
+% |\makeprelude| and |\makepostlude|.
+% When typesetting a song, the \Songs{} package code invokes both of these
+% macros once (after processing all the material between the \mac{beginsong}
+% and \mac{endsong} lines), placing the results within vboxes.
+% The resulting vboxes are placed atop and below the song content.
+% By default, |\makeprelude| displays the song's titles, authors, and scripture
+% references to the right of a shaded box containing the song's number; and
+% |\makepostlude| displays the song's copyright and licensing information in
+% fine print.
+%
+% \paragraph{Page- and Column-breaking.}
+% \DescMacro{vvpenalty}
+% \DescMacro{ccpenalty}
+% \DescMacro{vcpenalty}
+% \DescMacro{cvpenalty}
+% \DescMacro{brkpenalty}
+% Page-breaking and column-breaking within songs that are too large to fit
+% in a single column/page is influenced by the values of several penalties.
+% Penalties of value |\interlinepenalty| are inserted between consecutive
+% lines of each verse and chorus;
+% penalties of value |\vvpenalty|, |\ccpenalty|, |\vcpenalty|, and |\cvpenalty|
+% are inserted into each song between consecutive verses, between consecutive
+% choruses, after a verse followed by a chorus, and after a chorus followed by
+% a verse, respectively;
+% and penalties of value |\brkpenalty| are inserted wherever \mac{brk} is
+% used on a line by itself.
+% The higher the penalty, the less likely \TeX{} is to place a
+% page- or column-break at that site.
+% If any are set to $-10000$ or lower, breaks are forced there.
+% By default, |\interlinepenalty| is set to 1000 and the rest are set to 200
+% so that breaks between verses and choruses are preferred over breaks within
+% choruses and verses, but are not forced.
+%
+% \DescMacro{sepverses}
+% Saying |\sepverses| sets all of the above penalties to $-10000$ except for
+% |\ccpenalty| which is set to 100.
+% This is useful in \env{slides} mode because it forces each verse and
+% chorus to be typeset on a separate slide, except for consecutive choruses,
+% which remain together when possible.
+% (This default reflects an expectation that consecutive choruses typically
+% consist of a pre-chorus and chorus that are always sung together.)
+%
+% These defaults can be changed by changing the relevant penalty register
+% directly.
+% For example, to force a page- or column-break between consecutive choruses,
+% type
+%
+% \begin{codeblock}
+% |\ccpenalty=-10000|
+% \end{codeblock}
+%
+% \paragraph{Text Justification.}
+% \DescMacro{versejustify}
+% \DescMacro{chorusjustify}
+% \DescMacro{justifyleft}
+% \DescMacro{justifycenter}
+% To cause verse or chorus text to be justified flush-left or centered, set
+% |\versejustify| or |\chorusjustify| to |\justifyleft| or |\justifycenter|,
+% respectively.
+% For example, to cause choruses to be centered, one could type:
+%
+% \begin{codeblock}
+% |\renewcommand{|\mac{chorusjustify}|}{\justifycenter}|
+% \end{codeblock}
+%
+% \DescMacro{notejustify}
+% Justification of textual notes too long to fit on a single line
+% is controlled by the |\notejustify| macro.
+% By default, it sets up an environment that fully justifies the note
+% (i.e., all but the last line of each paragraph extends all the way from
+% the left to the right margin).
+% \ImplOrDesc
+% {Authors interested in changing this behavior should consult
+% \S\ref{sec:impparams} of the implementation section for more
+% information about this macro.}
+% {For more information, recompile this documentation with the
+% implementation section included.}
+%
+% \DescMacro{placenote}
+% A textual note that is shorter than a single line is placed flush-left by
+% default, or is centered when in slides mode.
+% This placement of textual notes is controlled by |\placenote|.
+% \ImplOrDesc
+% {Authors interested in changing this behavior should consult
+% \S\ref{sec:impparams} of the implementation section for more
+% information about this macro.}
+% {For more information, recompile this documentation with the
+% implementation section included.}
+%
+% \subsection{Scripture Appearance}
+%
+% \DescMacro{scripturefont}
+% By default, scripture quotations are typeset in Zaph Chancery font
+% with the document-default point size (|\normalsize|).
+% You can change these defaults by redefining |\scripturefont|.
+% For example, to cause scripture quotations to be typeset in sans serif
+% italics, define:
+%
+% \begin{codeblock}
+% |\renewcommand{\scripturefont}{\sffamily\it}|
+% \end{codeblock}
+%
+% \DescMacro{printscrcite}
+% By default, the citation at the end of a scripture quotation is
+% typeset in sans serif font at the document-default point size
+% (|\normalsize|).
+% You can customize the appearance of the citation by redefining
+% |\printscrcite|, which accepts the citation text as its argument.
+% For example, to cause citations to be printed in roman italics font, define:
+%
+% \begin{codeblock}
+% |\renewcommand{\printscrcite}[1]{\rmfamily\it#1}|
+% \end{codeblock}
+%
+% \subsection{Conditional Blocks}\label{sec:conditionals}
+%
+% Conditional macros allow certain material to be included in some books but
+% not others.
+% For example, a musician's chord book might include extra verses with
+% alternate chordings.
+%
+% \DescMacroGroup{if}{if...}{ifchorded,iflyric,ifslides,ifpartiallist,ifsongindexes,ifmeasures,ifrawtext,iftranscapos,ifnolyrics,ifpagepreludes,ifvnumbered}
+% A conditional block begins with a macro named |\if|\meta{type}, where
+% \meta{type} is one of the types listed in the first column of
+% Table~\ref{tab:conditionals}.
+% \begin{table}
+% \newcommand\tablerule{\noalign{\hrule}}
+% \newlength\oldbaselineskip \oldbaselineskip\baselineskip
+% \newlength\oldlineskip \oldlineskip\lineskip
+% \newdimen\oldlineskiplimit \oldlineskiplimit\lineskiplimit
+% \newcommand\oninterlineskip{%
+% \baselineskip\oldbaselineskip
+% \lineskip\oldlineskip
+% \lineskiplimit\oldlineskiplimit}
+% \vbox{\offinterlineskip\hrule
+% \halign{&\vrule#&\strut\quad#\hfil\quad&\vrule#&\quad\vtop{\oninterlineskip\hsize3.5in\leftskip0.25in\parindent-0.25in\indent\vrule height\ht\strutbox width0pt depth0pt#\vrule height0pt width0pt depth\dp\strutbox\par}\quad\cr
+% height2pt&\omit&&\omit&\cr
+% &\hfil{\large\strut Type}&&\hfil{\large\strut Processed only if\kern1pt$\ldots$}&\cr\tablerule
+% height2pt&\omit&&\omit&\cr
+% &|chorded|&&the \env{chorded} option is active&\cr\tablerule
+% &|lyric|&&the \env{chorded} option is not active&\cr\tablerule
+% &|slides|&&the \env{slides} option is active&\cr\tablerule
+% &|partiallist|&&the \mac{includeonlysongs} macro is being used to extract
+% a partial list of songs&\cr\tablerule
+% &|songindexes|&&the \env{noindexes} option is not active&\cr\tablerule
+% &|measures|&&the \env{nomeasures} option is not active&\cr\tablerule
+% &|rawtext|&&the \env{rawtext} option is active&\cr\tablerule
+% &|transcapos|&&the \env{transposecapos} option is active&\cr\tablerule
+% &|nolyrics|&&the \mac{nolyrics} macro is in effect&\cr\tablerule
+% &|pagepreludes|&&the \mac{pagepreludes} macro is in effect&\cr\tablerule
+% &|vnumbered|&&the current verse is numbered (i.e., it was started
+% with \mac{beginverse} instead of \mac{beginverse}|*|)&\cr}
+% \hrule}
+% \caption{Conditional macros}\label{tab:conditionals}
+% \end{table}
+% The conditional block concludes with the macro |\fi|.
+% Between the |\if|\meta{type} and the |\fi| may also appear an |\else|.
+% For example, in the construction
+%
+% \begin{codeblock}
+% |\ifchorded|
+% \quad\meta{A}
+% |\else|
+% \quad\meta{B}
+% |\fi|
+% \end{codeblock}
+%
+% \noindent
+% material \meta{A} is only included if the \env{chorded} option is active,
+% and material \meta{B} is only included if the \env{chorded} option is not
+% active.
+%
+% \subsection{Page Layout}\label{sec:layout}
+%
+% \DescMacro{songcolumns}
+% The number of columns per page can be set with |\songcolumns|.
+% For example, to create 3 columns per page, write
+%
+% \begin{codeblock}
+% |\songcolumns{3}|
+% \end{codeblock}
+%
+% \noindent
+% The number of columns should only be changed outside of \env{songs}
+% environments.
+%
+% Setting the number of columns to zero disables the page-building algorithm
+% entirely.
+% This can be useful if you want to use an external package, such as
+% |multicol| or \LaTeX's built-in |\twocolumn| macro, to build pages.
+% For example, the following sets up an environment that is suitable for
+% a lyric book that uses |\twocolumn|:
+%
+% \begin{codeblock}
+% |\songcolumns{0}|
+% |\flushbottom|
+% |\twocolumn[\LARGE\centering My Songs]|
+% |\begin{|\env{songs}|}{}|
+% $\vdots$
+% |\end{|\env{songs}|}|
+% \end{codeblock}
+%
+% \noindent
+% When disabling the page-builder, please note the following potential
+% issues:
+%
+% \begin{itemize}
+% \item The \mac{repchoruses} feature does not work when the page-builder
+% is disabled because the page-builder is responsible for inserting
+% repeated choruses as new columns are formed.
+% \item External page-building packages tend to allow column- and
+% page-breaks within songs because they have no mechanism for moving an
+% entire song to the next column or page to avoid such a break
+% (see \mac{songpos} below).
+% \item Indexes produced with \mac{showindex} are typeset to the width of
+% the enclosing environment.
+% Thus, you should be sure to reset \LaTeX{} back to one column (via
+% |\onecolumn|) before executing \mac{showindex}.
+% \end{itemize}
+%
+% \DescMacro{pagepreludes}
+% Song preludes (i.e., the material atop each song, including the title) are
+% typeset by default at column width.
+% Writing |\pagepreludes| typesets subsequent preludes at page width atop
+% fresh pages, with the rest of the song in multiple columns beneath its title.
+% (To prohibit separation of songs from their preludes, it also sets
+% \mac{songpos} to 0.)
+%
+% \DescMacro{columnsep}
+% The horizontal distance between consecutive columns is controlled by
+% the |\columnsep| dimension.
+% For example, to separate columns by 1 centimeter of space, write
+%
+% \begin{codeblock}
+% |\columnsep=1cm|
+% \end{codeblock}
+%
+% \DescMacro{colbotglue}
+% When \LaTeX{} ends each column it inserts glue equal to |\colbotglue|.
+% In lyric books this macro is set to |0pt| so that each column ends flush with
+% the bottom of the page.
+% In other books that have ragged bottoms, it is set to stretchable
+% glue so that columns end at whatever vertical position is convenient.
+% The recommended setting for typsetting columns with ragged bottoms is:
+%
+% \begin{codeblock}
+% |\renewcommand{\colbotglue}{0pt plus .5\textheight minus 0pt}|
+% \end{codeblock}
+%
+% \DescMacro{lastcolglue}
+% The last column in a \env{songs} environment gets |\lastcolglue| appended
+% to it instead.
+% By default it is infinitely stretchable so that the last column ends
+% at its natural height.
+% By setting it to |0pt|, you can force the last column to be flush with
+% the bottom of the page:
+%
+% \begin{codeblock}
+% |\renewcommand{\lastcolglue}{0pt}|
+% \end{codeblock}
+%
+% \DescMacro{songpos}
+% The \Songs{} package uses a song-positioning algorithm that
+% moves songs to the next column or page in order to avoid column- or
+% page-breaks within songs.
+% The algorithm has four levels of aggressiveness, numbered from 0 to 3.
+% You can change the aggressiveness level by typing
+%
+% \begin{codeblock}
+% |\songpos{|\meta{level}|}|
+% \end{codeblock}
+%
+% \noindent
+% The default level is 3, which avoids column-breaks, page-breaks,
+% and page-turns within songs whenever possible.
+% (Page-turns are page-breaks after odd-numbered pages in two-sided documents,
+% or after all pages in one-sided documents.)
+% Level 2 avoids page-breaks and page-turns but allows column-breaks within
+% songs.
+% Level 1 avoids only page-turns within songs.
+% Level 0 turns off the song-positioning algorithm entirely.
+% This causes songs to be positioned wherever \TeX{} thinks is best
+% based on penalty settings (see \mac{vvpenalty} and \mac{spenalty}).
+%
+% \DescMacro{spenalty}
+% The value of |\spenalty| controls the undesirability of column breaks
+% at song boundaries.
+% Usually it should be set to a value between 0 and \mac{vvpenalty} so that
+% breaks between songs are preferable to breaks between verses within a song.
+% By default it is set to 100.
+% When it is $-10000$ or less, breaks between songs are required, so that
+% each song always begins a fresh column.
+%
+% \subsection{Indexes}\label{sec:idxcust}
+%
+% \paragraph{Index Appearance.}
+% \DescMacro{indexsongsas}
+% By default, the right-hand side of each index entry contains a list of
+% one or more song numbers.
+% To instead list page numbers, use the |\indexsongsas| macro:
+%
+% \begin{codeblock}
+% |\indexsongsas{|\meta{id}|}{\thepage}|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{id} is the same identifier used in the \mac{newindex},
+% \mac{newauthorindex}, or \mac{newscripindex} macro that created the index.
+% The second argument must always be something that expands into raw text
+% without any formatting, since this text gets output to auxiliary files that
+% are lexographically sorted by the index-generation program.
+% To go back to indexing songs by song number, use \mac{thesongnum} in place
+% of |\thepage| in the above.
+%
+% \DescMacro{sepindexestrue}
+% \DescMacro{sepindexesfalse}
+% Indexes are by default typeset on separate pages, and when an index is
+% sufficiently small, it is centered on the page in one column.
+% To disable these defaults, write |\sepindexesfalse|.
+% This causes indexes to avoid using unnecessary vertical space or
+% starting unnecessary new pages.
+% To re-enable the defaults, use |\sepindexestrue|.
+%
+% \DescMacro{idxrefsfont}
+% To control the formatting of the list of references on the right-hand side
+% of index entries, redefine |\idxrefsfont|.
+% For example, to typeset each list in boldface, write
+%
+% \begin{codeblock}
+% |\renewcommand{\idxrefsfont}{\bfseries}|
+% \end{codeblock}
+%
+% \DescMacro{idxtitlefont}
+% \DescMacro{idxlyricfont}
+% Title indexes contain entries for song titles and also entries for notable
+% lines of lyrics.
+% The fonts for these entries are controlled by |\idxtitlefont| and
+% |\idxlyricfont|, respectively.
+% For example, to show title entries in boldface sans-serif and lyric entries
+% in regular roman font, one could define:
+%
+% \begin{codeblock}
+% |\renewcommand{\idxtitlefont}{\sffamily\bfseries}|
+% |\renewcommand{\idxlyricfont}{\rmfamily\mdseries}|
+% \end{codeblock}
+%
+% \DescMacro{idxheadfont}
+% To change the font used to typeset the capital letters that start each
+% alphabetic section of a large title index, redefine |\idxheadfont|.
+% For example, to typeset those letters in italics instead of boldface, type
+%
+% \begin{codeblock}
+% |\renewcommand{\idxheadfont}{\sffamily\it\LARGE}|
+% \end{codeblock}
+%
+% \DescMacro{idxbgcolor}
+% To change the background color of the shaded boxes that contain the
+% capital letters that start each alphabetic sectino of a large title
+% index, redefine |\idxbgcolor|.
+% For example:
+%
+% \begin{codeblock}
+% |\renewcommand{\idxbgcolor}{red}|
+% \end{codeblock}
+%
+% \DescMacro{idxheadwidth}
+% The |\idxheadwidth| length defines the width of the shaded boxes that
+% begin each alphabetic block of a large title index.
+% Setting it to 0pt suppresses the boxes entirely.
+% For example, to set the width of those boxes to 1 centimeter, you could
+% define
+%
+% \begin{codeblock}
+% |\setlength{\idxheadwidth}{1cm}|
+% \end{codeblock}
+%
+% \DescMacro{idxauthfont}
+% The font used to typeset entries of an author index is controlled by
+% |\idxauthfont|.
+% For example, to typeset such entries in italics instead of boldface, type
+%
+% \begin{codeblock}
+% |\renewcommand{\idxauthfont}{\small\it}|
+% \end{codeblock}
+%
+% \DescMacro{idxscripfont}
+% The font used to typeset entries of a scripture index is controlled by
+% |\idxscripfont|.
+% For example, to typeset such entries in boldface instead of italics, type
+%
+% \begin{codeblock}
+% |\renewcommand{\idxscripfont}{\sffamily\small\bfseries}|
+% \end{codeblock}
+%
+% \DescMacro{idxbook}
+% To control the formatting of the lines that start each new book of the
+% bible in a scripture index, redefine |\idxbook|, which accepts the book
+% name as its single argument.
+% For example, to typeset each book name in a box, one could define
+%
+% \begin{codeblock}
+% |\renewcommand{\idxbook}[1]{\framebox{\small\bfseries#1}}|
+% \end{codeblock}
+%
+% \DescMacro{idxcont}
+% In a scripture index, when a column break separates a block of entries
+% devoted to a book of the bible, the new column is titled
+% ``\meta{bookname} (continued)'' by default.
+% You can change this default by redefining the |\idxcont| macro, which
+% receives the \meta{bookname} as its single argument.
+% For example, to typeset an index in German, one might define
+%
+% \begin{codeblock}
+% |\renewcommand{\idxcont}[1]{\small\textbf{#1} (fortgefahren)}|
+% \end{codeblock}
+%
+% \paragraph{PDF bookmarks and links.}
+% \DescMacro{songtarget}
+% \DescMacro{songlink}
+% Each \env{song} environment adds a PDF bookmark (if generating a PDF)
+% and hyperlink target (if using the |hyperref| package) for the
+% song by invoking |\songtarget| with two arguments:
+% (1) a suggested PDF bookmark level, and (2) a link target name.
+% Links in indexes to these targets are created by |\songlink|, which
+% also gets two arguments:
+% (1) the link target name (same as the second argument to \mac{songtarget}),
+% and (2) the text to be linked.
+%
+% Redefine these macros to customize or suppress these bookmarks and targets.
+% For example, to enable both bookmarks and links (the default behavior) use:
+%
+% \begin{codeblock}
+% |\renewcommand{\songtarget}[2]|
+% | {\pdfbookmark[#1]{|\mac{thesongnum}|. |\mac{songtitle}|}{#2}}|
+% |\renewcommand{\songlink}[2]{\hyperlink{#1}{#2}}|
+% \end{codeblock}
+%
+% \noindent
+% To enable links but not bookmarks, use:
+%
+% \begin{codeblock}
+% |\renewcommand{\songtarget}[2]{\hypertarget{#2}{\relax}}|
+% |\renewcommand{\songlink}[2]{\hyperlink{#1}{#2}}|
+% \end{codeblock}
+%
+% \noindent
+% To disable both bookmarks and links, use:
+%
+% \begin{codeblock}
+% |\renewcommand{\songtarget}[2]{}|
+% |\renewcommand{\songlink}[2]{#2}|
+% \end{codeblock}
+%
+% \paragraph{Alphabetization Options.}
+% \DescMacro{titleprefixword}
+% In English, when a title begins with ``The'' or ``A'', it is traditional to
+% move these words to the end of the title and sort the entry by the following
+% word.
+% So for example, ``The Song Title'' is typically indexed as
+% ``Song Title, The''.
+% To change this default behavior, you can use |\titleprefixword| in the
+% document preamble to identify each word to be moved to the end whenever
+% it appears as the first word of a title index entry.
+% For example, to cause the word ``I'' to be moved to the end of title index
+% entries, one could say,
+%
+% \begin{codeblock}
+% |\titleprefixword{I}|
+% \end{codeblock}
+%
+% \noindent
+% The first use of |\titleprefixword| overrides the defaults, so if you also
+% want to continue to move ``The'' and ``A'' to the end of entries, you must
+% also say |\titleprefixword{The}| and |\titleprefixword{A}| explicitly.
+% This macro may only be used in the document preamble but may be used
+% multiple times to declare multiple prefix words.
+%
+% \paragraph{Special Words In Song Info.}
+% \DescMacro{authsepword}
+% When parsing author index entries, the word ``and'' is recognized by the
+% |songidx| program as a conjunctive that separates author names.
+% To override this default and specify a different conjunctive, use the
+% |\authsepword| macro one or more times in the document preamble.
+% For example, to instead treat ``und'' as a conjunctive, you could say,
+%
+% \begin{codeblock}
+% |\authsepword{und}|
+% \end{codeblock}
+%
+% \noindent
+% The first use of |\authsepword| and each of the following macros overrides
+% the default, so if you also want to continue to treat ``and'' as a
+% conjunctive, you must also say |\authsepword{and}| explicitly.
+% The |\authsepword| macro and each of the following macros may only be used
+% in the document preamble but may be used multiple times to declare multiple
+% special words.
+%
+% \DescMacro{authbyword}
+% When parsing author index entries, the word ``by'' is recognized as a
+% keyword signaling that the index entry should only include material
+% in the current list item that follows the word ``by''.
+% So for example, ``Music by J.S. Bach'' is indexed as ``Bach, J.S.''
+% rather than ``Bach, Music by J.S.''
+% To recognize a different word instead of ``by'', you can use |\authbyword|
+% in the document preamble.
+% For example, to recognize ``durch'' instead, you could say
+%
+% \begin{codeblock}
+% |\authbyword{durch}|
+% \end{codeblock}
+%
+% \DescMacro{authignoreword}
+% When parsing author index entries, if a list item contains the word
+% ``unknown'', that item is ignored and is not indexed.
+% This prevents items like ``Composer unknown'' from being indexed as names.
+% To cause the indexer to recognize and ignore a different word, you can
+% use the |\authignoreword| macro in the document preamble.
+% For example, to ignore author index entries containing the word
+% ``unbekannt'', you could say,
+%
+% \begin{codeblock}
+% |\authignoreword{unbekannt}|
+% \end{codeblock}
+%
+% \subsection{Page Headers and Footers}
+%
+% In \LaTeX, page headers and footers are defined using a system of
+% invisible \emph{marks} that get inserted into the document at the
+% beginning of each logical unit of the document (e.g., each section, song,
+% verse, and chorus).
+% The headers and footers are then defined so as to refer to the first
+% and/or last invisible mark that ends up on each page once the document
+% is divided into pages.
+% This section describes the marks made available by the \Songs{} package.
+% For more detailed information about the marks already provided by
+% \LaTeX{} and how to use them, consult any \LaTeX{} user manual.
+%
+% \DescMacro{songmark}
+% \DescMacro{versemark}
+% \DescMacro{chorusmark}
+% To add song information to page headings and footers, redefine |\songmark|,
+% |\versemark|, or |\chorusmark| to add the necessary \TeX{} marks to the
+% current page whenever a new song, verse, or chorus begins.
+% These macros expect no arguments; to access the current song's
+% information including titles, use the macros documented in
+% \S\ref{sec:songinfo}.
+% To access the current song's number or the current verse's number, use
+% \mac{thesongnum} or \mac{theversenum} (see \S\ref{sec:numbering}).
+% For example, to include the song number in the page headings produced by
+% \LaTeX's |\pagestyle{myheadings}| feature, you could redefine |\songmark|
+% as follows:
+%
+% \begin{codeblock}
+% |\renewcommand{\songmark}{\markboth{|\mac{thesongnum}|}{|\mac{thesongnum}|}}|
+% \end{codeblock}
+%
+% \subsection{Defining New Beginsong Keyvals}\label{sec:newkey}
+%
+% \DescMacro{newsongkey}
+% The \mac{beginsong} macro supports several optional keyval parameters for
+% declaring song information, including \env{by=}, \env{sr=}, and \env{cr=}.
+% Users can define their own additional keyvals as well.
+% To do so, use the |\newsongkey| macro, which has the syntax
+%
+% \begin{codeblock}
+% |\newsongkey{|\meta{keyname}|}{|\meta{initcode}|}[|\meta{default}|]{|\meta{setcode}|}|
+% \end{codeblock}
+%
+% \noindent
+% Here, \meta{keyname} is the name of the new key for the keyval,
+% \meta{initcode} is \LaTeX{} code that is executed at the start of each
+% \mac{beginsong} line before the \mac{beginsong} arguments are processed,
+% \meta{default} (if specified) is the default value used for the keyval when
+% \meta{keyname} appears in \mac{beginsong} without a value,
+% and \meta{setcode} is macro code that is executed whenever
+% \meta{key} is parsed as part of the \mac{beginsong} keyval arguments.
+% In \meta{setcode}, |#1| expands to the value given by the user for the
+% keyval (or to \meta{default} if no value was given).
+%
+% For example, to define a new song key called |arr| which stores its
+% value in a macro called |\arranger|, one could write:
+%
+% \begin{codeblock}
+% |\newcommand{\arranger}{}|
+% |\newsongkey{arr}{\def\arranger{}}|
+% | {\def\arranger{Arranged by #1\par}}|
+% \end{codeblock}
+%
+% \noindent
+% Then one could redefine \mac{extendprelude} to print the arranger below the
+% other song header information:
+%
+% \begin{codeblock}
+% |\renewcommand{\extendprelude}{|
+% | |\mac{showrefs}\mac{showauthors}
+% | {\bfseries\arranger}|
+% |}|
+% \end{codeblock}
+%
+% \noindent
+% A \mac{beginsong} line could then specify the song's arranger as follows:
+%
+% \begin{codeblock}
+% \mac{beginsong}|{The Title}[arr={R. Ranger}]|
+% $\vdots$
+% \mac{endsong}
+% \end{codeblock}
+%
+% \noindent This produces
+%
+% \begin{sample}
+% \setcounter{songnum}{1}%
+% \vskip1pt%
+% \newcommand\arranger{}%
+% \newsongkey{arr}{\def\arranger{}}%
+% {\def\arranger{Arranged by #1\par}}%
+% \renewcommand{\extendprelude}{
+% \showrefs\showauthors
+% {\bfseries\arranger}
+% }%
+% \beginsong{The Title}[arr={R. Ranger}]
+% \endsong
+% \renewcommand{\extendprelude}{}%
+% \end{sample}
+%
+% For more detailed information about keyvals and how they work, consult the
+% documentation for David Carlisle's |keyval| package, which comes standard
+% with most \LaTeXe{} installations.
+%
+% \subsection{Font Kerning Corrections}
+%
+% \paragraph{Chord Overstriking.}
+% In order to conserve space and keep songs readable, the \Songs{} package
+% pushes chords down very close to the lyrics with which they are paired.
+% Unfortunately, this can sometimes cause low-hanging characters in chord
+% names to overstrike the lyrics they sit above.
+% For example,
+%
+% \example|\[(Gsus4/D)]Overstrike|\produces{\[(Gsus4/D)]Overstrike}
+% \eat\]
+%
+% \noindent
+% Note that the parentheses and slash symbols in the chord name have
+% invaded the lyric that sits beneath them.
+%
+% \DescMacro{chordlocals}
+% The best solution to this problem is to use a font for chord names that
+% minimizes low-hanging symbols; but if you lack such a font, then the
+% following trick works pretty well.
+% Somewhere in the preamble of your document, you can write the following
+% \LaTeX{} code:
+%
+% \begin{codeblock}
+% |\renewcommand{\chordlocals}{\catcode`(\active|
+% | \catcode`)\active|
+% | \catcode`/\active}|
+% |\newcommand{\smraise}[1]{\raise2pt\hbox{\small#1}}|
+% |\newcommand{\myslash}{\smraise/}|
+% |\newcommand{\myopenparen}{\smraise(|\eat)|}|
+% |\newcommand{\mycloseparen}{\smraise)}|
+% |{\chordlocals|
+% | \global\let(\myopenparen|
+% | \global\let)\mycloseparen|
+% | \global\let/\myslash}|
+% \end{codeblock}
+%
+% \noindent
+% This sets the |/|, |(|, and |)| symbols as active characters whenever they
+% appear within chord names.
+% \ImplOrDesc
+% {(See \S\ref{sec:chordlocals} for documentation of the
+% \texttt{\string\chordlocals} hook.)}
+% {(Recompile this documentation to include the implementation section
+% for more information about the \texttt{\string\chordlocals} macro.)}
+% Each active character is defined so that it produces a smaller, raised
+% version of the original symbol.
+% The result is as follows:
+%
+% \renewcommand{\chordlocals}{\catcode`(\active
+% \catcode`)\active
+% \catcode`/\active}
+% \newcommand{\smraise}[1]{\raise2pt\hbox{\small#1}}
+% \newcommand{\myslash}{\smraise/}
+% \newcommand{\myopenparen}{\smraise(}
+% \newcommand{\mycloseparen}{\smraise)}
+% {\chordlocals
+% \global\let(\myopenparen
+% \global\let)\mycloseparen
+% \global\let/\myslash}
+%
+% \example|\[(Gsus4/D)]Overstrike (fixed)|\produces{\[(Gsus4/D)]Overstrike (fixed)}
+% \eat\]
+%
+% \renewcommand\chordlocals{}
+%
+% \noindent
+% As you can see, the low-hanging symbols have been elevated so that they
+% sit above the baseline, correcting the overstrike problem.
+%
+% \paragraph{Scripture Font Quotation Marks.}
+% \DescMacro{shiftdblquotes}
+% The \Songs{} package compensates for a kerning problem in the Zaph Chancery
+% font (used to typeset scripture quotations) by redefining the |``| and |''|
+% token sequences to be active characters that yield double-quotes shifted
+% 1.1 points and 2 points left, respectively, of their normal positions.
+% If you use a different font size for scripture quotations, then you can use
+% the |\shiftdblquotes| macro when redefining \mac{scripturefont} to change
+% this kerning correction.
+% For example,
+%
+% \begin{codeblock}
+% |\renewcommand{|\mac{scripturefont}|}{|
+% | \usefont{OT1}{pzc}{mb}{it}|
+% | \shiftdblquotes{-1pt}{-2pt}{-3pt}{-4pt}|
+% |}|
+% \end{codeblock}
+%
+% \noindent
+% removes 1 point of space to the left and 2 points of space to the
+% right of left-double-quote characters, and 3 points to the left and 4 points
+% to the right of right-double-quotes, within scripture quotations.
+%
+% \section{Informational Macros}\label{sec:songinfo}
+%
+% The macros described in this section can be used to retrieve information
+% about the current song.
+% This can be used when redefining \mac{extendprelude}, \mac{extendpostlude},
+% \mac{makeprelude}, \mac{makepostlude}, \mac{songmark}, \mac{versemark}, or
+% \mac{chorusmark}, or any other macros that might typeset this information.
+%
+% \DescMacro{songauthors}
+% To get the current song's list of authors (if any) use |\songauthors|.
+% This yields the value of the \env{by=} key used in the \mac{beginsong}
+% line.
+%
+% \DescMacro{songrefs}
+% To get the current song's list of scripture references (if any) use
+% |\songrefs|.
+% This yields the value of the \env{sr=} key used in the \mac{beginsong}
+% line, but modified with hyphens changed to en-dashes and spaces falling
+% within a list of verse numbers changed to thin spaces for better
+% typesetting.
+% In addition, various penalties have been added to inhibit line breaks
+% in strange places and encourage line breaks in others.
+%
+% \DescMacro{songcopyright}
+% To get the current song's copyright info (if any), use |\songcopyright|.
+% This yields the value of the \env{cr=} key used in the \mac{beginsong} line.
+%
+% \DescMacro{songlicense}
+% To get the current song's licensing information (if any), use
+% |\songlicense|.
+% This yields the value of the \env{li=} key used in the \mac{beginsong}
+% line, or whatever text was declared with \mac{setlicense}.
+%
+% \DescMacro{songtitle}
+% The |\songtitle| macro yields the current song's title.
+% By default this is the first title provided in the \mac{beginsong} line.
+% The \mac{nexttitle} and \mac{foreachtitle} macros (see below) cause it
+% to be set to the current song's other titles, if any.
+%
+% \DescMacro{resettitles}
+% To get the current song's primary title (i.e., the first title specified
+% in the song's \mac{beginsong} line), execute |\resettitles|.
+% This sets the |\songtitle| macro to be the song's primary title.
+%
+% \DescMacro{nexttitle}
+% To get the song's next title, execute |\nexttitle|, which
+% sets |\songtitle| to be the next title in the song's list of titles
+% (or sets |\songtitle| to |\relax| if there are no more titles).
+%
+% \DescMacro{foreachtitle}
+% The |\foreachtitle| macro accepts \LaTeX{} code as its single
+% argument and executes it once for each (remaining) song title.
+% Within the provided code, use |\songtitle| to get the current title.
+% For example, the following code generates a comma-separated list of all
+% of the current song's titles:
+%
+% \begin{codeblock}
+% \mac{resettitles}
+% \mac{songtitle}
+% \mac{nexttitle}
+% |\foreachtitle{, |\mac{songtitle}|}|
+% \end{codeblock}
+%
+% \DescMacro{songlist}
+% When \mac{includeonlysongs} is used to extract a partial list of songs, the
+% |\songlist| macro expands to the comma-separated list of songs that is being
+% extracted.
+% Redefining |\songlist| within the document preamble alters the list of
+% songs to be extracted.
+% Redefining it after the preamble may have unpredictable results.
+%
+% \section{Index Generation}
+%
+% The material in this section describes macros provided by the \Songs\
+% package that are used during the automatic generation of the song book
+% indexes.
+% Since index generation is automatic, document authors should not
+% normally need to use any of these macros directly.
+% The documentation in this section is therefore provided purely for
+% completeness and for informational purposes.
+% For instructions on how to automatically generate indexes when compiling
+% a song book, see \S\ref{sec:compiling}.
+% For info on how to customize the appearance of indexes, see
+% \S\ref{sec:idxcust}.
+%
+% Automatic generation of song book indexes is a three stage process:
+%
+% \begin{enumerate}
+%
+% \item
+% Each time a song book \LaTeX{} file is compiled, an auxiliary file named
+% \meta{filename}|.sxd| is written out for each \meta{filename}
+% defined using \mac{newindex}, \mac{newauthorindex}, or \mac{newscripindex}.
+% These |.sxd| files are plain text files that can be viewed using any
+% standard text editor.
+% They begin with a line identifying the type of index (title, author, or
+% scripture) and then contain triples of lines, one triple for each song to
+% appear in the index.
+% The first line of a triple has the information by which the song is to be
+% indexed (a title, author, or scripture reference).
+% The second line has the song's number in the book (yielded by
+% \mac{thesongnum}).
+% The third line is an identifying label for the song used in hyperlinking.
+%
+% \item
+% Once the |.sxd| files have been generated, an external program is used
+% to transform each |.sxd| file into a |.sbx| file.
+% Since the standard |makeindex| program provided with \LaTeX{} is not powerful
+% enough to sort scripture references, distributions of \Songs{} package come
+% with a specialized |songidx| program to do this.
+%
+% \item
+% The |.sbx| files produced by the |songidx| program are then read
+% in by the \mac{showindex} macro next time the source document is
+% compiled using \LaTeX.
+% These |.sbx| files consist of the macros and environments described below.
+%
+% \end{enumerate}
+%
+% \DescEnv{idxblock}
+% In indexes that are blocked off into sections, one for each letter of the
+% alphabet, the \meta{filename}|.sbx| files generated for that index
+% consist of a series of |idxblock| environments, one for each such section.
+% An |idxblock| environment begins and ends with
+%
+% \begin{codeblock}
+% |\begin{idxblock}{|\meta{letter}|}|
+% $\vdots$
+% |\end{idxblock}|
+% \end{codeblock}
+%
+% \noindent
+% where \meta{letter} is the letter of the alphabet for that block.
+%
+% \DescMacro{idxentry}
+% \DescMacro{idxaltentry}
+% The index entries themselves are created by lines of the form
+%
+% \begin{codeblock}
+% |\idxentry{|\meta{leftside}|}{|\meta{rightside}|}|
+% |\indexaltentry{|\meta{leftside}|}{|\meta{rightside}|}|
+% \end{codeblock}
+%
+% \noindent
+% each of which creates an index entry with \meta{leftside} on the left,
+% followed by a series of dots, followed by \meta{rightside} on the
+% right.
+% The |\indexentry| macro is used for ``normal'' entries (e.g., titles in a
+% title index), and |\indexaltentry| is used for ``alternate'' entries
+% (e.g., lyric lines in a title index).
+%
+% Within \meta{rightside}, multiple items are separated with |\\|
+% macros instead of commas.
+% When used in an index |.sbx| file, the |\\| macro produces a comma followed
+% by some complex spacing that allows index lines to be broken suitably if
+% they are too long to fit in one physical line.
+%
+% \section{Other Resources}
+%
+% There are a number of other \LaTeX{} packages available for typesetting
+% songs, tablature diagrams, or song books.
+% Probably the best of these is the \Rath{} package by Christopher Rath
+% (\href{http://rath.ca/Misc/Songbook/}{{\tt http://rath.ca/Misc/Songbook/}}).
+% Most of the differences between other packages and this one are intentional;
+% the following is a summary of where I've adopted various differing design
+% decisions and why.
+%
+% \bigskip
+%
+% \paragraph{Ease of Song Entry.}
+% Much of the \Songs{} package programming is devoted to easing the burden of
+% typing chords.
+% With most \LaTeX{} song book packages the user types chords using a standard
+% \LaTeX{} macro syntax like |\chord{|\meta{chord}|}{|\meta{lyric}|}|.
+% The \Songs{} package uses a less conventional
+% |\[|\meta{chord}|]|\meta{lyric}\eat\] syntax for several
+% reasons detailed below.
+%
+% First, macros in the standard \LaTeX{} syntax require more key-presses
+% than macros in the \Songs{} package's syntax.
+% This can become become very taxing when typing up a large book.
+% Chords often appear as frequently as one per syllable, especially in hymns,
+% so keeping the syntax as brief as possible is desirable.
+%
+% Second, the standard \LaTeX{} macro syntax requires the user to estimate how
+% much of the \meta{lyric} will lie below the chord (because the \meta{lyric}
+% part must be enclosed in braces) whereas the \Songs{} package's syntax does
+% not.
+% Estimating this accurately can be quite difficult, since in many cases the
+% \meta{lyric} part must include punctuation or multiple words to get proper
+% results.
+% The \Songs{} package automates this for the user, significantly easing the
+% task of chord-entry.
+%
+% Third, unlike the standard \LaTeX{} chord syntax, the \Songs{} package's
+% syntax handles all hyphenation of chorded lyrics fully automatically.
+% Extra hyphenation must be introduced in chord books wherever a chord
+% is wider than the syllable it sits above.
+% With the standard \LaTeX{} chord syntax such hyphenation must be
+% introduced manually by the user (usually via a special hyphenation macro),
+% but the \Songs{} package does this automatically.
+%
+% Fourth and finally, some other packages allow the user to use ``|b|''
+% in a \meta{chord} to produce a flat symbol, whereas the \Songs{} package
+% requires an ``|&|'' instead.
+% Using ``|b|'' is more intuitive but prevents the
+% use of ``|b|'' for any other purpose within a \meta{chord}, such as to
+% produce a literal ``b'' or to type another macro name like |\hbox| that
+% contains a ``b''.
+% Consequently, the \Songs{} package uses the less obvious ``|&|'' symbol to
+% produce flat symbols.
+%
+% \paragraph{Song Structure.}
+% The \Songs{} package provides a relatively small number of macros for
+% typesetting high-level song structure, including verses, choruses,
+% textual comments, and conditional macros that indicate that certain sections
+% should go in chord books but not lyric books.
+% These can be combined to typeset more sophisticated structures such as
+% intros, bridges, brackets, endings, and the like.
+% This is done in lieu of providing a specific macro for each of these
+% structures since it results in greater flexibility and fewer macros for
+% users to learn.
+%
+% \paragraph{Multiple columns.}
+% The \Songs{} package was designed from the ground up to produce song books
+% with many songs per page, arranged in multiple columns.
+% As a result, it includes elaborate support for many features not found in
+% most other packages, such as automatic column balancing, completely
+% customizable song header and song footer blocks, and facilities for adding
+% beautiful scripture quotations to fill in gaps between songs.
+%
+% \paragraph{Indexes.}
+% Another major feature of the \Songs{} package is its support for a variety
+% of different index types, most notably indexes arranged by scripture
+% reference.
+% Scripture indexes can be invaluable for planning services around particular
+% sermons or topics.
+% The \Songs{} package allows book authors to specify the names and preferred
+% ordering of books of the bible, and automatically handles complex issues
+% like overlapping verse ranges to produce an easy-to-read, compact, and
+% well-ordered index.
+% Other supported indexes include those sorted by author, by title, and by
+% notable lines of lyrics.
+%
+% \paragraph{Automatic Transposition.}
+% The \Songs{} package has a facility for automatically transposing songs, and
+% even generating chord books that print the chords in multiple keys (e.g., so
+% that a pianist and guitarist using a capo can play together from the same
+% book).
+%
+% \bigskip
+%
+% The \Songs{} package was developed entirely independently of all other
+% \LaTeX{} song book packages.
+% I originally developed the set of \LaTeX{} macros that eventually became
+% the \Songs{} package in order to typeset a song book for the Graduate
+% Christian Fellowship (GCF) at Cornell University, and the Cornell
+% International Christian Fellowship (CICF).
+% Once I had fine-tuned my package to be sufficiently versatile, I decided
+% to release it for public use.
+% At that time I noticed the \Rath{} package and others, and wrote this
+% summary of the most prominent differences.
+%
+% For information on more song-typesetting resources for \LaTeX, I recommend
+% consulting the documentation provided with the \Rath{} package.
+% It includes an excellent list of other resources that might be of interest
+% to creators of song books.
+%
+% \section{GNU General Public License}\label{sec:license}
+%
+% \begingroup\small
+%
+% \begin{center}
+% {\large\sc Terms and Conditions For \\ Copying, Distribution and Modification}
+% \end{center}
+%
+% \begin{enumerate}\addtocounter{enumi}{-1}
+%
+% \item
+%
+% This License applies to any program or other work which contains a notice
+% placed by the copyright holder saying it may be distributed under the
+% terms of this General Public License. The ``Program'', below, refers to
+% any such program or work, and a ``work based on the Program'' means either
+% the Program or any derivative work under copyright law: that is to say, a
+% work containing the Program or a portion of it, either verbatim or with
+% modifications and/or translated into another language. (Hereinafter,
+% translation is included without limitation in the term ``modification''.)
+% Each licensee is addressed as ``you''.
+%
+% Activities other than copying, distribution and modification are not
+% covered by this License; they are outside its scope. The act of
+% running the Program is not restricted, and the output from the Program
+% is covered only if its contents constitute a work based on the
+% Program (independent of having been made by running the Program).
+% Whether that is true depends on what the Program does.
+%
+% \item You may copy and distribute verbatim copies of the Program's source
+% code as you receive it, in any medium, provided that you conspicuously
+% and appropriately publish on each copy an appropriate copyright notice
+% and disclaimer of warranty; keep intact all the notices that refer to
+% this License and to the absence of any warranty; and give any other
+% recipients of the Program a copy of this License along with the Program.
+%
+% You may charge a fee for the physical act of transferring a copy, and you
+% may at your option offer warranty protection in exchange for a fee.
+%
+% \item
+%
+% You may modify your copy or copies of the Program or any portion
+% of it, thus forming a work based on the Program, and copy and
+% distribute such modifications or work under the terms of Section~1
+% above, provided that you also meet all of these conditions:
+%
+% \begin{enumerate}
+%
+% \item
+%
+% You must cause the modified files to carry prominent notices stating that
+% you changed the files and the date of any change.
+%
+% \item
+%
+% You must cause any work that you distribute or publish, that in
+% whole or in part contains or is derived from the Program or any
+% part thereof, to be licensed as a whole at no charge to all third
+% parties under the terms of this License.
+%
+% \item
+% If the modified program normally reads commands interactively
+% when run, you must cause it, when started running for such
+% interactive use in the most ordinary way, to print or display an
+% announcement including an appropriate copyright notice and a
+% notice that there is no warranty (or else, saying that you provide
+% a warranty) and that users may redistribute the program under
+% these conditions, and telling the user how to view a copy of this
+% License. (Exception: if the Program itself is interactive but
+% does not normally print such an announcement, your work based on
+% the Program is not required to print an announcement.)
+%
+% \end{enumerate}
+%
+% These requirements apply to the modified work as a whole. If
+% identifiable sections of that work are not derived from the Program,
+% and can be reasonably considered independent and separate works in
+% themselves, then this License, and its terms, do not apply to those
+% sections when you distribute them as separate works. But when you
+% distribute the same sections as part of a whole which is a work based
+% on the Program, the distribution of the whole must be on the terms of
+% this License, whose permissions for other licensees extend to the
+% entire whole, and thus to each and every part regardless of who wrote it.
+%
+% Thus, it is not the intent of this section to claim rights or contest
+% your rights to work written entirely by you; rather, the intent is to
+% exercise the right to control the distribution of derivative or
+% collective works based on the Program.
+%
+% In addition, mere aggregation of another work not based on the Program
+% with the Program (or with a work based on the Program) on a volume of
+% a storage or distribution medium does not bring the other work under
+% the scope of this License.
+%
+% \item
+% You may copy and distribute the Program (or a work based on it,
+% under Section~2) in object code or executable form under the terms of
+% Sections~1 and~2 above provided that you also do one of the following:
+%
+% \begin{enumerate}
+%
+% \item
+%
+% Accompany it with the complete corresponding machine-readable
+% source code, which must be distributed under the terms of Sections~1
+% and~2 above on a medium customarily used for software interchange; or,
+%
+% \item
+%
+% Accompany it with a written offer, valid for at least three
+% years, to give any third party, for a charge no more than your
+% cost of physically performing source distribution, a complete
+% machine-readable copy of the corresponding source code, to be
+% distributed under the terms of Sections~1 and~2 above on a medium
+% customarily used for software interchange; or,
+%
+% \item
+%
+% Accompany it with the information you received as to the offer
+% to distribute corresponding source code. (This alternative is
+% allowed only for noncommercial distribution and only if you
+% received the program in object code or executable form with such
+% an offer, in accord with Subsection~b above.)
+%
+% \end{enumerate}
+%
+% The source code for a work means the preferred form of the work for
+% making modifications to it. For an executable work, complete source
+% code means all the source code for all modules it contains, plus any
+% associated interface definition files, plus the scripts used to
+% control compilation and installation of the executable. However, as a
+% special exception, the source code distributed need not include
+% anything that is normally distributed (in either source or binary
+% form) with the major components (compiler, kernel, and so on) of the
+% operating system on which the executable runs, unless that component
+% itself accompanies the executable.
+%
+% If distribution of executable or object code is made by offering
+% access to copy from a designated place, then offering equivalent
+% access to copy the source code from the same place counts as
+% distribution of the source code, even though third parties are not
+% compelled to copy the source along with the object code.
+%
+% \item
+% You may not copy, modify, sublicense, or distribute the Program
+% except as expressly provided under this License. Any attempt
+% otherwise to copy, modify, sublicense or distribute the Program is
+% void, and will automatically terminate your rights under this License.
+% However, parties who have received copies, or rights, from you under
+% this License will not have their licenses terminated so long as such
+% parties remain in full compliance.
+%
+% \item
+% You are not required to accept this License, since you have not
+% signed it. However, nothing else grants you permission to modify or
+% distribute the Program or its derivative works. These actions are
+% prohibited by law if you do not accept this License. Therefore, by
+% modifying or distributing the Program (or any work based on the
+% Program), you indicate your acceptance of this License to do so, and
+% all its terms and conditions for copying, distributing or modifying
+% the Program or works based on it.
+%
+% \item
+% Each time you redistribute the Program (or any work based on the
+% Program), the recipient automatically receives a license from the
+% original licensor to copy, distribute or modify the Program subject to
+% these terms and conditions. You may not impose any further
+% restrictions on the recipients' exercise of the rights granted herein.
+% You are not responsible for enforcing compliance by third parties to
+% this License.
+%
+% \item
+% If, as a consequence of a court judgment or allegation of patent
+% infringement or for any other reason (not limited to patent issues),
+% conditions are imposed on you (whether by court order, agreement or
+% otherwise) that contradict the conditions of this License, they do not
+% excuse you from the conditions of this License. If you cannot
+% distribute so as to satisfy simultaneously your obligations under this
+% License and any other pertinent obligations, then as a consequence you
+% may not distribute the Program at all. For example, if a patent
+% license would not permit royalty-free redistribution of the Program by
+% all those who receive copies directly or indirectly through you, then
+% the only way you could satisfy both it and this License would be to
+% refrain entirely from distribution of the Program.
+%
+% If any portion of this section is held invalid or unenforceable under
+% any particular circumstance, the balance of the section is intended to
+% apply and the section as a whole is intended to apply in other
+% circumstances.
+%
+% It is not the purpose of this section to induce you to infringe any
+% patents or other property right claims or to contest validity of any
+% such claims; this section has the sole purpose of protecting the
+% integrity of the free software distribution system, which is
+% implemented by public license practices. Many people have made
+% generous contributions to the wide range of software distributed
+% through that system in reliance on consistent application of that
+% system; it is up to the author/donor to decide if he or she is willing
+% to distribute software through any other system and a licensee cannot
+% impose that choice.
+%
+% This section is intended to make thoroughly clear what is believed to
+% be a consequence of the rest of this License.
+%
+% \item
+% If the distribution and/or use of the Program is restricted in
+% certain countries either by patents or by copyrighted interfaces, the
+% original copyright holder who places the Program under this License
+% may add an explicit geographical distribution limitation excluding
+% those countries, so that distribution is permitted only in or among
+% countries not thus excluded. In such case, this License incorporates
+% the limitation as if written in the body of this License.
+%
+% \item
+% The Free Software Foundation may publish revised and/or new versions
+% of the General Public License from time to time. Such new versions will
+% be similar in spirit to the present version, but may differ in detail to
+% address new problems or concerns.
+%
+% Each version is given a distinguishing version number. If the Program
+% specifies a version number of this License which applies to it and ``any
+% later version'', you have the option of following the terms and conditions
+% either of that version or of any later version published by the Free
+% Software Foundation. If the Program does not specify a version number of
+% this License, you may choose any version ever published by the Free Software
+% Foundation.
+%
+% \item
+% If you wish to incorporate parts of the Program into other free
+% programs whose distribution conditions are different, write to the author
+% to ask for permission. For software which is copyrighted by the Free
+% Software Foundation, write to the Free Software Foundation; we sometimes
+% make exceptions for this. Our decision will be guided by the two goals
+% of preserving the free status of all derivatives of our free software and
+% of promoting the sharing and reuse of software generally.
+%
+% \begin{center}
+% {\large\sc No Warranty}
+% \end{center}
+%
+% \item
+% {\sc Because the program is licensed free of charge, there is no warranty
+% for the program, to the extent permitted by applicable law. Except when
+% otherwise stated in writing the copyright holders and/or other parties
+% provide the program ``as is'' without warranty of any kind, either expressed
+% or implied, including, but not limited to, the implied warranties of
+% merchantability and fitness for a particular purpose. The entire risk as
+% to the quality and performance of the program is with you. Should the
+% program prove defective, you assume the cost of all necessary servicing,
+% repair or correction.}
+%
+% \item
+% {\sc In no event unless required by applicable law or agreed to in writing
+% will any copyright holder, or any other party who may modify and/or
+% redistribute the program as permitted above, be liable to you for damages,
+% including any general, special, incidental or consequential damages arising
+% out of the use or inability to use the program (including but not limited
+% to loss of data or data being rendered inaccurate or losses sustained by
+% you or third parties or a failure of the program to operate with any other
+% programs), even if such holder or other party has been advised of the
+% possibility of such damages.}
+%
+% \end{enumerate}
+%
+% \endgroup
+%
+% \StopEventually{\PrintIndex}
+%
+% \clearpage
+% \section{Implementation}
+%
+% The following provides the verbatim implementation of the \Songs{} \LaTeX{}
+% package, along with commentary on how it works.
+% In general, macro names that contain a |@| symbol are not intended to be
+% directly accessible by the outside world; they are for purely internal use.
+% All other macros are intended to be used or redefined by document authors.
+%
+% Most of the macros likely to be of real interest to song book authors can
+% be found in \S\ref{sec:impparams}.
+% To find the implementation of any particular macro, the index at the end
+% of this document should prove helpful.
+%
+% The unwary \TeX er may wonder at the rather large size of the
+% implementation.
+% The volume and complexity of the code stems mainly from the following
+% challenging features:
+% \begin{itemize}
+% \item Putting chords above lyrics fully automatically requires building an
+% entire lyric-parser in \LaTeX{} (see \S\ref{sec:lyricscan}).
+% \item Avoiding page-turns within songs without prohibiting column-breaks
+% requires building a completely new page-breaking algorithm
+% (see \S\ref{sec:pagebuilder}).
+% \item The package must be able to generate an astonishing number of document
+% variants from a common source: lyric-only books, chorded books, digital
+% slides, transparency slides, selected song subsets, transposed songs, and
+% combinations of the above.
+% This is like putting six or more packages into one.
+% \item Song book indexes are far more complex than those for a prose book.
+% See \S\ref{sec:indexgen} for some of the difficulties involved.
+% \end{itemize}
+%
+% \subsection{Initialization}
+%
+% The code in this section detects any \TeX{} versioning or configuration
+% settings that are relevant to the rest of the song book code.
+%
+% \begin{macro}{\ifSB@etex}
+% Numerous enhancements are possible when using an $\varepsilon$-\TeX{}
+% compatible version of \LaTeX.
+% We start by checking to see whether $\varepsilon$-\TeX{} primitives are
+% available.
+% \begin{macrocode}
+\newif\ifSB@etex
+\ifx\eTeXversion\undefined\else
+ \ifx\eTeXversion\relax\else
+ \SB@etextrue
+ \IfFileExists{etex.sty}{\RequirePackage{etex}}{}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@pdf}
+% Detect whether we're generating a pdf file, since this affects the
+% treatment of hyperlinks and bookmark indexes.
+% \begin{macrocode}
+\newif\ifSB@pdf\SB@pdffalse
+\ifx\pdfoutput\undefined\else
+ \ifx\pdfoutput\relax\else
+ \ifnum\pdfoutput<\@ne\else
+ \SB@pdftrue
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@preamble}
+% Some macros have different effects depending on when they're used in the
+% preamble or in the document body, so we need a conditional that remembers
+% whether we're still in the preamble.
+% It gets initialized to true and later changed to false once the body begins.
+% \begin{macrocode}
+\newif\ifSB@preamble
+\SB@preambletrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@test}
+% \begin{macro}{\ifSB@testii}
+% \begin{macro}{\SB@temp}
+% \begin{macro}{\SB@tempii}
+% \begin{macro}{\SB@tempiii}
+% \begin{macro}{\SB@tempiv}
+% \begin{macro}{\SB@tempv}
+% Reserve some control sequence names for scratch use.
+% \begin{macrocode}
+\newif\ifSB@test
+\newif\ifSB@testii
+\newcommand\SB@temp{}
+\newcommand\SB@tempii{}
+\newcommand\SB@tempiii{}
+\newcommand\SB@tempiv{}
+\newcommand\SB@tempv{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@newcount}
+% \begin{macro}{\SB@newdimen}
+% \begin{macro}{\SB@newbox}
+% \begin{macro}{\SB@newtoks}
+% \begin{macro}{\SB@newwrite}
+% Create macros for safely allocating count, dimen, box, token, and write
+% registers with detection for name-clashes.
+% (Unfortunately, \LaTeX's failure to do this automatically means that we
+% can only protect against overwriting someone else's registers, not against
+% someone else overwriting ours.)
+% \begin{macrocode}
+\newcommand\SB@newcount[1]{\@ifdefinable#1{\newcount#1}}
+\newcommand\SB@newdimen[1]{\@ifdefinable#1{\newdimen#1}}
+\newcommand\SB@newbox[1]{\@ifdefinable#1{\newbox#1}}
+\newcommand\SB@newtoks[1]{\@ifdefinable#1{\newtoks#1}}
+\newcommand\SB@newwrite[1]{\@ifdefinable#1{\newwrite#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@dimen}
+% \begin{macro}{\SB@dimenii}
+% \begin{macro}{\SB@dimeniii}
+% \begin{macro}{\SB@dimeniv}
+% \begin{macro}{\SB@box}
+% \begin{macro}{\SB@boxii}
+% \begin{macro}{\SB@boxiii}
+% \begin{macro}{\SB@toks}
+% \begin{macro}{\SB@cnt}
+% \begin{macro}{\SB@cntii}
+% \begin{macro}{\SB@skip}
+% Reserve some temp registers for various purposes.
+% \begin{macrocode}
+\SB@newdimen\SB@dimen
+\SB@newdimen\SB@dimenii
+\SB@newdimen\SB@dimeniii
+\SB@newdimen\SB@dimeniv
+\SB@newbox\SB@box
+\SB@newbox\SB@boxii
+\SB@newbox\SB@boxiii
+\SB@newtoks\SB@toks
+\SB@newcount\SB@cnt
+\SB@newcount\SB@cntii
+\newlength\SB@skip
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@envbox}
+% Also reserve a slightly less volatile box register for per-environment use.
+% In scripture environments it holds the scripture citation.
+% In indexes it holds the index title text.
+% \begin{macrocode}
+\SB@newbox\SB@envbox
+% \end{macrocode}
+% \end{macro}
+%
+% Load David Carlisle's |keyval| package for processing
+% \meta{key}=\meta{value} style macro arguments.
+% \begin{macrocode}
+\RequirePackage{keyval}
+% \end{macrocode}
+%
+% \subsection{Default Parameters}\label{sec:impparams}
+%
+% This section defines macros and lengths that will typically be executed or
+% redefined by the user in the document preamble to initialize the document.
+% (Not all of these are restricted to preamble usage, however. Many can be used
+% throughout the document to switch styles for different sections or different
+% songs.)
+%
+% \begin{macro}{\lyricfont}\MainImpl{lyricfont}
+% Define the font style to use for formatting song lyrics.
+% \begin{macrocode}
+\newcommand\lyricfont{\normalfont\normalsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\stitlefont}\MainImpl{stitlefont}
+% Define the font style to use for formatting song titles.
+% \begin{macrocode}
+\newcommand\stitlefont{%
+ \sffamily\ifslides\Huge\else\slshape\Large\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\versefont}\MainImpl{versefont}
+% \begin{macro}{\chorusfont}\MainImpl{chorusfont}
+% \begin{macro}{\notefont}\MainImpl{notefont}
+% \changes{v2.1}{2007/08/02}{Added}
+% By default, verses, choruses, and textual notes just allow the |\lyricfont|
+% style to continue.
+% \begin{macrocode}
+\newcommand\versefont{}
+\newcommand\chorusfont{}
+\newcommand\notefont{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\scripturefont}\MainImpl{scripturefont}
+% \changes{v1.13}{2005/05/12}{Added kerning correction for double-quote ligatures}
+% Define the font style to use for formatting scripture quotations
+% (defaults to Zapf Chancery).
+% \begin{macrocode}
+\newcommand\scripturefont{%
+ \usefont{OT1}{pzc}{mb}{it}%
+ \shiftdblquotes{-1.1\p@}\z@{-2\p@}\z@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\printscrcite}\MainImpl{printscrcite}
+% Define the printing style for the citation at the end of a scripture
+% quotation.
+% \begin{macrocode}
+\newcommand\printscrcite[1]{\sffamily\small#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\snumbgcolor}\MainImpl{snumbgcolor}
+% \begin{macro}{\notebgcolor}\MainImpl{notebgcolor}
+% \begin{macro}{\idxbgcolor}\MainImpl{idxbgcolor}
+% Define the background color used for shaded boxes containing
+% song numbers, textual notes, and index section headers, respectively.
+% To turn off all shading for a box type, use |\def|\meta{macroname}|{}|.
+% \begin{macrocode}
+\newcommand\snumbgcolor{SongbookShade}
+\newcommand\notebgcolor{SongbookShade}
+\newcommand\idxbgcolor{SongbookShade}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\versejustify}\MainImpl{versejustify}
+% \begin{macro}{\chorusjustify}\MainImpl{chorusjustify}
+% \changes{v2.1}{2007/08/02}{Added}
+% Verses and choruses are both left-justified with hanging indentation equal
+% to |\parindent|,
+% \begin{macrocode}
+\newcommand\versejustify{\justifyleft}
+\newcommand\chorusjustify{\justifyleft}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\notejustify}\MainImpl{notejustify}
+% \changes{v2.1}{2007/08/02}{Added}
+% Textual notes are fully justified when they are too long to fit in
+% a single line.
+% \begin{macrocode}
+\newcommand\notejustify{%
+ \advance\baselineskip\p@\relax%
+ \leftskip\z@skip\rightskip\z@skip%
+ \parfillskip\@flushglue\parindent\z@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\placenote}\MainImpl{placenote}
+% \changes{v2.1}{2007/08/02}{Added}
+% Textual notes are placed flush-left.
+% The single argument to this macro is horizontal material that comprises the
+% note.
+% Usually it will consist of various hboxes and specials that were produced
+% by |\colorbox|.
+% \begin{macrocode}
+\newcommand\placenote[1]{%
+ \leftskip\z@skip\rightskip\@flushglue\SB@cbarshift%
+ \noindent#1\par%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% These counters define the current song number and verse number.
+% They can be redefined by the user at any time.
+% \begin{macrocode}
+\newcounter{songnum}
+\newcounter{versenum}
+% \end{macrocode}
+%
+% \begin{macro}{\thesongnum}\MainImpl{thesongnum}
+% \begin{macro}{\songnumstyle}
+% By default, the song numbering style will simply be an arabic number.
+% Redefine |\thesongnum| to change it.
+% (The |\songnumstyle| macro is obsolete and exists only for backward
+% compatibility.)
+% \begin{macrocode}
+\renewcommand\thesongnum{\songnumstyle{songnum}}
+\newcommand\songnumstyle{}
+\let\songnumstyle\arabic
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\theversenum}\MainImpl{theversenum}
+% \begin{macro}{\versenumstyle}
+% By default, the verse numbering style will simply be an arabic number.
+% Redefine |\theversenum| to change it.
+% (The |\versenumstyle| macro is obsolete and exists only for backward
+% compatibility.)
+% \begin{macrocode}
+\renewcommand\theversenum{\versenumstyle{versenum}}
+\newcommand\versenumstyle{}
+\let\versenumstyle\arabic
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\printsongnum}\MainImpl{printsongnum}
+% Define the printing style for the large, boxed song numbers starting each
+% song.
+% \begin{macrocode}
+\newcommand\printsongnum[1]{\sffamily\bfseries\LARGE#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\printversenum}\MainImpl{printversenum}
+% Define the printing style for the verse numbers to the left of each verse.
+% \begin{macrocode}
+\newcommand\printversenum[1]{\lyricfont#1.\ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\placeversenum}\MainImpl{placeversenum}
+% \changes{v2.1}{2007/08/02}{Added}
+% Verse numbers are placed flush-left.
+% This is achieved by inserting horizontal glue that reverses both the
+% |\leftskip| and the |\parindent|.
+% The single argument to this macro is an hbox containing the verse number.
+% \begin{macrocode}
+\newcommand\placeversenum[1]{%
+ \hskip-\leftskip\hskip-\parindent\relax%
+ \box#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\everyverse}\MainImpl{everyverse}
+% \begin{macro}{\everychorus}\MainImpl{everychorus}
+% \changes{v2.1}{2007/08/02}{Added}
+% The following hooks allow users to insert material at the head of each
+% verse or chorus.
+% \begin{macrocode}
+\newcommand\everyverse{}
+\newcommand\everychorus{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\printchord}\MainImpl{printchord}
+% Define the printing style for chords.
+% \begin{macrocode}
+\newcommand\printchord[1]{\sffamily\slshape\large#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \label{sec:chordlocals}
+% \begin{macro}{\chordlocals}\MainImpl{chordlocals}
+% This hook is expanded at the start of the scoping group that surrounds
+% every chord name.
+% Thus, it can be used to set any catcodes or definitions that should be
+% local to chord names.
+% \begin{macrocode}
+\newcommand\chordlocals{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\versesep}\MainImpl{versesep}
+% Specify the vertical distance between song verses.
+% This gets set to a sentinel value by default; if the user doesn't redefine
+% it by the end of the document preamble, it gets redefined to something
+% sensible based on other settings.
+% \begin{macrocode}
+\newlength\versesep
+\versesep123456789sp\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\afterpreludeskip}\MainImpl{afterpreludeskip}
+% \begin{macro}{\beforepostludeskip}\MainImpl{beforepostludeskip}
+% Users can specify the amount of vertical space that separates song prelude
+% and postlude material from the body of the song by adjusting the following
+% two macros.
+% \begin{macrocode}
+\newlength\afterpreludeskip
+\afterpreludeskip=2\p@\@plus4\p@
+\newlength\beforepostludeskip
+\beforepostludeskip=2\p@\@plus4\p@
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\baselineadj}\MainImpl{baselineadj}
+% Define an adjustment factor for the vertical distance between consecutive
+% lyric baselines.
+% Setting this to zero accepts the default baseline distance computed by the
+% songs package.
+% \begin{macrocode}
+\newlength\baselineadj
+\baselineadj\z@skip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clineparams}\MainImpl{clineparams}
+% The spacing between chords and the lyrics below them can be adjusted
+% by changing the values of |\baselineskip|, |\lineskiplimit|, and
+% |\lineskip| within the following macro.
+% By default, |\baselineskip| is set to 2 points smaller than the height
+% of the current (lyric) font, and |\lineskiplimit| and |\lineskip| are
+% set so that chords intrude at most 2 points into the lyric below them.
+% This helps to keep chords tight with lyrics.
+% \begin{macrocode}
+\newcommand\clineparams{%
+ \baselineskip\f@size\p@%
+ \advance\baselineskip-2\p@%
+ \lineskiplimit-2\p@%
+ \lineskip-2\p@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parindent}
+% The |\parindent| length controls how far broken lyric lines are
+% indented from the left margin.
+% \begin{macrocode}
+\parindent.25in
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxheadwidth}\MainImpl{idxheadwidth}
+% Specify the width of the head-boxes in a large index.
+% \begin{macrocode}
+\newlength\idxheadwidth
+\setlength\idxheadwidth{1.5cm}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\songnumwidth}\MainImpl{songnumwidth}
+% Set the width of the song number boxes that begin each song.
+% We guess a suitable width by typesetting the text ``999.''
+% \begin{macrocode}
+\newlength\songnumwidth
+\settowidth\songnumwidth{\printsongnum{999.}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\versenumwidth}\MainImpl{versenumwidth}
+% Set the width that is reserved for normal-sized verse numbers.
+% (Verse numbers wider than this will indent the first line of lyrics.)
+% \begin{macrocode}
+\newlength\versenumwidth
+\settowidth\versenumwidth{\printversenum{9\kern1em}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cbarwidth}
+% This dictates the width of the vertical line placed to the left of
+% choruses.
+% Setting it to |0pt| eliminates the line entirely.
+% \begin{macrocode}
+\newlength\cbarwidth
+\setlength\cbarwidth\p@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sbarheight}
+% This dictates the height of the horizontal line placed between each pair
+% of songs.
+% Setting it to |0pt| eliminates the line entirely.
+% \begin{macrocode}
+\newlength\sbarheight
+\setlength\sbarheight\p@
+% \end{macrocode}
+% \end{macro}
+%
+% Column- and page-breaks should typically not occur within a verse or chorus
+% unless they are unavoidable.
+% Thus, we set the |\interlinepenalty| to a high number (1000).
+% \begin{macrocode}
+\interlinepenalty\@m
+% \end{macrocode}
+%
+% \begin{macro}{\vvpenalty}\MainImpl{vvpenalty}
+% \begin{macro}{\ccpenalty}\MainImpl{ccpenalty}
+% \begin{macro}{\vcpenalty}\MainImpl{vcpenalty}
+% \begin{macro}{\cvpenalty}\MainImpl{cvpenalty}
+% \begin{macro}{\brkpenalty}\MainImpl{brkpenalty}
+% \changes{v2.1}{2007/08/02}{Added.}
+% The following count registers define the line-breaking penalties inserted
+% between verses, between choruses, after a verse followed by a chorus, after
+% a chorus followed by a verse, and at |\brk| macros, respectively.
+%
+% The default value of 200 was chosen based on the following logic:
+% Chord books should not yield underfull vbox warnings no matter how short
+% their columns are.
+% However, we still want to put as much material in each column as possible
+% while avoiding intra-song column-breaks when they can be avoided.
+% Chorded mode therefore sets |\colbotglue| with glue whose stretchability
+% is half of the |\textheight|.
+% Such glue will stretch at most twice its stretchability, yielding a
+% badness of 800 in the worst case.
+% The default |\vbadness| setting starts issuing warnings at badness 1000,
+% so we set the penalties below to $1000-800=200$.
+% \begin{macrocode}
+\SB@newcount\vvpenalty\vvpenalty200
+\SB@newcount\ccpenalty\ccpenalty200
+\SB@newcount\vcpenalty\vcpenalty200
+\SB@newcount\cvpenalty\cvpenalty200
+\SB@newcount\brkpenalty\brkpenalty200
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\spenalty}\MainImpl{spenalty}
+% \changes{v2.1}{2007/08/02}{Added.}
+% The following penalty gets inserted between songs.
+% Setting it to a proper value is a somewhat delicate balancing act.
+% It should typically be something between 0 and the default penalties above,
+% so for now it defaults to 100.
+% To start each song on a fresh column/page, set it to $-10000$ or below.
+% \begin{macrocode}
+\SB@newcount\spenalty\spenalty100
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\songmark}\MainImpl{songmark}
+% \changes{v1.17}{2005/09/24}{Added.}
+% \begin{macro}{\versemark}\MainImpl{versemark}
+% \begin{macro}{\chorusmark}\MainImpl{chorusmark}
+% \changes{v2.1}{2007/08/02}{Added.}
+% The user can redefine the following macros to add \TeX{} marks for each
+% song, each verse, or each chorus.
+% Such marks are used by \LaTeX{} to define page headers and footers.
+% \begin{macrocode}
+\newcommand\songmark{}
+\newcommand\versemark{}
+\newcommand\chorusmark{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\extendprelude}\MainImpl{extendprelude}
+% \begin{macro}{\extendpostlude}\MainImpl{extendpostlude}
+% \changes{v2.0}{2007/06/18}{Added.}
+% To just add some fields to the existing |\makeprelude| or |\makepostlude|
+% without having to redefine them entirely, users can redefine
+% |\extendprelude| or |\extendpostlude|.
+% By default, the prelude has the scripture references followed by the
+% authors, and the postlude has the copyright info followed by the licensing
+% info.
+% \begin{macrocode}
+\newcommand\extendprelude{\showrefs\showauthors}
+\newcommand\extendpostlude{\songcopyright\ \songlicense\unskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\idxheadfont}\MainImpl{idxheadfont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxheadfont| to affect the font in which each capital
+% letter that heads a section of a title index is rendered.
+% \begin{macrocode}
+\newcommand\idxheadfont{\sffamily\bfseries\LARGE}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxtitlefont}\MainImpl{idxtitlefont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxtitlefont| to affect the font in which song title
+% index entries are rendered.
+% \begin{macrocode}
+\newcommand\idxtitlefont{\sffamily\slshape}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxlyricfont}\MainImpl{idxlyricfont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxlyricfont| to affect the font in which notable lines
+% of lyrics are rendered in a title index.
+% \begin{macrocode}
+\newcommand\idxlyricfont{\rmfamily}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxscripfont}\MainImpl{idxscripfont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxscripfont| to affect the font in which scripture
+% references are rendered in a scripture index.
+% \begin{macrocode}
+\newcommand\idxscripfont{\sffamily\small\slshape}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxauthfont}\MainImpl{idxauthfont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxauthfont| to affect the font in which contributor
+% names are rendered in an author index.
+% \begin{macrocode}
+\newcommand\idxauthfont{\small\bfseries}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxrefsfont}\MainImpl{idxrefsfont}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxrefsfont| to affect the font in which the list of
+% song references on the right-hand-side of an index entry is typeset.
+% \begin{macrocode}
+\newcommand\idxrefsfont{\normalfont\normalsize}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxbook}\MainImpl{idxbook}
+% \changes{v2.8}{2009/02/22}{Added.}
+% Users can redefine |\idxbook| to dictate the book name header in a
+% scripture index that begins each book of the bible.
+% \begin{macrocode}
+\newcommand\idxbook[1]{\small\bfseries#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\idxcont}\MainImpl{idxcont}
+% \changes{v2.0}{2007/06/18}{Added.}
+% Users can redefine |\idxcont| to dictate the column header in a scripture
+% index after a column break falls within a book of the bible.
+% \begin{macrocode}
+\newcommand\idxcont[1]{\small\textbf{#1} (continued)}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\colbotglue}
+% Glue of size |\colbotglue| is inserted at the bottom of each column.
+% We use a macro instead of a glue register so that this can be redefined
+% in terms of variable quantities such as |\textheight|.
+% \begin{macrocode}
+\newcommand\colbotglue{}
+\let\colbotglue\z@skip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lastcolglue}
+% Glue of size |\lastcolglue| is inserted at the bottom of the last column.
+% \begin{macrocode}
+\newcommand\lastcolglue{}
+\let\lastcolglue\@flushglue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\minfrets}
+% Define the minimum number of fret rows that should appear in tablature
+% diagrams.
+% \begin{macrocode}
+\SB@newcount\minfrets\minfrets4
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@colwidth}
+% Define a length to store the computed width of each column in a
+% multi-column song page.
+% The user shouldn't set this one directly, but some users might want to
+% refer to it in calculations.
+% \begin{macrocode}
+\SB@newdimen\SB@colwidth
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Package Options}
+%
+% This section defines code associated with the various option
+% settings that can be specified on the |\usepackage| line.
+% Many of these options can also be turned on or off subsequent to the
+% |\usepackage| line, so macros for doing that are also located here.
+% The options are not actually processed until \S\ref{sec:optproc} because
+% some of the macros defined here refer to macros that have not yet been
+% defined.
+%
+% \begin{option}{slides}\MainEnvImpl{slides}
+% \begin{macro}{\slides}\MainImpl{slides}
+% \optdef{off}
+% Turning this option on generates a book of overhead slides---one for each
+% song.
+% It really just amounts to changing various parameter settings.
+% Elsewhere in the code we also consult |\ifslides| to determine a few default
+% parameter settings and to use a different song preamble structure.
+% All the parameter changes below are local to the current scope; so to
+% undo slides mode, just put |\slides| within a group and end the group
+% wherever you want the slides settings to end.
+% \begin{macrocode}
+\DeclareOption{slides}{\slides}
+\newcommand\slides{%
+ \slidestrue%
+ \def\lyricfont{\normalfont\huge}%
+ \def\chorusfont{\slshape}%
+ \def\versejustify{\justifycenter}%
+ \let\chorusjustify\versejustify
+ \def\placenote##1{\justifycenter\noindent##1\par}%
+ \scriptureoff%
+ \onesongcolumn%
+ \ifSB@preamble\ifSB@chordedspec\else\SB@chordsoff\fi\fi%
+ \spenalty-\@M%
+ \let\colbotglue\@flushglue%
+ \setlength\cbarwidth\z@%
+ \setlength\sbarheight\z@%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{option}
+%
+% \begin{macro}{\justifyleft}
+% \changes{v2.1}{2007/08/02}{Added}
+% The |\justifyleft| macro sets up an environment in which lyrics are
+% left-justified with hanging indentation equal to |\parindent|.
+% It reserves spaces for verse numbers if used in a verse, and reserves
+% space for the vertical bar left of choruses if used in a chorus.
+% \begin{macrocode}
+\newcommand\justifyleft{%
+ \leftskip\parindent%
+ \ifSB@inverse\advance\leftskip\versenumwidth\fi%
+ \SB@cbarshift%
+ \parindent-\parindent%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\justifycenter}
+% \changes{v2.1}{2007/08/02}{Added}
+% The |\justifycenter| macro sets up an environment in which lyrics are
+% centered on each line.
+% Verse numbers continue to be placed flush-left, but |\placeversenum|
+% is temporarily redefined to keep the rest of the line containing a
+% verse number centered.
+% \begin{macrocode}
+\newcommand\justifycenter{%
+ \centering\SB@cbarshift\rightskip\leftskip%
+ \def\placeversenum##1{%
+ \hskip-\leftskip\hskip-\parindent\relax%
+ \hangindent-\wd##1\hangafter\m@ne%
+ \box##1\hfil%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{option}{unouter}\MainEnvImpl{unouter}
+% \begin{macro}{\SB@outer}
+% \optdef{off}
+% Several macros provided by the \Songs{} package are, by default, declared
+% |\outer| to aid in debugging.
+% However, unusual documents may need to use these macros within larger
+% constructs.
+% To do so, use the |unouter| option to prevent any of the macros supplied
+% by this package from being declared |\outer|.
+% \begin{macrocode}
+\newcommand\SB@outer{\outer}
+\DeclareOption{unouter}{\let\SB@outer\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{option}
+%
+% \begin{option}{rawtext}\MainEnvImpl{rawtext}
+% \optdef{off}
+% Instead of generating a document, this dumps a text version of the song book
+% to a file. This option can only be set in the |\usepackage| line because
+% it dictates many top-level macro definitions. Turning rawtext on turns off
+% the indexes by default, but this can be overridden by explicitly setting
+% index options. (Note: Using rawtext with indexes turned on doesn't actually
+% work yet, but might be added in a future revision.)
+% \begin{macrocode}
+\DeclareOption{rawtext}{\rawtexttrue\indexesoff}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{noshading}\MainEnvImpl{noshading}
+% \optdef{off}
+% Inhibit all shaded boxes (e.g., if the color package is unavailable).
+% This option can only be set in the |\usepackage| line because the color
+% package must be loaded in the preamble if at all. (Note: In a future release
+% this might be extended to be modifiable throughout the preamble.)
+% \begin{macrocode}
+\DeclareOption{noshading}{\SB@colorboxesfalse}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{noindexes}\MainEnvImpl{noindexes}
+% \begin{macro}{\indexeson}\MainImpl{indexeson}
+% \begin{macro}{\indexesoff}\MainImpl{indexesoff}
+% \optdef{off}
+% Suppress generation of index files and displaying of in-document indexes.
+% The |\indexeson| and |\indexesoff| macros can be used elsewhere to toggle
+% display of indexes.
+% Index-regeneration will occur if indexes are turned on by the end of the
+% document.
+% \begin{macrocode}
+\DeclareOption{noindexes}{\indexesoff}
+\newcommand\indexeson{\songindexestrue}
+\newcommand\indexesoff{\songindexesfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{option}
+%
+% \begin{option}{nopdfindex}\MainEnvImpl{nopdfindex}
+% \optdef{off}
+% Suppress creation of PDF bookmark entries and hyperlinks.
+% \begin{macrocode}
+\DeclareOption{nopdfindex}{%
+ \let\songtarget\@gobbletwo%
+ \let\songlink\@secondoftwo%
+}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{macro}{\ifSB@measurespec}
+% \begin{macro}{\ifSB@chordedspec}
+% The |showmeasures| and |chorded| options interact in the sense that by
+% default, switching one of them on or off switches the other on or off as
+% well.
+% However, if the user explicitly says that one should be on or off, then
+% switching the other shouldn't affect it.
+% To produce this behavior, we need two extra conditionals to remember whether
+% each of these options has been explicitly specified by the user or whether
+% it is still in a default state.
+% \begin{macrocode}
+\newif\ifSB@measurespec
+\newif\ifSB@chordedspec
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{option}{chorded}\MainEnvImpl{chorded}
+% \begin{option}{lyric}\MainEnvImpl{lyric}
+% \begin{macro}{\chordson}\MainImpl{chordson}
+% \begin{macro}{\chordsoff}\MainImpl{chordsoff}
+% \begin{macro}{\SB@chordson}
+% \begin{macro}{\SB@chordsoff}
+% \changes{v1.22}{2007/05/15}{Update \cs{baselineskip} when in songs.}
+% \optdef{chorded}
+% Determines whether chords should be shown.
+% This option can be set in the |\usepackage| line or toggled elsewhere
+% with the |\chordson| and |\chordsoff| macros.
+% Chords cannot be turned on in conjunction with the |rawtext| option.
+% If chords are turned on by the end of the preamble, no attempt will be made
+% to balance columns on each page.
+% \begin{macrocode}
+\DeclareOption{chorded}{\chordson}
+\DeclareOption{lyric}{\chordsoff}
+\newcommand\chordson{\SB@chordedspectrue\SB@chordson}
+\newcommand\chordsoff{\SB@chordedspectrue\SB@chordsoff}
+\newcommand\SB@chordson{%
+ \ifrawtext%
+ \SB@errrtopt%
+ \else%
+ \chordedtrue\lyricfalse%
+ \let\SB@bracket\SB@chord%
+ \let\SB@rechord\SB@@rechord%
+ \let\SB@ch\SB@ch@on%
+ \ifSB@measurespec%
+ \ifmeasures\SB@measureson\else\SB@measuresoff\fi%
+ \else%
+ \SB@measureson%
+ \fi%
+ \ifSB@preamble\def\colbotglue{\z@\@plus.5\textheight}\fi%
+ \SB@setbaselineskip%
+ \fi%
+}
+\newcommand\SB@chordsoff{%
+ \chordedfalse\lyrictrue%
+ \def\SB@bracket##1]{\ignorespaces}%
+ \let\SB@rechord\relax%
+ \let\SB@ch\SB@ch@off%
+ \ifSB@measurespec%
+ \ifmeasures\SB@measureson\else\SB@measuresoff\fi%
+ \else%
+ \SB@measuresoff%
+ \fi%
+ \ifSB@preamble\let\colbotglue\z@skip\fi%
+ \SB@setbaselineskip%
+}
+% \end{macrocode}
+% \eat\]
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{showmeasures}\MainEnvImpl{showmeasures}
+% \begin{option}{nomeasures}\MainEnvImpl{nomeasures}
+% \begin{macro}{\measureson}\MainImpl{measureson}
+% \begin{macro}{\measuresoff}\MainImpl{measuresoff}
+% \begin{macro}{\SB@measureson}
+% \begin{macro}{\SB@measuresoff}
+% \optdef{showmeasures if chorded, nomeasures otherwise}
+% Determines whether measure bars and meter notes should be shown.
+% Option can be set in the |\usepackage| line or toggled elsewhere with the
+% |\measureson| and |\measuresoff| macros.
+% \begin{macrocode}
+\DeclareOption{showmeasures}{\measureson}
+\DeclareOption{nomeasures}{\measuresoff}
+\newcommand\measureson{\SB@measurespectrue\SB@measureson}
+\newcommand\measuresoff{\SB@measurespectrue\SB@measuresoff}
+\newcommand\SB@measureson{%
+ \measurestrue%
+ \let\SB@mbar\SB@makembar%
+ \ifchorded%
+ \let\SB@mch\SB@mch@on%
+ \else%
+ \let\SB@mch\SB@mch@m%
+ \fi%
+ \ifSB@inverse\SB@loadactives\fi%
+ \ifSB@inchorus\SB@loadactives\fi%
+}
+\newcommand\SB@measuresoff{%
+ \measuresfalse%
+ \let\SB@mbar\@gobbletwo%
+ \ifchorded%
+ \let\SB@mch\SB@ch@on%
+ \else%
+ \let\SB@mch\SB@ch@off%
+ \fi%
+ \ifSB@inverse\SB@loadactives\fi%
+ \ifSB@inchorus\SB@loadactives\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{transposecapos}\MainEnvImpl{transposecapos}
+% \optdef{off}
+% If set, the |\capo| macro transposes the song instead of printing a note
+% to use a capo. Use this option to generate a chord book for pianists who
+% have trouble transposing or guitarists who don't have capos.
+% \begin{macrocode}
+\DeclareOption{transposecapos}{\transcapostrue}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{noscripture}\MainEnvImpl{noscripture}
+% \begin{macro}{\scriptureon}\MainImpl{scriptureon}
+% \begin{macro}{\scriptureoff}\MainImpl{scriptureoff}
+% \optdef{off}
+% Inhibits the display of scripture quotes.
+% This option can also be toggled on and off anywhere with the |\sciptureon|
+% and |\scriptureoff| macros.
+% \begin{macrocode}
+\DeclareOption{noscripture}{\SB@omitscriptrue}
+\newcommand\scriptureon{\SB@omitscripfalse}
+\newcommand\scriptureoff{\SB@omitscriptrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{option}
+%
+% \begin{option}{onesongcolumn}\MainEnvImpl{onesongcolumn}
+% \begin{option}{twosongcolumns}\MainEnvImpl{twosongcolumns}
+% \begin{macro}{\onesongcolumn}\MainImpl{onesongcolumn}
+% \begin{macro}{\twosongcolumns}\MainImpl{twosongcolumns}
+% \begin{macro}{\songcolumns}\MainImpl{songcolumns}
+% \optdef{onesongcolumn is the default if generating slides or rawtext, twosongcolumns otherwise}
+% The number of columns per page is specified using the following package
+% options and macros.
+% In \env{rawtext} mode it must remain set to one column per page.
+% The entire page-making system can be turned off by setting the number of
+% columns to zero.
+% This will cause each song to be contributed to the current vertical list
+% without any attempt to form columns; the enclosing environment must handle
+% the page layout.
+% Probably this means that |\repchoruses| will not work, since an external
+% package won't know to insert repeated choruses when building pages.
+% \begin{macrocode}
+\DeclareOption{twosongcolumns}{\SB@numcols\tw@}
+\DeclareOption{onesongcolumn}{\SB@numcols\@ne}
+\newcommand\songcolumns[1]{%
+ \SB@cnt#1\relax%
+ \ifnum\SB@cnt=\SB@numcols\else%
+ \ifSB@preamble\else{\SB@clearpage}\fi%
+ \fi%
+ \SB@numcols\SB@cnt%
+ \ifnum\SB@numcols>\z@%
+ \SB@colwidth-\columnsep%
+ \multiply\SB@colwidth\SB@numcols%
+ \advance\SB@colwidth\columnsep%
+ \advance\SB@colwidth\textwidth%
+ \divide\SB@colwidth\SB@numcols%
+ \else%
+ \ifrepchorus\SB@warnrc\fi%
+ \fi%
+}
+\newcommand\onesongcolumn{\songcolumns\@ne}
+\newcommand\twosongcolumns{\songcolumns\tw@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{option}
+% \end{option}
+%
+% \begin{macro}{\includeonlysongs}\MainImpl{includeonlysongs}
+% \begin{macro}{\songlist}
+% Display only a select list of songs and ignore the rest.
+% \begin{macrocode}
+\newcommand\songlist{}
+\newcommand\includeonlysongs[1]{%
+ \ifSB@songsenv\SB@errpl\else%
+ \partiallisttrue%
+ \renewcommand\songlist{#1}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\nosongnumbers}\MainImpl{nosongnumbers}
+% \changes{v2.9}{2009/04/01}{Added.}
+% The user can turn off song numbering with the following macro.
+% \begin{macrocode}
+\newcommand\nosongnumbers{\setlength\songnumwidth\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noversenumbers}\MainImpl{noversenumbers}
+% \changes{v1.20}{2006/03/12}{Added.}
+% The user can turn off verse numbering with the following macro.
+% \begin{macrocode}
+\newcommand\noversenumbers{%
+ \renewcommand\printversenum[1]{}%
+ \setlength\versenumwidth\z@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\repchoruses}\MainImpl{repchoruses}
+% \begin{macro}{\norepchoruses}\MainImpl{norepchoruses}
+% \changes{v2.1}{2007/08/02}{Added.}
+% Using |\repchoruses| causes choruses to be automatically repeated on
+% subsequent pages of the song.
+% The feature requires $\varepsilon$-\TeX{} because the supporting code needs
+% an extended mark register class.
+% \begin{macrocode}
+\ifSB@etex
+ \newcommand\repchoruses{%
+ \ifnum\SB@numcols<\@ne\SB@warnrc\fi%
+ \repchorustrue%
+ }
+\else
+ \newcommand\repchoruses{\SB@erretex}
+\fi
+\newcommand\norepchoruses{\repchorusfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sepverses}
+% The following penalty settings cause verses and choruses to be separated
+% onto different slides when in slides mode, except that consecutive choruses
+% remain together when they fit.
+% \begin{macrocode}
+\newcommand\sepverses{%
+ \vvpenalty-\@M%
+ \ccpenalty100 %
+ \vcpenalty\vvpenalty%
+ \cvpenalty\vvpenalty%
+ \let\colbotglue\@flushglue%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Some option settings, margins, and other lengths are finalized at the end of
+% the preamble.
+% That code is below.
+%
+% \begin{macrocode}
+\AtBeginDocument{
+% \end{macrocode}
+%
+% If the user hasn't set the |\versesep|, set it to the default.
+% \begin{macrocode}
+ \SB@setversesep
+% \end{macrocode}
+%
+% Initialize page layout algorithm.
+% \begin{macrocode}
+ \songcolumns\SB@numcols
+% \end{macrocode}
+%
+% Macros used after this point occur outside the preamble.
+% \begin{macrocode}
+ \SB@preamblefalse
+}
+% \end{macrocode}
+%
+% \subsection{Page-builder}
+% \label{sec:pagebuilder}
+%
+% The following macros handle the building of pages that contain songs.
+% They compute where best to place each song (e.g., whether to place it in the
+% current column or move to the next column or page).
+% The output routines for generating a partial list of songs in a specified
+% order also can be found here.
+%
+% \begin{macro}{\SB@songbox}
+% The most recently processed song (or scripture quotation) is stored in this
+% box.
+% \begin{macrocode}
+\SB@newbox\SB@songbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@numcols}
+% \begin{macro}{\SB@colnum}
+% Reserve two count registers to hold the total number of columns and the
+% current column number, respectively.
+% \begin{macrocode}
+\SB@newcount\SB@numcols\SB@numcols\tw@
+\SB@newcount\SB@colnum
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@colbox}
+% Reserve a box register to hold the current column in progress.
+% \begin{macrocode}
+\SB@newbox\SB@colbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@colbox}
+% Reserve a box register to hold the current page in progress.
+% \begin{macrocode}
+\SB@newbox\SB@pgbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@mrkbox}
+% Reserve a box register to hold marks that migrate out of songs as they
+% get split into columns and pages.
+% \begin{macrocode}
+\SB@newbox\SB@mrkbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@maxmin}
+% The following helper macro takes the max or min of two dimensions.
+% If \argp{2}=``|<|'', it sets \argp{1} to the maximum of \argp{1} and
+% \argp{3}.
+% If \argp{2}=``|>|'', it sets \argp{1} to the minimum of \argp{1} and
+% \argp{3}.
+% \begin{macrocode}
+\newcommand\SB@maxmin[3]{\ifdim#1#2#3#1#3\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@mkpage}
+% The following macro is the heart of the page-building engine.
+% It splits the contents of a box into a page of columns.
+% If |\repchoruses| is active, the contents of |\SB@chorusbox|
+% are additionally inserted into fresh columns created during the spitting
+% process.
+% The macro arguments are:
+% \begin{enumerate}
+% \item an integer (positive or zero) indicating whether box $b$ should be
+% fully emptied and committed as columns (if positive), or whether its
+% final less-than-column-height remainder should be reserved as an in-progress
+% column (if zero);
+% \item the box $b$ to split;
+% \item a count register $i$ equaling the column index (zero or greater)
+% where the content of $b$ is to begin; and
+% \item the desired column height.
+% \end{enumerate}
+% Box $b$ is split and $i$ is incremented until $i$ reaches
+% |\SB@numcols| or $b$ is emptied.
+% If $b$ is emptied and the first argument is 0, the final column is \emph{not}
+% contributed; instead it is left in $b$ and $i$ is left equal to the index
+% of the column that would have been added if $b$ had been emptied.
+% This allows the next call to reconsider whether to end the
+% current column here or add some or all of the next contribution to it.
+% Otherwise, if $b$ is emptied and the first argument is positive, the final
+% column is contributed and $i$ is set to one greater than the index of that
+% column.
+% (If $i$ reaches |\SB@numcols| before $b$ is emptied, the first argument is
+% ignored.)
+%
+% Box $b$ and count register $i$ are globally modified.
+% If |\SB@updatepage| is not redefined, boxes |\SB@pgbox| and |\SB@mrkbox|
+% are also globally modified based on the results of the split.
+%
+% The implementation takes two special steps to avoid pre-committing
+% in-progress columns (when the first macro argument is zero):
+% First, the final split that empties box $b$ is ``undone'' by reverting to a
+% backup copy made before each split.
+% Second, any underfull box warnings for this final split are suppressed by
+% temporarily adding infinite-stretch |\vfil| glue to the bottom of the box.
+% This strategy preserves underfull and overfull box warnings for the columns
+% that are actually committed, but suppresses faux warnings for the last split
+% that is undone.
+% \begin{macrocode}
+\newcommand\SB@mkpage[4]{%
+ \ifvoid#2\else\begingroup%
+ \edef\SB@temp{\ifnum#2=\SB@box\SB@boxii\else\SB@box\fi}%
+ \edef\SB@tempii{\ifnum#2=\SB@boxiii\SB@boxii\else\SB@boxiii\fi}%
+ \splitmaxdepth\maxdepth\splittopskip\z@skip%
+ \ifnum#1=\z@\global\setbox#2\vbox{\unvbox#2\vfil}\fi%
+ \loop\ifnum#3<\SB@numcols%
+ \ifnum#1=\z@\setbox\SB@tempii\copy#2\fi%
+ \setbox\SB@temp\vsplit#2to#4\relax%
+ \ifvoid#2%
+ \ifnum#1=\z@%
+ \global\setbox#2\vbox{\unvbox\SB@tempii\unskip}%
+ \else%
+ \SB@updatepage%
+ \global\advance#3\@ne%
+ \fi%
+ #3\SB@numcols%
+ \else%
+ \SB@updatepage%
+ \global\advance#3\@ne%
+ \ifrepchorus\ifvoid\SB@chorusbox\else%
+ \SB@insertchorus#2%
+ \fi\fi%
+ \fi%
+ \repeat%
+ \endgroup\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@migrate}
+% Migrate a mark out of a recently split vertical list, but do not insert
+% superfluous empty marks that may override previous marks.
+% \begin{macrocode}
+\newcommand\SB@migrate[1]{%
+ \SB@toks\expandafter{#1}%
+ \edef\SB@temp{\the\SB@toks}%
+ \ifx\SB@temp\@empty\else\mark{\the\SB@toks}\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@updatepage}
+% Update boxes |\SB@pgbox| and |\SB@mrkbox| immediately after splitting
+% the contents of |\SB@colbox|.
+% \begin{macrocode}
+\newcommand\SB@updatepage{%
+ \global\setbox\SB@mrkbox\vbox{%
+ \unvbox\SB@mrkbox%
+ \SB@migrate\splitfirstmark%
+ \SB@migrate\splitbotmark%
+ }%
+ \global\setbox\SB@pgbox\hbox{%
+ \SB@dimen\SB@colwidth%
+ \advance\SB@dimen\columnsep%
+ \multiply\SB@dimen\SB@colnum%
+ \advance\SB@dimen-\wd\SB@pgbox%
+ \unhbox\SB@pgbox%
+ \ifdim\SB@dimen=\z@\else\hskip\SB@dimen\relax\fi%
+ \box\SB@temp%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@droppage}
+% This alternate definition of |\SB@updatepage| drops the just-created
+% page instead of contributing it.
+% This allows |\SB@mkpage| to be called by the song-positioning algorithm
+% as a trial run without outputting anything.
+% \begin{macrocode}
+\newcommand\SB@droppage{\setbox\SB@temp\box\voidb@x}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@output}
+% This is the main output routine for the page-builder.
+% It repeatedly calls |\SB@mkpage|, emitting pages as they are completed,
+% until the remaining content of box |\SB@colbox| is not enough to fill a
+% column.
+% If the macro argument is 0, this final, in-progress column is left
+% unfinished, pending future contributions.
+% If the argument is positive, the final material is committed as a column.
+% If the argument is two or greater, the entire in-progress page is also
+% committed and the column number reset.
+% \begin{macrocode}
+\newcommand\SB@output[1]{%
+ \ifnum\SB@numcols>\z@\begingroup%
+ \loop%
+ \SB@dimen\textheight%
+ \ifinner\else\advance\SB@dimen-\pagetotal\fi%
+ \SB@mkpage#1\SB@colbox\SB@colnum\SB@dimen%
+ \SB@testfalse\SB@testiitrue%
+ \ifnum#1>\@ne\ifvoid\SB@colbox\ifnum\SB@colnum>\z@%
+ \SB@testtrue\SB@testiifalse%
+ \fi\fi\fi%
+ \ifnum\SB@colnum<\SB@numcols\SB@testiifalse\else\SB@testtrue\fi%
+ \ifSB@test%
+ \unvbox\SB@mrkbox%
+ \ifinner\else\kern\z@\fi%
+ \box\SB@pgbox%
+ \ifinner\else\vfil\break\vskip\vsize\relax\fi%
+ \global\SB@colnum\z@%
+ \fi%
+ \ifSB@testii\repeat%
+ \endgroup\else%
+ \unvbox\SB@colbox\unskip%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@putboxes}
+% Create a vertical list consisting of the already committed contents of the
+% current column plus the most recently submitted song box.
+% The \LaTeX{} primitive that should be used to contribute each box is
+% specified in the first argument.
+% \begin{macrocode}
+\newcommand\SB@putboxes[1]{%
+ \SB@dimen\ifnum\SB@numcols>\z@\ht\SB@colbox\else\p@\fi%
+ #1\SB@colbox%
+ \ifdim\SB@dimen>\z@%
+ \SB@breakpoint\spenalty%
+ \ifdim\sbarheight>\z@%
+ \vskip-\sbarheight\relax%
+ \fi%
+ \fi%
+ #1\SB@songbox%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@nextcol}
+% Force $n$ column breaks, where $n$ is given by the first argument.
+% The first created column is finished with the glue specified in the
+% second argument.
+% When the second argument is |\@flushglue|, this forces a break that leaves
+% whitespace at the bottom of the column.
+% When it's |\colbotglue|, it acts like a natural column break chosen by
+% the page-breaker.
+% However, if the current column is empty, |\@flushglue| is always used so
+% that an empty column will result.
+% \begin{macrocode}
+\newcommand\SB@nextcol[2]{%
+ \ifnum#1>\z@%
+ \ifnum\SB@numcols>\z@%
+ \global\setbox\SB@colbox\vbox{%
+ \SB@cnt#1\relax%
+ \SB@dimen\ht\SB@colbox%
+ \unvbox\SB@colbox%
+ \unskip%
+ \ifdim\SB@dimen>\z@%
+ \vskip#2\relax%
+ \break%
+ \advance\SB@cnt\m@ne%
+ \fi%
+ \loop\ifnum\SB@cnt>\z@%
+ \nointerlineskip%
+ \null%
+ \vfil%
+ \break%
+ \advance\SB@cnt\m@ne%
+ \repeat%
+ }%
+ \SB@output1%
+ \else%
+ \ifnum\lastpenalty=-\@M\null\fi%
+ \break%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@selectcol}
+% This is the entrypoint to the song-positioning algorithm.
+% It gets defined by |\songpos| to either |\SB@@selectcol| (below) or
+% |\relax| (when song-positioning is turned off).
+% \begin{macrocode}
+\newcommand\SB@selectcol{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@@selectcol}
+% \changes{v2.1}{2007/08/02}{Rewritten to better handle glue}
+% \changes{v2.9}{2009/07/30}{Rewritten to handle repeated choruses}
+% Songs should be squeezed in wherever they fit, but breaking a column or page
+% within a song should be avoided.
+% The following macro outputs zero or more column breaks to select a good
+% place for |\SB@songbox| to be contributed to the current (or the next) page.
+% The number of column breaks is determined by temporarily setting
+% |\SB@updatepage| to |\SB@droppage| and then calling the |\SB@mkpage|
+% algorithm under various conditions to see how many columns it would
+% contribute if we start the current song at various positions.
+% \begin{macrocode}
+\newcommand\SB@@selectcol{%
+ \begingroup%
+ \SB@cnt\z@%
+ \vbadness\@M\vfuzz\maxdimen%
+ \let\SB@updatepage\SB@droppage%
+ \SB@dimen\textheight%
+ \ifinner\else\advance\SB@dimen-\pagetotal\fi%
+ \setbox\SB@boxii\vbox{\SB@putboxes\unvcopy}%
+ \SB@cntii\SB@colnum%
+ \SB@mkpage0\SB@boxii\SB@cntii\SB@dimen%
+ \SB@spos%
+ \global\SB@cnt\SB@cnt%
+ \endgroup%
+ \SB@nextcol\SB@cnt\colbotglue%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@spbegnew}
+% Begin a trial typesetting of the current song on a fresh page to see if
+% it fits within a page.
+% \begin{macrocode}
+\newcommand\SB@spbegnew{%
+ \setbox\SB@boxiii\copy\SB@songbox%
+ \SB@cntii\z@%
+ \SB@mkpage0\SB@boxiii\SB@cntii\textheight%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@spextold}
+% Tentatively extend the song previously typeset on the current even page to
+% the next odd page to see whether it fits on a double-page.
+% If the current page is odd-numbered, do nothing since extending the song
+% to the next page would introduce a page-turn.
+% \begin{macrocode}
+\newcommand\SB@spextold{%
+ \ifodd\c@page\else%
+ \SB@cntii\z@%
+ \SB@mkpage0\SB@boxii\SB@cntii\textheight%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@spextnew}
+% Extend the trial typesetting started with |\SB@spbegnew| to a second
+% page to see whether the song fits on a fresh double-page.
+% \begin{macrocode}
+\newcommand\SB@spextnew{%
+ \SB@cntii\z@%
+ \SB@mkpage0\SB@boxiii\SB@cntii\textheight%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@spdblpg}
+% Compute the number of column breaks required to shift the current song
+% to the next double-page if the result of the last test run fits within
+% its page (as indicated by counter |\SB@cntii|).
+% Otherwise leave the requested number of column breaks set to zero.
+% \begin{macrocode}
+\newcommand\SB@spdblpg{%
+ \ifnum\SB@cntii<\SB@numcols%
+ \SB@cnt\SB@numcols%
+ \advance\SB@cnt-\SB@colnum%
+ \if@twoside\ifodd\c@page\else%
+ \advance\SB@cnt\SB@numcols%
+ \fi\fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@sposi}
+% This is the level-1 song positioning algorithm.
+% It moves songs to the next double-page only if doing so would avoid a
+% page-turn that would otherwise appear within the song.
+% \begin{macrocode}
+\newcommand\SB@sposi{%
+ \ifnum\SB@cntii<\SB@numcols\else\if@twoside%
+ \SB@spextold%
+ \fi\fi%
+ \ifnum\SB@cntii<\SB@numcols\else%
+ \SB@spbegnew%
+ \ifnum\SB@cntii<\SB@numcols\else\if@twoside%
+ \SB@spextnew%
+ \fi\fi%
+ \SB@spdblpg%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@sposii}
+% This is the level-2 song-positioning algorithm.
+% It moves songs to the next page or double-page if doing so avoids a
+% page-break or page-turn that would otherwise appear within the song.
+% \begin{macrocode}
+\newcommand\SB@sposii{%
+ \ifnum\SB@cntii<\SB@numcols\else%
+ \SB@spbegnew%
+ \ifnum\SB@cntii<\SB@numcols%
+ \SB@cnt\SB@numcols%
+ \advance\SB@cnt-\SB@colnum%
+ \else%
+ \if@twoside%
+ \SB@spextold%
+ \ifnum\SB@cntii<\SB@numcols\else%
+ \SB@spextnew%
+ \SB@spdblpg%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@sposiii}
+% This is the level-3 song-positioning algorithm.
+% It moves songs to the next column, the next page, or the next double-page
+% if doing so avoids a column-break, page-break, or page-turn that would
+% otherwise appear within the song.
+% \begin{macrocode}
+\newcommand\SB@sposiii{%
+ \ifnum\SB@cntii>\SB@colnum%
+ \SB@cnt\SB@colnum%
+ \advance\SB@cnt\@ne%
+ \ifnum\SB@cnt<\SB@numcols%
+ \setbox\SB@boxiii\copy\SB@songbox%
+ \SB@mkpage0\SB@boxiii\SB@cnt\SB@dimen%
+ \advance\SB@cnt\m@ne%
+ \fi%
+ \ifnum\SB@cnt>\SB@colnum%
+ \SB@cnt\z@%
+ \SB@sposii%
+ \else%
+ \SB@cnt\@ne%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\songpos}
+% This is the macro by which the user adjusts the aggressiveness level of the
+% song-positioning algorithm.
+% See the macros above for what each level does.
+% \begin{macrocode}
+\newcommand\songpos[1]{%
+ \ifcase#1%
+ \let\SB@selectcol\relax%
+ \let\SB@spos\relax%
+ \or%
+ \let\SB@selectcol\SB@@selectcol%
+ \let\SB@spos\SB@sposi%
+ \or%
+ \let\SB@selectcol\SB@@selectcol%
+ \let\SB@spos\SB@sposii%
+ \or%
+ \let\SB@selectcol\SB@@selectcol%
+ \let\SB@spos\SB@sposiii%
+ \else%
+ \SB@errspos%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@spos}
+% The |\SB@spos| macro gets redefined by |\songpos| above depending on the
+% current song-positioning aggressiveness level.
+% By default it is set to level 3.
+% \begin{macrocode}
+\newcommand\SB@spos{}
+\songpos\thr@@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@clearpage}
+% Output all contributed material as a new page unless there is no contributed
+% material. In that case do nothing (i.e., don't produce a blank page).
+% The |\SB@colbox| is tested for zero height and depth rather than voidness,
+% since sometimes it contains zero-length |\splittopskip| glue.
+% \begin{macrocode}
+\newcommand\SB@clearpage{%
+ \SB@testtrue%
+ \ifvoid\SB@pgbox%
+ \ifdim\ht\SB@colbox=\z@\ifdim\dp\SB@colbox=\z@%
+ \SB@testfalse%
+ \fi\fi%
+ \fi%
+ \ifSB@test%
+ \SB@cnt\SB@numcols%
+ \advance\SB@cnt-\SB@colnum%
+ \SB@nextcol\SB@cnt\lastcolglue%
+ \SB@output2%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@cleardpage}
+% Like |\SB@clearpage| but shift to a fresh \emph{even-numbered} page in
+% two-sided documents.
+% Note that this differs from \LaTeX's |\cleardoublepage|, which shifts to
+% odd-numbered pages.
+% Song books prefer starting things on even-numbered pages because this
+% maximizes the distance until the next page-turn.
+% \begin{macrocode}
+\newcommand\SB@cleardpage{%
+ \SB@clearpage%
+ \if@twoside\ifodd\c@page%
+ \SB@nextcol\SB@numcols\@flushglue%
+ \fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@stype}
+% There are two song content submission types: column- and page-submissions.
+% Page-submissions are page-width and go atop fresh pages unless the current
+% page has only page-width material so far.
+% Column-submissions are column-width and start a new page only when the
+% current page is full.
+% This macro gets set to the desired type for the current submission.
+% Mostly it stays set to the default column-submission type.
+% \begin{macrocode}
+\newcommand\SB@stype{\SB@stypcol}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@stypcol}
+% \changes{v2.1}{2007/08/02}{Rewritten to better handle glue}
+% Column-submissions contribute the contents of |\SB@songbox| to either the
+% current column or the next column or page, depending on where it best fits.
+% \begin{macrocode}
+\newcommand\SB@stypcol{%
+ \ifnum\SB@numcols>\z@%
+ \SB@selectcol%
+ \global\setbox\SB@colbox\vbox{\SB@putboxes\unvbox}%
+ \SB@output0%
+ \else%
+ \unvbox\voidb@x%
+ \SB@breakpoint\spenalty%
+ \ifdim\sbarheight>\z@%
+ \vskip-\sbarheight\relax%
+ \fi%
+ \unvbox\SB@songbox%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@styppage}
+% Page-submissions go directly to the top of the nearest fresh page unless
+% the current page has all page-width material so far.
+%
+% Implementation notes:
+% The |\null| is needed because the page builder consults |\pagetotal|,
+% which isn't updated by \TeX{} until a box is contributed (|\unvbox| doesn't
+% count).
+% Both |\nointerlineskip|s are needed because |\unvbox| fails to update
+% |\prevdepth|, and it doesn't make sense to inherit its value from whatever
+% preceeded this contribution.
+% Authors who want interline glue must therefore insert it explicitly at the
+% bottom of their contributed text.
+% \begin{macrocode}
+\newcommand\SB@styppage{%
+ \ifnum\SB@numcols>\z@%
+ \SB@clearpage%
+ \unvbox\SB@songbox%
+ \nointerlineskip\null%
+ \else%
+ \unvbox\SB@songbox%
+ \fi%
+ \nointerlineskip%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@sgroup}
+% This macro controls whether songs submitted to the
+% page-builder are actually contributed to the final document when
+% using |\includeonlysongs| to generate a partial list.
+% If |\SB@sgroup| is empty, then the song is silently dropped.
+% Otherwise it is contributed only if |\SB@sgroup| is a member of
+% |\songlist|.
+% \begin{macrocode}
+\newcommand\SB@sgroup{}
+\let\SB@sgroup\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@groupcnt}
+% This counter assigns a unique integer to each item of a group.
+% Environments that come before the group's song are numbered decreasingly
+% from $-1$.
+% The song itself has number 0.
+% Environments that come after the song are numbered increasingly from 1.
+% \begin{macrocode}
+\SB@newcount\SB@groupcnt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@submitpart}
+% When a song completes and we're generating a partial list, save the song
+% in a box so that it can be submitted at the end of the section in the
+% order specified by |\includeonlysongs|.
+% \begin{macrocode}
+\newcommand\SB@submitpart{%
+ \ifx\SB@sgroup\@empty\else%
+ \@for\SB@temp:=\songlist\do{%
+ \ifx\SB@temp\SB@sgroup%
+ \edef\SB@tempii{\SB@sgroup @\the\SB@groupcnt}%
+ \expandafter\SB@newbox\csname songbox@\SB@tempii\endcsname%
+ \global\expandafter\setbox
+ \csname songbox@\SB@tempii\endcsname\box\SB@songbox%
+ \global\expandafter\let%
+ \csname stype@\SB@tempii\endcsname\SB@stype%
+ \ifrepchorus\ifvoid\SB@chorusbox\else%
+ \expandafter\SB@newbox\csname chbox@\SB@tempii\endcsname%
+ \global\expandafter\setbox%
+ \csname chbox@\SB@tempii\endcsname\box\SB@chorusbox%
+ \fi\fi%
+ \fi%
+ }%
+ \global\advance\SB@groupcnt%
+ \ifnum\SB@groupcnt<\z@\m@ne\else\@ne\fi%
+ \fi%
+ \setbox\SB@songbox\box\voidb@x%
+ \setbox\SB@chorusbox\box\voidb@x%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@submitsong}
+% Submit the most recently finished song (or block of other vertical material)
+% for output.
+% If we're generating a partial list of songs, save it in a box instead of
+% submitting it here.
+% (The saved boxes will be submitted in the requested order at the end of
+% the songs section.)
+% \begin{macrocode}
+\newcommand\SB@submitsong{%
+ \ifpartiallist\SB@submitpart\else\SB@stype\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@submitenv}
+% Submit the |\SB@envbox| box as a page-width contribution.
+% \begin{macrocode}
+\newcommand\SB@submitenv{%
+ \begingroup%
+ \let\SB@songbox\SB@envbox%
+ \SB@styppage%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@songlistbrk}
+% \begin{macro}{\SB@songlistnc}
+% \begin{macro}{\SB@songlistcp}
+% \begin{macro}{\SB@songlistcdp}
+% These macros define the words that, when placed in a |\songlist|,
+% force a column break at that point.
+% Using |brk| produces a soft break (like |\brk|) that won't leave
+% whitespace at the bottom of the broken column in lyric books.
+% Using |nextcol| produces a hard break (like |\nextcol|) that may
+% insert whitespace to finish the column.
+% Using |sclearpage| moves to the next page if the current page is
+% nonempty.
+% Using |scleardpage| moves to the next double-page if the current
+% double-page is nonempty.
+% \begin{macrocode}
+\newcommand\SB@songlistbrk{}
+\def\SB@songlistbrk{brk}
+\newcommand\SB@songlistnc{}
+\def\SB@songlistnc{nextcol}
+\newcommand\SB@songlistcp{}
+\def\SB@songlistcp{sclearpage}
+\newcommand\SB@songlistcdp{}
+\def\SB@songlistcdp{scleardpage}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\commitsongs}\MainImpl{commitsongs}
+% If we're generating only a partial list, then wait until the end of the
+% section and then output all the songs we saved in boxes in the order
+% specified.
+% \begin{macrocode}
+\newcommand\commitsongs{%
+ \ifpartiallist%
+ \ifnum\SB@numcols>\z@%
+ \@for\SB@temp:=\songlist\do{%
+ \ifx\SB@temp\SB@songlistnc\SB@nextcol\@ne\@flushglue\else%
+ \ifx\SB@temp\SB@songlistbrk\SB@nextcol\@ne\colbotglue\else%
+ \ifx\SB@temp\SB@songlistcp\SB@clearpage\else%
+ \ifx\SB@temp\SB@songlistcdp\SB@cleardpage\else%
+ \SB@groupcnt\m@ne\SB@finloop%
+ \SB@groupcnt\z@\SB@finloop%
+ \fi\fi\fi\fi%
+ }%
+ \else%
+ \@for\SB@temp:=\songlist\do{%
+ \ifx\SB@temp\SB@songlistnc\vfil\break\else%
+ \ifx\SB@temp\SB@songlistbrk\break\else%
+ \ifx\SB@temp\SB@songlistcp\clearpage\else%
+ \ifx\SB@temp\SB@songlistcdp%
+ \clearpage%
+ \ifodd\c@page\null\newpage\fi%
+ \else%
+ \SB@groupcnt\m@ne\SB@finloop%
+ \SB@groupcnt\z@\SB@finloop%
+ \fi\fi\fi\fi%
+ }%
+ \fi%
+ \fi%
+ \SB@clearpage%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@finloop}
+% While contributing saved material included by |\includeonlysongs|,
+% this macro contributes each series of boxes grouped together as part of a
+% |songgroup| environment.
+% \begin{macrocode}
+\newcommand\SB@finloop{%
+ \loop\edef\SB@tempii{\SB@temp @\the\SB@groupcnt}%
+ \expandafter\ifx%
+ \csname songbox@\SB@tempii\endcsname\relax\else%
+ \setbox\SB@songbox\expandafter\box%
+ \csname songbox@\SB@tempii\endcsname%
+ \expandafter\ifx\csname chbox@\SB@tempii\endcsname\relax%
+ \repchorusfalse%
+ \else%
+ \repchorustrue%
+ \setbox\SB@chorusbox\expandafter\box%
+ \csname chbox@\SB@tempii\endcsname%
+ \fi%
+ \csname stype@\SB@tempii\endcsname%
+ \advance\SB@groupcnt\ifnum\SB@groupcnt<\z@\m@ne\else\@ne\fi%
+ \repeat%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@insertchorus}
+% Insert a chorus into the first marked spot in the box given
+% in the first argument.
+% This is usually achieved by splitting the box at the first valid
+% breakpoint after the first |\SB@cmark| in the box.
+% The box is globally modified.
+% \begin{macrocode}
+\newcommand\SB@insertchorus[1]{{%
+ \vbadness\@M\vfuzz\maxdimen%
+ \setbox\SB@box\copy#1%
+ \setbox\SB@box\vsplit\SB@box to\maxdimen%
+ \edef\SB@temp{\splitfirstmarks\SB@nocmarkclass}%
+ \ifx\SB@temp\SB@nocmark\else%
+ \edef\SB@temp{\splitfirstmarks\SB@cmarkclass}%
+ \ifx\SB@temp\SB@cmark%
+ \SB@dimen4096\p@%
+ \SB@dimenii\maxdimen%
+ \SB@dimeniii\SB@dimen%
+ \loop%
+ \SB@dimeniii.5\SB@dimeniii%
+ \setbox\SB@box\copy#1%
+ \setbox\SB@box\vsplit\SB@box to\SB@dimen%
+ \edef\SB@temp{\splitfirstmarks\SB@cmarkclass}%
+ \ifx\SB@temp\SB@cmark%
+ \SB@dimenii\SB@dimen%
+ \advance\SB@dimen-\SB@dimeniii%
+ \else%
+ \advance\SB@dimen\SB@dimeniii%
+ \fi%
+ \ifdim\SB@dimeniii>2\p@\repeat%
+ \setbox\SB@box\vsplit#1to\SB@dimenii%
+ \global\setbox#1\vbox{%
+ \unvbox\SB@box\unskip%
+ \SB@inversefalse\SB@prevversetrue\SB@stanzabreak%
+ \SB@putbox\unvcopy\SB@chorusbox%
+ \SB@inversetrue\SB@prevversefalse\SB@stanzabreak%
+ \unvbox#1%
+ }%
+% \end{macrocode}
+% However, if the first mark is a |\SB@lastcmark|, it means that this chorus
+% should go after the last verse in the song.
+% There is no valid breakpoint there, so to get a chorus into that spot, we
+% have to do a rather ugly hack:
+% We pull the bottom material off the box with |\unskip|, |\unpenalty|, and
+% |\lastbox|, then insert the chorus, then put the bottom material back on.
+% This works because the high-level structure of the bottom material should
+% be static.
+% Even if the user redefines |\makepostlude|, the new definition gets put
+% in a single box that can be manipulated with |\lastbox|.
+% However, if we ever change the high-level structure, we need to remember to
+% change this code accordingly.
+% \begin{macrocode}
+ \else\ifx\SB@temp\SB@lastcmark%
+ \global\setbox#1\vbox{%
+ \unvbox#1%
+ \unskip%
+ \ifdim\sbarheight>\z@%
+ \setbox\SB@box\lastbox%
+ \unskip\unpenalty%
+ \fi%
+ \setbox\SB@box\lastbox%
+ \unskip\unskip%
+ \SB@inversefalse\SB@prevversetrue\SB@stanzabreak%
+ \marks\SB@nocmarkclass{\SB@nocmark}%
+ \unvcopy\SB@chorusbox%
+ \vskip\versesep\vskip\beforepostludeskip\relax%
+ \nointerlineskip\box\SB@box%
+ \ifdim\sbarheight>\z@%
+ \nobreak\vskip2\p@\@plus\p@%
+ \hrule\@height\sbarheight\@width\SB@colwidth%
+ \fi%
+ }%
+ \fi\fi%
+ \fi%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nextcol}\MainImpl{nextcol}
+% End the current column (inserting vertical space as needed).
+% This differs from column breaks produced with |\brk|, which does not
+% introduce any empty vertical space.
+% \begin{macrocode}
+\newcommand\nextcol{%
+ \@ifstar{\SB@nextcol\@ne\@flushglue}%
+ {\ifpartiallist\else\SB@nextcol\@ne\@flushglue\fi}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sclearpage}\MainImpl{sclearpage}
+% Move to the next page if the current page is nonempty.
+% \begin{macrocode}
+\newcommand\sclearpage{%
+ \@ifstar\SB@clearpage{\ifpartiallist\else\SB@clearpage\fi}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\scleardpage}\MainImpl{scleardpage}
+% Move to the next even-numbered page if the current page is odd or nonempty.
+% \begin{macrocode}
+\newcommand\scleardpage{%
+ \@ifstar\SB@cleardpage{\ifpartiallist\else\SB@cleardpage\fi}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Songs}
+%
+% The following macros handle the parsing and formatting of the material that
+% begins and ends each song.
+%
+% \begin{macro}{\SB@lop}
+% \begin{macro}{\SB@@lop}
+% \begin{macro}{\SB@emptylist}
+% \begin{macro}{\SB@ifempty}
+% The following macros were adapted from Donald Knuth's \emph{The \TeX book},
+% for manipulating lists of the form
+% {\it |\\|item1|\\|item2|\\|...|\\|itemN|\\|}.
+% \begin{macrocode}
+\newcommand\SB@lop[1]{\expandafter\SB@@lop\the#1\SB@@lop#1}
+\newcommand\SB@@lop{}
+\def\SB@@lop\\#1\\#2\SB@@lop#3#4{\global#3{\\#2}\global#4{#1}}
+\newcommand\SB@emptylist{}
+\def\SB@emptylist{\\}
+\newcommand\SB@ifempty[3]{%
+ \edef\SB@temp{\the#1}%
+ \ifx\SB@temp\SB@emptylist#2\else#3\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@titlelist}
+% \begin{macro}{\SB@titletail}
+% These registers hold the full list of titles for the current song and
+% the tail list of titles that has not yet been iterated over.
+% \begin{macrocode}
+\SB@newtoks\SB@titlelist
+\SB@newtoks\SB@titletail
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\songtitle}
+% \changes{v1.15}{2005/05/26}{Added song title iterators}
+% The |\songtitle| macro will initially hold the primary title of the
+% current song.
+% The user can iterate over titles using |\nexttitle| or |\foreachtitle|.
+% \begin{macrocode}
+\newcommand\songtitle{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\resettitles}\MainImpl{resettitles}
+% \changes{v1.15}{2005/05/26}{Added.}
+% Initialize the title list iterator.
+% \begin{macrocode}
+\newcommand\resettitles{%
+ \global\SB@titletail\SB@titlelist%
+ \nexttitle%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nexttitle}\MainImpl{nexttitle}
+% \changes{v1.15}{2005/05/26}{Added.}
+% Advance the title list iterator to the next title.
+% \begin{macrocode}
+\newcommand\nexttitle{%
+ \SB@ifempty\SB@titletail{%
+ \global\let\songtitle\relax%
+ }{%
+ \SB@lop\SB@titletail\SB@toks%
+ \edef\songtitle{\the\SB@toks}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\foreachtitle}\MainImpl{foreachtitle}
+% \changes{v1.15}{2005/05/26}{Added.}
+% Execute a block of code for each remaining title in the title list.
+% \begin{macrocode}
+\newcommand\foreachtitle[1]{%
+ \ifx\songtitle\relax\else%
+ \loop#1\nexttitle\ifx\songtitle\relax\else\repeat%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@insong}
+% \begin{macro}{\ifSB@intersong}
+% \begin{macro}{\ifSB@inverse}
+% \begin{macro}{\ifSB@inchorus}
+% To help the user locate errors, keep track of which environments we're inside
+% and immediately signal an error if someone tries to use a song command inside
+% a scripture quotation, etc.
+% \begin{macrocode}
+\newif\ifSB@songsenv\SB@songsenvfalse
+\newif\ifSB@insong\SB@insongfalse
+\newif\ifSB@intersong\SB@intersongfalse
+\newif\ifSB@inverse\SB@inversefalse
+\newif\ifSB@inchorus\SB@inchorusfalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@closeall}
+% If an error is detected using one of the above, the following macro will
+% contain a macro sequence sufficient to end the unclosed environment,
+% hopefully allowing processing to continue.
+% \begin{macrocode}
+\newcommand\SB@closeall{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@rawrefs}
+% \begin{macro}{\songauthors}\MainImpl{songauthors}
+% \begin{macro}{\songcopyright}\MainImpl{songcopyright}
+% \begin{macro}{\songlicense}\MainImpl{songlicense}
+% The current song's scripture references, authors, copyright info, and
+% copyright license information are stored in these macros.
+% \begin{macrocode}
+\newcommand\SB@rawrefs{}
+\newcommand\songauthors{}
+\newcommand\songcopyright{}
+\newcommand\songlicense{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\songrefs}\MainImpl{songrefs}
+% When the user asks for the song's scripture references, rather than give
+% them the raw token list that the author entered, we return a prettier
+% version in which spaces, dashes, and penalties have been adjusted.
+% The prettier version is stored in the following control sequence.
+% \begin{macrocode}
+\newcommand\songrefs{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setlicense}\MainImpl{setlicense}
+% The user sets the licensing info for the current song with this command.
+% \begin{macrocode}
+\newcommand\setlicense{\gdef\songlicense}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newsongkey}\MainImpl{newsongkey}
+% \begin{macro}{\SB@clearbskeys}
+% \changes{v2.0}{2007/06/18}{Added.}
+% Defining a new key for |\beginsong| is just like the |keyval| package's
+% |\define@key| macro except that we must also define some initializer code
+% for each key.
+% This provides an opportunity to clear registers before each song.
+% (Otherwise when a key wasn't specified, we'd inherit the old values from
+% the previous song.)
+% \begin{macrocode}
+\newcommand\SB@clearbskeys{}
+\newcommand\newsongkey[2]{%
+ \expandafter\gdef\expandafter\SB@clearbskeys\expandafter%
+ {\SB@clearbskeys#2}%
+ \define@key{beginsong}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Define keys |sr|, |by|, |cr|, |li|, |index|, and |ititle| for scripture
+% references, authors, copyright info, licensing info, lyric index entries,
+% and alternate title index entries, respectively.
+% \begin{macrocode}
+\newsongkey{sr}{\def\SB@rawrefs{}\gdef\songrefs{}}
+ {\def\SB@rawrefs{#1}\SB@parsesrefs{#1}}
+\newsongkey{by}{\def\songauthors{}}{\def\songauthors{#1}}
+\newsongkey{cr}{\def\songcopyright{}}{\def\songcopyright{#1}}
+\newsongkey{li}{\setlicense{}}{\setlicense{#1}}
+\newsongkey{index}{}{\indexentry{#1}}
+\newsongkey{ititle}{}{\indextitleentry{#1}}
+% \end{macrocode}
+%
+% \begin{environment}{song}\MainEnvImpl{song}
+% \begin{macro}{\beginsong}
+% \begin{macro}{\SB@@beginsong}
+% \begin{macro}{\SB@bsoldfmt}
+% \begin{macro}{\SB@@bskvfmt}
+% Parse the arguments of a |\beginsong| macro.
+% The |\beginsong| macro supports two syntaxes.
+% The preferred syntax takes the song title(s) as its first argument and
+% an optional keyval list in brackets as its second argument.
+% A legacy syntax supports four arguments, all enclosed in braces,
+% which are: the title(s), scripture references, authors, and copyright info.
+% \begin{macrocode}
+\newenvironment{song}{\beginsong}{\SB@endsong}
+\newcommand\beginsong[1]{%
+ \ifSB@insong\SB@errboo\SB@closeall\fi%
+ \ifSB@intersong\SB@errbor\SB@closeall\fi%
+ \SB@insongtrue%
+ \def\SB@closeall{\endsong}%
+ \SB@parsetitles{#1}%
+ \global\setbox\SB@songwrites\box\voidb@x%
+ \SB@clearbskeys%
+ \@ifnextchar[\SB@bskvfmt\SB@@beginsong%
+}
+\newcommand\SB@@beginsong{%
+ \@ifnextchar\bgroup\SB@bsoldfmt\SB@@@beginsong%
+}
+\newcommand\SB@bsoldfmt[3]{%
+ \SB@bskvfmt[sr={#1},by={#2},cr={#3}]%
+}
+\newcommand\SB@bskvfmt{}
+\def\SB@bskvfmt[#1]{%
+ \setkeys{beginsong}{#1}%
+ \SB@@@beginsong%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@@@beginsong}
+% \changes{v1.12}{2005/05/10}{Redid spacing and page-breaking}
+% \changes{v1.14}{2005/05/15}{Improved scripture reference line-breaking}
+% \changes{v2.0}{2007/06/18}{Added keyval syntax.}
+% Begin typesetting a song.
+% Beginning a song involves typesetting the title and other info, adding
+% entries to the indexes, and setting up the environment in which verses and
+% choruses reside.
+% \begin{macrocode}
+\newcommand\SB@@@beginsong{%
+ \global\SB@stanzafalse%
+ \setbox\SB@chorusbox\box\voidb@x%
+ \SB@gotchorusfalse%
+ \setbox\SB@songbox\vbox\bgroup\begingroup%
+ \ifnum\SB@numcols>\z@\hsize\SB@colwidth\fi%
+ \leftskip\z@skip\rightskip\z@skip%
+ \parfillskip\@flushglue\parskip\z@skip%
+ \SB@raggedright%
+ \global\SB@transposefactor\z@%
+ \global\SB@cr@{\\}%
+ \protected@edef\@currentlabel{\p@songnum\thesongnum}%
+ \setcounter{versenum}{1}%
+ \SB@prevversetrue%
+ \meter44%
+ \resettitles%
+ \SB@addtoindexes\songtitle\SB@rawrefs\songauthors%
+ \nexttitle%
+ \foreachtitle{\expandafter\SB@addtotitles\expandafter{\songtitle}}%
+ \resettitles%
+ \lyricfont%
+ \SB@setbaselineskip%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@endsong}
+% \changes{v1.12}{2005/05/10}{Redid spacing and page-breaking}
+% \changes{v2.0}{2007/06/18}{Removed hyperref dependency}
+% Ending a song involves creating the song header (with |\makeprelude|),
+% creating the song footer (with |\makepostlude|), and then assembling
+% everything together into the |\SB@songbox|.
+% The box is then submitted to the page-builder via |\SB@submitsong|.
+% We do things this way instead of just contributing material directly
+% to the main vertical list because submitting material song by song allows
+% for a more sophisticated page-breaking algorithm than is possible with
+% \TeX's built-in algorithm.
+% \begin{macrocode}
+\newcommand\SB@endsong{%
+ \ifSB@insong%
+ \ifSB@inverse\SB@erreov\endverse\fi%
+ \ifSB@inchorus\SB@erreoc\endchorus\fi%
+ \global\SB@skip\versesep%
+ \unskip%
+ \ifrepchorus\ifvoid\SB@chorusbox\else%
+ \ifSB@prevverse\ifvnumbered%
+ \marks\SB@cmarkclass{\SB@lastcmark}%
+ \fi\fi%
+ \fi\fi%
+ \endgroup\egroup%
+ \begingroup%
+ \ifnum\SB@numcols>\z@%
+ \hsize\ifpagepreludes\textwidth\else\SB@colwidth\fi%
+ \fi%
+ \leftskip\z@skip\rightskip\z@skip%
+ \parfillskip\@flushglue\parskip\z@skip\parindent\z@%
+ \global\setbox\SB@envbox\vbox{%
+ \songmark%
+ \unvbox\SB@songwrites%
+ \ifpagepreludes\else\ifdim\sbarheight>\z@%
+ \hrule\@height\sbarheight\@width\hsize%
+ \nobreak\vskip5\p@\relax%
+ \fi\fi%
+ \begingroup%
+ \resettitles%
+ \songtarget{\ifnum\c@section=\z@1\else2\fi}%
+ {song\theSB@songsnum-\thesongnum}%
+ \endgroup%
+ \vbox{\makeprelude}%
+ \nobreak\vskip\SB@skip%
+ \vskip\afterpreludeskip\relax%
+ }%
+ \ifnum\SB@numcols>\z@\hsize\SB@colwidth\fi%
+ \global\setbox\SB@songbox\vbox{%
+ \ifpagepreludes\else\unvbox\SB@envbox\fi%
+ \unvbox\SB@songbox%
+ \nobreak\vskip\SB@skip%
+ \vskip\beforepostludeskip\relax%
+ \nointerlineskip%
+ \vbox{\makepostlude}%
+ \ifdim\sbarheight>\z@%
+ \nobreak\vskip2\p@\@plus\p@%
+ \nointerlineskip%
+ \hbox{\vrule\@height\sbarheight\@width\hsize}%
+ \fi%
+ }%
+ \endgroup%
+ \SB@insongfalse%
+ \edef\SB@sgroup{\thesongnum}%
+ \global\SB@groupcnt\z@%
+ \ifpagepreludes\SB@submitenv\fi%
+ \SB@submitsong%
+ \ifnum\SB@grouplvl=\z@\let\SB@sgroup\@empty\fi%
+ \stepcounter{songnum}%
+ \else%
+ \ifSB@intersong\SB@erreor\SB@closeall%
+ \else\SB@erreot\fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+%
+% \begin{macro}{\SB@setbaselineskip}
+% \changes{v1.22}{2007/05/15}{Added.}
+% \changes{v2.1}{2007/08/02}{Fixed to scale better with large font sizes.}
+% Set the |\baselineskip| to an appropriate line height.
+% \begin{macrocode}
+\newcommand\SB@setbaselineskip{%
+ \SB@dimen\f@size\p@%
+ \baselineskip\SB@dimen\relax%
+ \ifchorded%
+ \setbox\SB@box\hbox{{\printchord{ABCDEFG\shrp\flt/j7}}}%
+ \advance\baselineskip\ht\SB@box%
+ \advance\baselineskip2\p@%
+ \fi%
+ \ifslides%
+ \advance\baselineskip.2\SB@dimen\@plus.5\SB@dimen%
+ \@minus.2\SB@dimen%
+ \else%
+ \advance\baselineskip\z@\@plus.1\SB@dimen\relax%
+ \fi%
+ \advance\baselineskip\baselineadj%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@setversesep}
+% Set the |\versesep| to an appropriate amount if has not already been
+% explicitly set by the user.
+% \begin{macrocode}
+\newcommand\SB@setversesep{%
+ \SB@dimen123456789sp%
+ \edef\SB@temp{\the\SB@dimen}%
+ \edef\SB@tempii{\the\versesep}%
+ \ifx\SB@temp\SB@tempii%
+ \begingroup%
+ \lyricfont%
+ \SB@dimen\f@size\p@%
+ \ifchorded%
+ \setbox\SB@box\hbox{{\printchord{ABCDEFG\shrp\flt/j7}}}%
+ \advance\SB@dimen\ht\SB@box%
+ \fi%
+ \ifslides%
+ \global\versesep1.2\SB@dimen\@plus.3\SB@dimen%
+ \@minus.3\SB@dimen%
+ \else%
+ \global\versesep.75\SB@dimen\@plus.25\SB@dimen%
+ \@minus.13\SB@dimen%
+ \fi%
+ \endgroup%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\makeprelude}\MainImpl{makeprelude}
+% \changes{v1.15}{2005/05/26}{Added to make song header format customizable.}
+% \changes{v2.0}{2007/06/18}{Arguments removed to support keyval syntax.}
+% Generate the material that begins each song.
+% This macro is invoked at |\endsong| so that its code can access song info
+% defined throughout the song.
+% \begin{macrocode}
+\newcommand\makeprelude{%
+ \resettitles%
+ \ifslides%
+ \hbox to\hsize{{%
+ \hfil\stitlefont\songtitle\hfil%
+ }}%
+ \vskip5\p@%
+ \hbox to\hsize{%
+ \hfil%
+ \vbox{%
+ \divide\hsize\tw@\parskip\p@\relax%
+ \centering\small\extendprelude%
+ }%
+ \hfil%
+ }%
+ \else%
+ \ifdim\songnumwidth>\z@%
+ \setbox\SB@boxii\hbox{{\SB@colorbox\snumbgcolor{%
+ \hbox to\songnumwidth{%
+ \printsongnum{\thesongnum}\hfil%
+ }%
+ }}}%
+ \fi%
+ \setbox\SB@box\vbox{%
+ \ifdim\songnumwidth>\z@%
+ \SB@dimen\wd\SB@boxii%
+ \advance\SB@dimen3\p@%
+ \ifpagepreludes\multiply\SB@dimen\tw@\fi%
+ \advance\hsize-\SB@dimen%
+ \fi%
+ \ifpagepreludes\centering\else\SB@raggedright\fi%
+ \offinterlineskip\lineskip\p@%
+ {\stitlefont%
+ \songtitle\par%
+ \nexttitle%
+ \foreachtitle{(\songtitle)\par}}%
+ \ifdim\prevdepth=\z@\kern\p@\fi%
+ \parskip\p@\relax\tiny%
+ \extendprelude%
+ \kern\z@%
+ }%
+ \ifdim\songnumwidth>\z@%
+ \hbox{%
+ \ifdim\ht\SB@boxii>\ht\SB@box%
+ \box\SB@boxii%
+ \kern3\p@%
+ \vtop{\box\SB@box}%
+ \else%
+ \SB@colorbox\snumbgcolor{\vbox to\ht\SB@box{{%
+ \hbox to\songnumwidth{%
+ \printsongnum{\thesongnum}\hfil%
+ }\vfil%
+ }}}%
+ \kern3\p@%
+ \box\SB@box%
+ \fi%
+ }%
+ \else%
+ \unvbox\SB@box%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\makepostlude}\MainImpl{makepostlude}
+% \changes{v1.15}{2005/05/26}{Added to make song trailer format customizable.}
+% \changes{v2.0}{2007/06/18}{Arguments removed to support keyval syntax.}
+% Generate the material that ends each song.
+% \begin{macrocode}
+\newcommand\makepostlude{%
+ \SB@raggedright\baselineskip\z@skip\parskip\z@skip\parindent\z@%
+ \tiny\extendpostlude%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showauthors}\MainImpl{showauthors}
+% Display the author line in the prelude.
+% \begin{macrocode}
+\newcommand\showauthors{%
+ \setbox\SB@box\hbox{\bfseries\sfcode`.\@m\songauthors}%
+ \ifdim\wd\SB@box>\z@\unhbox\SB@box\par\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showrefs}\MainImpl{showrefs}
+% Display the scripture references in the prelude.
+% \begin{macrocode}
+\newcommand\showrefs{%
+ \setbox\SB@box\hbox{\slshape\songrefs\vphantom,}%
+ \ifdim\wd\SB@box>\z@\unhbox\SB@box\par\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@next}
+% \begin{macro}{\SB@donext}
+% \begin{macro}{\SB@dothis}
+% Several macros use |\futurelet| to look ahead in the input stream, and then
+% take various actions depending on what is seen.
+% In these macros, |\SB@next| is assigned the token seen, |\SB@dothis| is
+% assigned the action to be taken on this loop iteration, and |\SB@donext| is
+% assigned the action to be taken to continue (or terminate) the loop.
+% \begin{macrocode}
+\newcommand\SB@next{}
+\newcommand\SB@donext{}
+\newcommand\SB@dothis{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@nextname}
+% Sometimes when scanning ahead we |\string|ify the name of the next token.
+% When that happens, the name is stored in this macro for safekeeping.
+% \begin{macrocode}
+\newcommand\SB@nextname{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@appendsp}
+% Append an explicit space token (catcode 10) to a token register.
+% This is a useful macro to have around because inlining this code directly
+% into a larger macro is harder than it seems:
+% If you write the following code but with an explicit control sequence
+% instead of |#1|, then the space immediately following the name will get
+% stripped by the \TeX{} parser.
+% But invoking the following macro with a control sequence as an argument
+% works fine, because in that case the explicit space has already been
+% tokenized when this macro was first defined and won't be stripped as it
+% is expanded.
+% \begin{macrocode*}
+\newcommand\SB@appendsp[1]{#1\expandafter{\the#1 }}
+% \end{macrocode*}
+% \end{macro}
+%
+% \begin{macro}{\SB@parsetitles}
+% \changes{v2.1}{2007/08/02}{Added}
+% Parse a list of song titles.
+% This just involves removing leading and trailing spaces from around each
+% title in the |\\|-separated list.
+% \begin{macrocode}
+\newcommand\SB@parsetitles[1]{%
+ \begingroup%
+ \global\SB@titlelist{\\}%
+ \SB@toks{}%
+ \let\\\SB@titlesep%
+ \SB@pthead#1\SB@endparse%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@pthead}
+% \begin{macro}{\SB@@pthead}
+% \begin{macro}{\SB@@@pthead}
+% While processing tokens at the head of a title, we skip over all spaces
+% until we reach a non-space token.
+% \begin{macrocode}
+\newcommand\SB@pthead{\futurelet\SB@next\SB@@pthead}
+\newcommand\SB@@pthead{%
+ \ifcat\noexpand\SB@next\@sptoken%
+ \expandafter\SB@@@pthead%
+ \else%
+ \expandafter\SB@ptmain%
+ \fi%
+}
+\newcommand\SB@@@pthead{%
+ \afterassignment\SB@pthead%
+ \let\SB@next= }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@ptloop}
+% The iterator of the title parser loop just scans the next token.
+% \begin{macrocode}
+\newcommand\SB@ptloop{\futurelet\SB@next\SB@ptmain}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@ptmain}
+% Once we've reached a non-space token in the title, we consume the remainder
+% of the title as-is, except that space tokens should be trimmed from the end
+% of each title.
+% \begin{macrocode}
+\newcommand\SB@ptmain{%
+ \ifcat\noexpand\SB@next\@sptoken%
+ \let\SB@donext\SB@ptsp%
+ \else\ifcat\noexpand\SB@next\bgroup%
+ \let\SB@donext\SB@ptbg%
+ \else\ifx\SB@next\SB@endparse%
+ \global\SB@titlelist\expandafter{\the\SB@titlelist\\}%
+ \let\SB@donext\@gobble%
+ \else\ifx\SB@next\\%
+ \SB@toks{}%
+ \def\SB@donext{\SB@ptstep\SB@pthead}%
+ \else%
+ \def\SB@donext{\SB@ptstep\SB@ptloop}%
+ \fi\fi\fi\fi%
+ \SB@donext}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@ptstep}
+% Consume a non-space, non-left-brace token and add it to the current song
+% title.
+% If any spaces preceded it, add those too.
+% \begin{macrocode}
+\newcommand\SB@ptstep[2]{%
+ \global\SB@titlelist\expandafter\expandafter\expandafter{%
+ \expandafter\the\expandafter\SB@titlelist\the\SB@toks#2}%
+ \SB@toks{}%
+ #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@ptbg}
+% The next title token is a left-brace.
+% It should be balanced, so consume the entire group and add it (along with
+% its surrounding braces) as-is to the current title.
+% \begin{macrocode}
+\newcommand\SB@ptbg[1]{\SB@ptstep\SB@ptloop{{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@ptsp}
+% The next title token is a space.
+% We won't know whether to include it in the title until we see what
+% follows it.
+% Strings of spaces followed by the |\\| title-delimiter token, or that
+% conclude a title argument, should be stripped.
+% So rather than add the space token to the title, we remember it in a
+% token register for possible later inclusion.
+% \begin{macrocode}
+\newcommand\SB@ptsp{
+ \SB@appendsp\SB@toks%
+ \afterassignment\SB@ptloop%
+ \let\SB@next= }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@titlesep}
+% While parsing song titles, we temporarily assign |\\| a non-trivial
+% top-level expansion (|\SB@titlesep|) in order to distinguish it from
+% other macros.
+% \begin{macrocode}
+\newcommand\SB@titlesep{SB@titlesep}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@endparse}
+% The |\SB@endparse| token marks the end of a token sequence being parsed.
+% If parsing works as intended, the macro should never be expanded, so
+% produce an error if it is.
+% \begin{macrocode}
+\newcommand\SB@endparse{%
+ \SB@Error{Title parsing failed}{This error should not occur.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@parsesrefs}
+% \changes{v1.14}{2005/05/15}{Added}
+% Assign the |\songrefs| macro a processed version of a scripture reference in
+% which the following adjustments have been made:
+% (1)~Spaces not preceded by a comma or semicolon are made non-breaking.
+% For example, |2 John 1:1| and |Song of Solomon 1:1| become |2~John~1:1| and
+% |Song~of~Solomon~1:1|, respectively.
+% (2)~Spaces between a semicolon and a book name are lengthened to en-spaces.
+% (3)~Single hyphens are lengthened to en-dashes (|--|).
+% (4)~Non-breaking, thin spaces are appended to commas not followed by a
+% space. For example |John 3:16,17| becomes |John~3:16,\nobreak\thinspace17|.
+% (5)~Everything within an explicit group is left unchanged, allowing the
+% user to suppress all of the above as desired.
+%
+% To achieve this, we must change all commas, hyphens, and spaces
+% in the scripture reference into active characters.
+% Unfortunately, the catcodes of everything in the text were set back when
+% the full keyval list was digested as an argument to |\beginsong|, so we
+% must unset and reset the catcodes.
+% One obvious solution is to use |\scantokens| from $\varepsilon$-\TeX{} to
+% do this, but that doesn't allow us to suppress the re-catcoding process
+% within groups, and we'd like to avoid intoducing features that require
+% $\varepsilon$-\TeX{} anyway for compatibility reasons.
+% Therefore, we build the following small scanner instead.
+%
+% The scanner walks through the text token by token, replacing each important
+% token by its active equivalent.
+% No character codes are modified during this process and no tokens are
+% inserted because some of these tokens might end up being arguments to
+% multi-byte unicode character macros rather than being expanded directly.
+% The |inputenc| package only cares about the character codes, not the
+% category codes, so modifying only the category codes should be safe.
+% \begin{macrocode}
+\newcommand\SB@parsesrefs[1]{%
+ \begingroup%
+ \SB@toks{\begingroup\SB@sractives}%
+ \SB@prloop#1\SB@endparse%
+ \xdef\songrefs{\the\SB@toks\endgroup}%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@prloop}
+% \begin{macro}{\SB@prstep}
+% \begin{macro}{\SB@@prstep}
+% The main loop of the scripture reference scanner identifies each space,
+% hyphen, and comma for special treatment.
+% \begin{macrocode}
+\newcommand\SB@prloop{\futurelet\SB@next\SB@prstep}
+\newcommand\SB@prstep{%
+ \ifcat\noexpand\SB@next A%
+ \expandafter\SB@prcpy%
+ \else%
+ \expandafter\SB@@prstep%
+ \fi%
+}
+\newcommand\SB@@prstep{%
+ \ifcat\noexpand\SB@next\@sptoken%
+ \let\SB@donext\SB@prspace%
+ \else\ifx\SB@next-%
+ \let\SB@donext\SB@prhyphen%
+ \else\ifx\SB@next,%
+ \let\SB@donext\SB@prcomma%
+ \else\ifx\SB@next\SB@endparse
+ \let\SB@donext\@gobble%
+ \else\ifcat\noexpand\SB@next\bgroup%
+ \let\SB@donext\SB@prgr%
+ \else%
+ \let\SB@donext\SB@prcpy%
+ \fi\fi\fi\fi\fi%
+ \SB@donext%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@prcpy}
+% \begin{macro}{\SB@prgr}
+% Anything that isn't one of the special tokens above, and anything in a
+% group, is copied without modification.
+% \begin{macrocode}
+\newcommand\SB@prcpy[1]{\SB@toks\expandafter{\the\SB@toks#1}\SB@prloop}
+\newcommand\SB@prgr[1]{\SB@toks\expandafter{\the\SB@toks{#1}}\SB@prloop}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\SB@prcomma}
+% \begin{macro}{\SB@prhyphen}
+% Commas and hyphens are replaced with active equivalents.
+% \begin{macrocode}
+\newcommand\SB@prcomma[1]{}
+{\catcode`,\active
+ \gdef\SB@prcomma#1{\SB@toks\expandafter{\the\SB@toks,}\SB@prloop}}
+\newcommand\SB@prhyphen[1]{}
+{\catcode`-\active
+ \gdef\SB@prhyphen#1{\SB@toks\expandafter{\the\SB@toks-}\SB@prloop}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@prspace}
+% \begin{macro}{\SB@@prspace}
+% Spaces are made active as well, but doing so requires some
+% specialized code since they cannot be consumed as implicit macro arguments.
+% \begin{macrocode*}
+\newcommand\SB@prspace[1]{}
+{\obeyspaces
+\gdef\SB@prspace{\SB@toks\expandafter{\the\SB@toks }\SB@@prspace}}
+% \end{macrocode*}
+% \begin{macrocode}
+\newcommand\SB@@prspace{\afterassignment\SB@prloop\let\SB@temp= }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\SB@sractives}
+% Assign macro definitions to active commas, hyphens, spaces, and returns
+% when the token list generated by |\SB@parsesrefs| is used to typeset a
+% scripture reference list.
+% \begin{macrocode*}
+\newcommand\SB@sractives{}
+{\catcode`,\active\catcode`-\active\obeyspaces%
+\gdef\SB@sractives{%
+\let,\SB@srcomma\let-\SB@srhyphen\let \SB@srspace%
+\SB@srspacing}%
+}
+% \end{macrocode*}
+% \end{macro}
+%
+% \begin{macro}{\SB@srspacing}
+% The space factors of semicolons and commas are what the active spaces
+% within a scripture reference text use to decide what came before.
+% The following sets them to their default values in case they have been
+% changed, but sets all other space factors to 1000.
+% \begin{macrocode}
+\newcommand\SB@srspacing{%
+ \nonfrenchspacing\sfcode`\;=1500\sfcode`\,=1250\relax%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@srcomma}
+% \begin{macro}{\SB@@srcomma}
+% Commas not already followed by whitespace are appended with a thin,
+% non-breaking space.
+% \begin{macrocode}
+\newcommand\SB@srcomma{,\futurelet\SB@next\SB@@srcomma}
+\newcommand\SB@@srcomma{%
+ \ifx\SB@next\SB@srspace\else%
+ \nobreak\thinspace%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@srhyphen}
+% \begin{macro}{\SB@@srhyphen}
+% \begin{macro}{\SB@srdash}
+% \begin{macro}{\SB@@srdash}
+% Hyphens that are not already part of a ligature (an en- or em-dash)
+% become en-dashes.
+% \begin{macrocode}
+\newcommand\SB@srhyphen{\futurelet\SB@next\SB@@srhyphen}
+\newcommand\SB@@srhyphen{%
+ \ifx\SB@next\SB@srhyphen\expandafter\SB@srdash\else--\fi%
+}
+\newcommand\SB@srdash[1]{\futurelet\SB@next\SB@@srdash}
+\newcommand\SB@@srdash{%
+ \ifx\SB@next\SB@srhyphen---\expandafter\@gobble\else--\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@srspace}
+% \begin{macro}{\SB@@srspace}
+% To compress consecutive whitespace, we ignore spaces
+% immediately followed by more whitespace.
+% Spaces not preceded by a semicolon or comma become non-breaking.
+% Most spaces following a semicolon become en-spaces with favorable
+% breakpoints, but a special case arises for spaces between a semicolon
+% and a digit (see |\SB@srcso| below).
+% \begin{macrocode}
+\newcommand\SB@srspace{\futurelet\SB@next\SB@@srspace}
+\newcommand\SB@@srspace{%
+ \let\SB@donext\relax%
+ \ifx\SB@next\SB@srspace\else%
+ \ifnum\spacefactor>\@m%
+ \ifnum\spacefactor>1499 %
+ \ifcat\noexpand\SB@next0%
+ \let\SB@donext\SB@srcso%
+ \else%
+ \penalty-5\enskip%
+ \fi%
+ \else%
+ \space%
+ \fi%
+ \else%
+ \nobreak\space%
+ \fi%
+ \fi%
+ \SB@donext%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@srcso}
+% \begin{macro}{\SB@@srcso}
+% A space between a semicolon and a digit could be within a list of
+% verse references for a common book (e.g., |Job 1:1; 2:2|);
+% or it could separate the previous book from a new book whose name
+% starts with a number (e.g., |Job 1:1; 1 John 1:1|).
+% In the former case, we should just use a regular space;
+% but in the latter case we should be using an en-space with a
+% favorable breakpoint.
+% To distinguish between the two, we peek ahead at the next two tokens.
+% If the second one is a space, assume the latter; otherwise assume the
+% former.
+% \begin{macrocode}
+\newcommand\SB@srcso[1]{\futurelet\SB@temp\SB@@srcso}
+\newcommand\SB@@srcso{%
+ \ifx\SB@temp\SB@srspace%
+ \penalty-5\enskip%
+ \else%
+ \space%
+ \fi%
+ \SB@next%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Verses and Choruses}
+%
+% The following programming typesets song contents, including verses, choruses,
+% and textual notes.
+%
+% \begin{macro}{\ifSB@stanza}
+% The following conditional remembers if we've seen any stanzas yet in the
+% current song.
+% \begin{macrocode}
+\newif\ifSB@stanza
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@stanzabreak}
+% \changes{v1.12}{2005/05/10}{Fixed stanza counting code and improved spacing}
+% End this song stanza and start a new one.
+% \begin{macrocode}
+\newcommand\SB@stanzabreak{%
+ \ifhmode\par\fi%
+ \ifSB@stanza%
+ \SB@breakpoint{%
+ \ifSB@inverse%
+ \ifSB@prevverse\vvpenalty\else\cvpenalty\fi%
+ \else%
+ \ifSB@prevverse\vcpenalty\else\ccpenalty\fi%
+ \fi%
+ }%
+ \vskip\versesep%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@breakpoint}
+% Insert a valid breakpoint into the vertical list comprising a song.
+% \begin{macrocode}
+\newcommand\SB@breakpoint[1]{%
+ \begingroup%
+ \ifnum#1<\@M%
+ \SB@skip\colbotglue\relax%
+ \SB@skip-\SB@skip%
+ \else%
+ \SB@skip\z@skip%
+ \fi%
+ \advance\SB@skip\lastskip%
+ \unskip%
+ \nobreak%
+ \ifnum#1<\@M%
+ \vskip\colbotglue\relax%
+ \penalty#1%
+ \fi%
+ \vskip\SB@skip%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@putbox}
+% Unbox a vbox and follow it by vertical glue if its depth is unusually
+% shallow.
+% This ensures that verses and choruses will look equally spaced even if
+% one of them has a final line with no descenders.
+% \begin{macrocode}
+\newcommand\SB@putbox[2]{%
+ \begingroup%
+ \SB@dimen\dp#2%
+ #1#2%
+ \setbox\SB@box\hbox{{\lyricfont p}}%
+ \ifdim\SB@dimen<\dp\SB@box%
+ \advance\SB@dimen-\dp\SB@box%
+ \vskip-\SB@dimen%
+ \fi%
+ \setbox\SB@box\box\voidb@x%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@obeylines}
+% Within verses and choruses we would like to use |\obeylines| so that each
+% \meta{return} in the source file ends a paragraph without having to say
+% |\par| explicitly.
+% The \LaTeX{} base code establishes the convention that short-term changes to
+% |\par| will restore |\par| by setting it equal to |\@par|.
+% Long-term (i.e., environment-long) changes to |\par| should therefore
+% redefine |\@par| to restore the desired long-term definition.
+% The following code starts a long-term redefinition of |\par| adhering to
+% these conventions, and extends that definition to \meta{return} as well.
+% \begin{macrocode}
+\newcommand\SB@obeylines{%
+ \let\par\SB@par%
+ \obeylines%
+ \let\@par\SB@@par%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@par}
+% The following replacement definition of |\par| constructs paragraphs in
+% which page-breaks are disallowed, since no wrapped line in a song should
+% span a page- or column-break.
+% It then inserts an interlinepenalty after the paragraph so that such
+% penalties will appear between consecutive lines in each verse.
+% (Note: The |\endgraf| macro must not be uttered within a local group
+% since this prevents parameters like |\hangindent| from being
+% reset at the conclusion of each paragraph.)
+% \begin{macrocode}
+\newcommand\SB@par{%
+ \ifhmode%
+ \SB@cnt\interlinepenalty%
+ \interlinepenalty\@M%
+ \endgraf%
+ \interlinepenalty\SB@cnt%
+ \ifSB@inchorus%
+ \ifdim\cbarwidth>\z@\nobreak\else\SB@ilpenalty\fi%
+ \else%
+ \SB@ilpenalty%
+ \fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@ilpenalty}
+% By default, breaking a vertical list between paragraphs incurs a penalty
+% of zero.
+% Thus, we only insert an explicit penalty between lines if
+% |\interlinepenalty| is non-zero.
+% This avoids cluttering the vertical list with superfluous zero penalties.
+% \begin{macrocode}
+\newcommand\SB@ilpenalty{%
+ \ifnum\interlinepenalty=\z@\else%
+ \penalty\interlinepenalty%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@@par}
+% This replacement definition of |\@par| restores the |\SB@par| definition of
+% |\par| and then ends the paragraph.
+% \begin{macrocode}
+\newcommand\SB@@par{\let\par\SB@par\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@parindent}
+% \changes{v1.12}{2005/05/10}{Added}
+% Reserve a length to remember the current |\parindent|.
+% \begin{macrocode}
+\SB@newdimen\SB@parindent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@everypar}
+% Reserve a control sequence to hold short-term changes to |\everypar|.
+% \begin{macrocode}
+\newcommand\SB@everypar{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@raggedright}
+% \changes{v1.12}{2005/05/10}{Added}
+% Perform |\raggedright| except don't nuke the |\parindent|.
+% \begin{macrocode}
+\newcommand\SB@raggedright{%
+ \SB@parindent\parindent%
+ \raggedright%
+ \parindent\SB@parindent%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vnumbered}
+% \changes{v2.1}{2007/08/02}{Renamed.}
+% The following conditional remembers whether this verse is being numbered
+% or not (i.e., it distinguishes between |\beginverse| and |\beginverse*|).
+% \begin{macrocode}
+\newif\ifvnumbered
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@prevverse}
+% Reserve a conditional to remember if the previous block in this song was
+% a verse.
+% \begin{macrocode}
+\newif\ifSB@prevverse
+% \end{macrocode}
+% \end{macro}
+%
+% Before replacing the little-used |verse| environment with a new one,
+% issue a warning if the current definition of |\verse| is not the
+% \LaTeX-default one.
+% This may indicate a package clash.
+% \begin{macrocode}
+\CheckCommand\verse{%
+ \let\\\@centercr%
+ \list{}{%
+ \itemsep\z@%
+ \itemindent-1.5em%
+ \listparindent\itemindent%
+ \rightmargin\leftmargin%
+ \advance\leftmargin1.5em%
+ }%
+ \item\relax%
+}
+% \end{macrocode}
+%
+% \begin{environment}{verse}\MainEnvImpl{verse}
+% \begin{environment}{verse*}
+% \begin{macro}{\beginverse}
+% Begin a new verse.
+% This can be done by beginning a |verse| environment or by using the
+% |\beginverse| macro.
+% The latter must check for a trailing star to determine whether this
+% verse should be numbered.
+% We use |\@ifstar| to scan ahead for the star, but this needs to be done
+% carefully because while scanning we might encounter tokens that
+% should be assigned different catcodes once the verse really begins.
+% Thus, we temporarily invoke |\SB@loadactives| for the duration of
+% |\@ifstar| so that everything gets the right catcode.
+% \begin{macrocode}
+\renewenvironment{verse}
+ {\vnumberedtrue\SB@beginverse}
+ {\SB@endverse}
+\newenvironment{verse*}
+ {\vnumberedfalse\SB@beginverse}
+ {\SB@endverse}
+\newcommand\beginverse{%
+ \begingroup%
+ \SB@loadactives%
+ \@ifstar{\endgroup\vnumberedfalse\SB@beginverse}%
+ {\endgroup\vnumberedtrue\SB@beginverse}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+% \end{environment}
+%
+% \begin{macro}{\SB@beginverse}
+% \changes{v1.12}{2005/05/10}{Shifted to using \cs{parindent} instead of \cs{everypar} to do indentation}
+% Start the body of a verse.
+% We begin by inserting a mark if |\repchoruses| is active and this verse
+% was preceded by a numbered verse (making this an eligible place to insert
+% a chorus later).
+%
+% Verse numbering is implemented using |\everypar| so that if there is any
+% vertical material between the |\beginverse| and the first line of the
+% verse, that material will come before the verse number.
+% Intervening horizontal material (e.g., |\textnote|) can temporarily
+% clear |\everypar| to defer the verse number until later.
+% \begin{macrocode}
+\newcommand\SB@beginverse{%
+ \ifSB@insong%
+ \ifSB@inverse\SB@errbvv\endverse\fi%
+ \ifSB@inchorus\SB@errbvc\endchorus\fi%
+ \else%
+ \SB@errbvt\beginsong{Unknown Song}%
+ \fi%
+ \ifrepchorus\ifvoid\SB@chorusbox\else%
+ \SB@gotchorustrue%
+ \ifSB@prevverse\ifvnumbered%
+ \marks\SB@cmarkclass{\SB@cmark}%
+ \fi\fi%
+ \fi\fi%
+ \SB@inversetrue%
+ \def\SB@closeall{\endverse\endsong}%
+ \SB@stanzabreak%
+ \versemark\nobreak%
+ \global\SB@stanzatrue%
+ \SB@ifempty\SB@cr@\memorize{\replay[]}%
+ \setbox\SB@box\vbox\bgroup\begingroup%
+ \ifvnumbered%
+ \protected@edef\@currentlabel{\p@versenum\theversenum}%
+ \def\SB@everypar{%
+ \setbox\SB@box\hbox{{\printversenum{\theversenum}}}%
+ \ifdim\wd\SB@box<\versenumwidth%
+ \setbox\SB@box%
+ \hbox to\versenumwidth{\unhbox\SB@box\hfil}%
+ \fi%
+ \ifchorded\vrule\@height\baselineskip\@width\z@\@depth\z@\fi%
+ \placeversenum\SB@box%
+ \gdef\SB@everypar{}%
+ }%
+ \else%
+ \def\SB@everypar{%
+ \ifchorded\vrule\@height\baselineskip\@width\z@\@depth\z@\fi%
+ \gdef\SB@everypar{}%
+ }%
+ \fi%
+ \everypar{\SB@everypar\everypar{}}%
+ \versefont\versejustify%
+ \SB@loadactives%
+ \SB@obeylines%
+ \penalty12345 %
+ \everyverse\relax%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@endverse}
+% End a verse.
+% This involves unboxing the verse material with |\SB@putbox|, which
+% corrects for last lines that are unusually shallow.
+% \begin{macrocode}
+\newcommand\SB@endverse{%
+ \ifSB@insong%
+ \ifSB@inverse%
+ \unpenalty%
+ \endgroup\egroup%
+ \SB@putbox\unvbox\SB@box%
+ \SB@inversefalse%
+ \def\SB@closeall{\endsong}%
+ \ifvnumbered\stepcounter{versenum}\fi%
+ \SB@prevversetrue%
+ \else\ifSB@inchorus\SB@errevc\endchorus%
+ \else\SB@errevo\fi\fi%
+ \else%
+ \SB@errevt%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@chorustop}
+% When a chorus is broken in to several pieces by column-breaks (via |\brk|),
+% the following conditional remembers whether the current piece is the
+% topmost one for this chorus.
+% \begin{macrocode}
+\newif\ifSB@chorustop
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chorusbox}
+% When |\repchoruses| is used, the first sequence of consecutive choruses
+% is remembered in the following box register.
+% \begin{macrocode}
+\SB@newbox\SB@chorusbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@gotchorus}
+% The following conditional remembers whether we've completed storing the
+% first block of consecutive choruses.
+% \begin{macrocode}
+\newif\ifSB@gotchorus
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@cmarkclass}
+% \begin{macro}{\SB@nocmarkclass}
+% \changes{v2.6}{2008/02/14}{Added safe allocation of extended mark registers}
+% The |\repeatchoruses| feature requires the use of two extended mark
+% classes provided by $\varepsilon$-\TeX.
+% We use the |\newmarks| macro to allocate these classes, if it's
+% available.
+% If |\newmarks| doesn't exist, then that means the user has an
+% $\varepsilon$-\TeX{} compatible version of \LaTeX, but no |etex| style
+% file to go with it;
+% we just have to pick two mark classes and hope that nobody else is
+% using them.
+% \begin{macrocode}
+\ifSB@etex
+ \@ifundefined{newmarks}{
+ \@ifundefined{newmark}{
+ \mathchardef\SB@cmarkclass83
+ \mathchardef\SB@nocmarkclass84
+ }{
+ \newmark\SB@cmarkclass
+ \newmark\SB@nocmarkclass
+ }
+ }{
+ \newmarks\SB@cmarkclass
+ \newmarks\SB@nocmarkclass
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@cmark}
+% \begin{macro}{\SB@lastcmark}
+% \begin{macro}{\SB@nocmark}
+% To determine where choruses should be inserted when |\repchoruses| is
+% active, three kinds of marks are inserted into song boxes:
+% |\SB@cmark| is used to mark places where a chorus might be inserted between
+% verses, and |\SB@lastcmark| marks a place where a chorus might be inserted
+% after the last verse of the song.
+% Both marks are $\varepsilon$-\TeX{} marks of class |\SB@cmarkclass|,
+% to avoid disrupting the use of standard \TeX{} marks.
+% Each time a chorus is automatically inserted, |\SB@nocmark| is inserted
+% with mark class |\SB@nocmarkclass| just above it (and at the top of each
+% additional page it spans).
+% This inhibits future chorus inserts until the already-inserted chorus has
+% been fully committed to the output file.
+% Otherwise some choruses could get auto-inserted multiple times at the same
+% spot, possibly even leading to an infinite loop!
+% \begin{macrocode}
+\newcommand\SB@cmark{}
+\def\SB@cmark{SB@cmark}
+\newcommand\SB@lastcmark{}
+\def\SB@lastcmark{SB@lastcmark}
+\newcommand\SB@nocmark{}
+\def\SB@nocmark{SB@nocmark}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{chorus}\MainEnvImpl{chorus}
+% \begin{macro}{\beginchorus}
+% \changes{v1.12}{2005/05/10}{Shifted to using \cs{parindent} instead of \cs{everypar} to do indentation}
+% \changes{v1.14}{2005/05/15}{Choruses now stretch like the verses}
+% Start a new chorus.
+% If |\repchoruses| is active and this is part of the first set of consecutive
+% choruses in the song, then include it and its preceding vertical material
+% in the |\SB@chorusbox| for possible later duplication elsewhere.
+% \begin{macrocode}
+\newenvironment{chorus}{\beginchorus}{\SB@endchorus}
+\newcommand\beginchorus{%
+ \ifSB@insong
+ \ifSB@inverse\SB@errbcv\endverse\fi%
+ \ifSB@inchorus\SB@errbcc\endchorus\fi%
+ \else%
+ \SB@errbct\beginsong{Unknown Song}%
+ \fi%
+ \SB@inchorustrue%
+ \def\SB@closeall{\endchorus\endsong}%
+ \SB@chorustoptrue%
+ \vnumberedfalse%
+ \SB@stanzabreak%
+ \chorusmark%
+ \ifrepchorus%
+ \ifSB@gotchorus\else\ifSB@prevverse\else%
+ \global\setbox\SB@chorusbox\vbox{%
+ \unvbox\SB@chorusbox%
+ \SB@stanzabreak%
+ \chorusmark%
+ }%
+ \fi\fi%
+ \fi%
+ \global\SB@stanzatrue%
+ \replay[]%
+ \SB@@beginchorus%
+ \everychorus\relax%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+%
+% \begin{macro}{\SB@@beginchorus}
+% Begin the body of a chorus, or continue the body of a chorus after |\brk|
+% has paused it to insert a valid breakpoint.
+% We insert an empty class-|\SB@cmarkclass| mark here so that this chorus
+% will not be duplicated elsewhere on the same page(s) where it initially
+% appears.
+% \begin{macrocode}
+\newcommand\SB@@beginchorus{%
+ \ifrepchorus\marks\SB@cmarkclass{}\fi%
+ \setbox\SB@box\vbox\bgroup\begingroup%
+ \ifchorded%
+ \def\SB@everypar{%
+ \vrule\@height\baselineskip\@width\z@\@depth\z@%
+ \gdef\SB@everypar{}%
+ }%
+ \everypar{\SB@everypar\everypar{}}%
+ \fi%
+ \chorusfont\chorusjustify%
+ \SB@loadactives%
+ \SB@obeylines%
+ \penalty12345 %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@endchorus}
+% End a chorus.
+% This involves creating the vertical line to the left of the chorus and then
+% unboxing the chorus material that was previously accumulated.
+% \begin{macrocode}
+\newcommand\SB@endchorus{%
+ \ifSB@insong%
+ \ifSB@inchorus%
+ \unpenalty%
+ \endgroup\egroup%
+ \SB@inchorusfalse%
+ \def\SB@closeall{\endsong}%
+ \setbox\SB@box\vbox{%
+ \SB@chorusbar\SB@box%
+ \SB@putbox\unvbox\SB@box%
+ }
+ \ifrepchorus\ifSB@gotchorus\else%
+ \global\setbox\SB@chorusbox\vbox{%
+ \unvbox\SB@chorusbox%
+ \unvcopy\SB@box%
+ }%
+ \fi\fi%
+ \unvbox\SB@box%
+ \SB@prevversefalse%
+ \else\ifSB@inverse\SB@errecv\endverse%
+ \else\SB@erreco\fi\fi%
+ \else%
+ \SB@errect%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@cbarshift}
+% Increase |\leftskip| to accommodate the chorus bar, if any.
+% \begin{macrocode}
+\newcommand\SB@cbarshift{%
+ \ifSB@inchorus\ifdim\cbarwidth>\z@%
+ \advance\leftskip\cbarwidth%
+ \advance\leftskip5\p@\relax%
+ \fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chorusbar}
+% Create the vertical bar that goes to the left of a chorus.
+% Rather than boxing up the chorus in order to put the bar to the left,
+% the bar is introduced as leaders directly into the vertical list of the
+% main song box.
+% This allows it to stretch and shrink when a column is typeset by the
+% page-builder.
+% \begin{macrocode}
+\newcommand\SB@chorusbar[1]{%
+ \ifdim\cbarwidth>\z@%
+ \SB@dimen\ht#1%
+ \SB@dimenii\dp#1%
+ \advance\SB@dimen%
+ \ifSB@chorustop\ifchorded\else2\fi\fi\SB@dimenii%
+ \SB@skip\SB@dimen\relax%
+ \SB@computess\SB@skip1\@plus#1%
+ \SB@computess\SB@skip{-1}\@minus#1%
+ \nointerlineskip\null\nobreak%
+ \leaders\vrule\@width\cbarwidth\vskip\SB@skip%
+ \ifSB@chorustop\ifchorded\else%
+ \advance\SB@skip-\SB@dimenii%
+ \fi\fi%
+ \nobreak\vskip-\SB@skip%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@computess}
+% \changes{v1.14}{2005/05/15}{Added}
+% This computes the stretchability or shrinkability of a vbox and stores
+% the result in the skip register given by \argp{1}.
+% If $\argp{2}=1$ and \argp{3} is ``\texttt{plus}'', then the stretchability
+% of box \argp{4} is added to the plus component of \argp{1}.
+% If $\argp{2}=-1$ and \argp{3} is ``\texttt{minus}'', then the shrinkability
+% of the box is added to the minus component of \argp{1}.
+% If the stretchability or shrinkability is infinite, then we guess 1fil
+% for that component.
+% \begin{macrocode}
+\newcommand\SB@computess[4]{%
+ \begingroup%
+ \vbadness\@M\vfuzz\maxdimen%
+ \SB@dimen4096\p@%
+ \setbox\SB@box\vbox spread#2\SB@dimen{\unvcopy#4}%
+ \ifnum\badness=\z@%
+ \global\advance#1\z@#31fil\relax%
+ \else%
+ \SB@dimenii\SB@dimen%
+ \loop%
+ \SB@dimenii.5\SB@dimenii%
+ \ifnum\badness<100 %
+ \advance\SB@dimen\SB@dimenii%
+ \else
+ \advance\SB@dimen-\SB@dimenii%
+ \fi%
+ \setbox\SB@box\vbox spread#2\SB@dimen{\unvcopy#4}%
+ \ifnum\badness=100 \SB@dimenii\z@\fi%
+ \ifdim\SB@dimenii>.1\p@\repeat%
+ \ifdim\SB@dimen<.1\p@\SB@dimen\z@\fi%
+ \global\advance#1\z@#3\SB@dimen\relax%
+ \fi%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\brk}\MainImpl{brk}
+% Placing |\brk| within a line in a verse or chorus tells \TeX{} to break the
+% line at that point (if it needs to be broken at all).
+%
+% Placing |\brk| on a line by itself within a chorus stops the chorus (and its
+% vertical bar), inserts a valid breakpoint, and then restarts the chorus
+% with no intervening space so that if the breakpoint isn't used, there will
+% be no visible effect.
+% Placing it on a line by itself within a verse just inserts a breakpoint.
+%
+% Placing |\brk| between songs forces a column- or page-break, but only if
+% generating a non-partial list of songs.
+% When generating a partial list, |\brk| between songs is ignored.
+% \begin{macrocode}
+\newcommand\brk{%
+ \ifSB@insong%
+ \ifhmode\penalty-5 \else%
+ \unpenalty%
+ \ifSB@inchorus%
+ \ifdim\cbarwidth=\z@%
+ \ifrepchorus\marks\SB@cmarkclass{}\fi%
+ \SB@breakpoint\brkpenalty%
+ \else%
+ \endgroup\egroup%
+ \ifrepchorus\ifSB@gotchorus\else%
+ \global\setbox\SB@chorusbox\vbox{%
+ \unvbox\SB@chorusbox%
+ \SB@chorusbar\SB@box%
+ \unvcopy\SB@box%
+ \SB@breakpoint\brkpenalty%
+ }%
+ \fi\fi%
+ \SB@chorusbar\SB@box%
+ \unvbox\SB@box%
+ \SB@breakpoint\brkpenalty%
+ \SB@chorustopfalse%
+ \SB@@beginchorus%
+ \fi%
+ \else%
+ \SB@breakpoint\brkpenalty%
+ \fi%
+ \fi%
+ \else%
+ \ifpartiallist\else\SB@nextcol\@ne\colbotglue\fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@boxup}
+% Typeset a shaded box containing a textual note to singers or musicians.
+% We first try typesetting the note on a single line.
+% If it's too big, then we try again in paragraph mode with full
+% justification.
+% \begin{macrocode}
+\newcommand\SB@boxup[1]{%
+ \setbox\SB@box\hbox{{\notefont#1}}%
+ \SB@dimen\wd\SB@box%
+ \advance\SB@dimen6\p@%
+ \advance\SB@dimen\leftskip%
+ \advance\SB@dimen\rightskip%
+ \ifdim\SB@dimen>\hsize%
+ \vbox{{%
+ \advance\hsize-6\p@%
+ \advance\hsize-\leftskip%
+ \advance\hsize-\rightskip%
+ \notejustify%
+ \unhbox\SB@box\par%
+ \kern\z@%
+ }}%
+ \else%
+ \vbox{\box\SB@box\kern\z@}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textnote}\MainImpl{textnote}
+% \changes{v1.12}{2005/05/10}{Defined unset paragraph parameters}
+% Create a textual note for singers and musicians.
+% If the note begins a verse or chorus, it should not be preceded by any
+% spacing.
+% Verses and choruses begin with the sentinel penalty 12345, so we check
+% |\lastpenalty| to identify this case.
+% When typesetting the note, we must be sure to temporarily clear |\everypar|
+% to inhibit any verse numbering that might be pending.
+% We also readjust the |\baselineskip| as if we weren't doing chords, since
+% no chords go above a textual note.
+% \begin{macrocode}
+\newcommand\textnote[1]{%
+ \ifhmode\par\fi%
+ \ifnum\lastpenalty=12345\else%
+ \ifSB@inverse%
+ \vskip2\p@\relax%
+ \else\ifSB@inchorus%
+ \vskip2\p@\relax%
+ \else\ifSB@stanza%
+ \nobreak\vskip\versesep%
+ \fi\fi\fi%
+ \fi%
+ \begingroup%
+ \everypar{}%
+ \ifchorded\chordedfalse\SB@setbaselineskip\chordedtrue\fi%
+ \placenote{\SB@colorbox\notebgcolor{\SB@boxup{#1}}}%
+ \endgroup%
+ \nobreak%
+ \ifSB@inverse%
+ \vskip2\p@\relax%
+ \else\ifSB@inchorus%
+ \vskip2\p@\relax%
+ \else\ifSB@stanza\else%
+ \nobreak\vskip\versesep%
+ \fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\musicnote}\MainImpl{musicnote}
+% \changes{v1.12}{2005/05/10}{Now just (conditionally) calls \cs{textnote} for consistency}
+% Create a textual note for musicians.
+% \begin{macrocode}
+\newcommand\musicnote[1]{\ifchorded\textnote{#1}\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\echo}\MainImpl{echo}
+% \begin{macro}{\SB@echo}
+% \begin{macro}{\SB@@echo}
+% \changes{v1.21}{2006/09/17}{Customized fonts now preserved.}
+% \changes{v2.1}{2007/08/02}{Toggles instead of forces slanted font.}
+% Typeset an echo part in the lyrics.
+% Echo parts will be oblique and parenthesized.
+% We toggle between oblique and upright shapes like |\emph|, but we
+% use |\slshape| instead of |\itshape| because it tends to look nicer
+% with the larger fonts used in slides mode.
+%
+% The |\echo| macro must be able to accept chords in its argument.
+% This complicates the implementation because chord macros should change
+% catcodes, but if we grab |\echo|'s argument in the usual way then all the
+% catcodes will be set before the chord macros have a chance to change them.
+% This would disallow chord name abbreviations like |#| and |&| within
+% |\echo| parts.
+%
+% If we're using $\varepsilon$-\TeX{} then the solution is easy: we use
+% |\scantokens| to re-scan the argument and thereby re-assign the catcodes.
+% (One subtlety: Whenever \LaTeX{} consumes an argument to a macro, it changes
+% |#| to |##| so that when the argument text is substituted into the body of
+% the macro, the replacement text will not contain unsubstituted parameters
+% (such as |#1|).
+% If |\scantokens| is used on the replacement text and the scanned tokens
+% assign a new catcode to |#|, that causes |#|'s to be doubled in the
+% \emph{output}, which was not the intent.
+% To avoid this problem, we use |\@sanitize| before consuming the argument to
+% |\echo|, which sets the catcodes of most special tokens (including |#|) to
+% 12, so that \LaTeX{} will not recognize any of them as parameters and will
+% therefore not double any of them.)
+% \begin{macrocode}
+\ifSB@etex
+ \newcommand\echo{\begingroup\@sanitize\SB@echo}
+ \newcommand\SB@echo[1]{%
+ \endgroup%
+ \begingroup%
+ \ifdim\fontdimen\@ne\font>\z@\upshape\else\slshape\fi%
+ \endlinechar\m@ne%
+ \scantokens{(#1)}%
+ \endgroup%
+ }
+\else
+% \end{macrocode}
+% If we're not using $\varepsilon$-\TeX, we must do something more complicated.
+% We set up the appropriate font within a local group and finish with
+% |\hbox| so that the argument to |\echo| is treated as the body of the box.
+% Control is reacquired after the box using |\aftergroup|, whereupon we
+% unbox the box and insert the closing parenthesis.
+% This almost works except that if the last thing in an echo part is a long
+% chord name atop a short lyric, the closing parenthesis will float out away
+% from the lyric instead of being sucked under the chord.
+% I can find no solution to this problem, so to avoid it users must find a
+% version of \LaTeX{} that is $\varepsilon$-\TeX{} compatible.
+% \begin{macrocode}
+ \newcommand\echo{%
+ \begingroup%
+ \ifdim\fontdimen\@ne\font>\z@\upshape\else\slshape\fi%
+ \afterassignment\SB@echo%
+ \setbox\SB@box\hbox%
+ }
+ \newcommand\SB@echo{\aftergroup\SB@@echo(}
+ \newcommand\SB@@echo{\unhbox\SB@box)\endgroup}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rep}\MainImpl{rep}
+% \changes{v1.21}{2006/09/17}{Changed to avoid math mode.}
+% Place |\rep{|\meta{n}|}| at the end of a line to indicate that it should be
+% sung \meta{n} times.
+% \begin{macrocode}
+\newcommand\rep[1]{%
+ (\raise.25ex\hbox{%
+ \fontencoding{OMS}\fontfamily{cmsy}\selectfont\char\tw@%
+ }#1)%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Scripture Quotations}
+%
+% The macros in this section typeset scripture quotations and other
+% between-songs environments.
+%
+% \begin{environment}{songgroup}\MainEnvImpl{songgroup}
+% A |songgroup| environment associates all enclosed environments
+% with the enclosed song.
+% When generating a partial list, all the enclosed environments are
+% contributed if and only if the enclosed song is contributed.
+% \begin{macrocode}
+\newenvironment{songgroup}{%
+ \ifnum\SB@grouplvl=\z@%
+ \edef\SB@sgroup{\thesongnum}%
+ \global\SB@groupcnt\m@ne%
+ \fi%
+ \advance\SB@grouplvl\@ne%
+}{%
+ \advance\SB@grouplvl\m@ne%
+ \ifnum\SB@grouplvl=\z@\let\SB@sgroup\@empty\fi%
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\SB@grouplvl}
+% Count the |songgroup| environment nesting depth.
+% \begin{macrocode}
+\SB@newcount\SB@grouplvl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{intersong}\MainEnvImpl{intersong}
+% An intersong block contributes vertical material to a column between the
+% songs of a songs section.
+% It is subject to the same column-breaking algorithm as real songs, but
+% receives none of the other formatting applied to songs.
+% \begin{macrocode}
+\newenvironment{intersong}{%
+ \ifSB@insong\SB@errbro\SB@closeall\fi%
+ \ifSB@intersong\SB@errbrr\SB@closeall\fi%
+ \setbox\SB@chorusbox\box\voidb@x%
+ \SB@intersongtrue%
+ \def\SB@closeall{\end{intersong}}%
+ \setbox\SB@songbox\vbox\bgroup\begingroup%
+ \ifnum\SB@numcols>\z@\hsize\SB@colwidth\fi%
+ \ifdim\sbarheight>\z@%
+ \hrule\@height\sbarheight\@width\hsize%
+ \nobreak%
+ \fi%
+}{%
+ \ifSB@intersong
+ \ifdim\sbarheight>\z@%
+ \ifhmode\par\fi%
+ \SB@skip\lastskip%
+ \unskip\nobreak\vskip\SB@skip%
+ \hbox{\vrule\@height\sbarheight\@width\hsize}%
+ \fi%
+ \endgroup\egroup%
+ \ifSB@omitscrip%
+ \setbox\SB@songbox\box\voidb@x%
+ \else%
+ \SB@submitsong%
+ \fi%
+ \SB@intersongfalse%
+ \else%
+ \ifSB@insong\SB@errero\SB@closeall\else\SB@errert\fi%
+ \fi%
+}
+% \end{macrocode}
+% The starred form contributes page-spanning vertical material directly to
+% the top of the nearest fresh page.
+% \begin{macrocode}
+\newenvironment{intersong*}{%
+ \ifSB@insong\SB@errbro\SB@closeall\fi%
+ \ifSB@intersong\SB@errbrr\SB@closeall\fi%
+ \setbox\SB@chorusbox\box\voidb@x%
+ \SB@intersongtrue%
+ \def\SB@closeall{\end{intersong*}}%
+ \setbox\SB@songbox\vbox\bgroup\begingroup%
+}{%
+ \ifSB@intersong%
+ \endgroup\egroup%
+ \ifSB@omitscrip%
+ \setbox\SB@songbox\box\voidb@x%
+ \else%
+ \def\SB@stype{\SB@styppage}%
+ \SB@submitsong%
+ \def\SB@stype{\SB@stypcol}%
+ \fi%
+ \SB@intersongfalse%
+ \else%
+ \ifSB@insong\SB@errero\SB@closeall\else\SB@errert\fi%
+ \fi%
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{scripture}\MainEnvImpl{scripture}
+% \begin{macro}{\beginscripture}
+% Begin a scripture quotation.
+% We first store the reference in a box for later use, and then set up
+% a suitable environment for the quotation.
+% Quotations cannot typically be reworded if line-breaking fails,
+% so we set |\emergencystretch| to a relatively high value at the outset.
+% \begin{macrocode}
+\newenvironment{scripture}{\beginscripture}{\SB@endscripture}
+\newcommand\beginscripture[1]{%
+ \begin{intersong}%
+ \SB@parsesrefs{#1}%
+ \setbox\SB@envbox\hbox{{\printscrcite\songrefs}}%
+ \def\SB@closeall{\endscripture}%
+ \nobreak\vskip5\p@%
+ \SB@parindent\parindent\parindent\z@%
+ \parskip\z@skip\parfillskip\@flushglue%
+ \leftskip\SB@parindent\rightskip\SB@parindent\relax%
+ \scripturefont%
+ \baselineskip\f@size\p@\@plus\p@\relax%
+ \advance\baselineskip\p@\relax%
+ \emergencystretch.3em%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@endscripture}
+% End a scripture quotation.
+% \begin{macrocode}
+\newcommand\SB@endscripture{%
+ \ifSB@intersong
+ \scitehere%
+ \ifhmode\par\fi%
+ \vskip-3\p@%
+ \end{intersong}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+%
+% \begin{macro}{\scitehere}\MainImpl{scitehere}
+% \changes{v2.1}{2007/08/02}{Added}
+% Usually the scripture citation should just come at the |\endscripture|
+% line, but at times the user might want to invoke this macro explicitly
+% at a more suitable point.
+% A good example is when something near the end of the scripture quotation
+% drops \TeX{} into vertical mode.
+% In such cases, it is often better to issue the citation before leaving
+% horizontal mode.
+%
+% In any case, this macro should work decently whether in horizontal or
+% vertical mode.
+% In horizontal mode life is easy: we just append the reference to the
+% current horizontal list using the classic code from p.~106 of The \TeX book.
+% However, if we're now in vertical mode, the problem is a little harder.
+% We do the best we can by using |\lastbox| to remove the last line, then
+% adding the reference and re-typesetting it.
+% This isn't as good as the horizontal mode solution because \TeX{} only
+% gets to reevaluate the last line instead of the whole paragraph, but
+% usually the results are passable.
+% \begin{macrocode}
+\newcommand\scitehere{%
+ \ifSB@intersong%
+ \ifvoid\SB@envbox\else%
+ \ifvmode%
+ \setbox\SB@box\lastbox%
+ \nointerlineskip\noindent\hskip-\leftskip%
+ \unhbox\SB@box\unskip%
+ \fi%
+ \unskip\nobreak\hfil\penalty50\hskip.8em\null\nobreak\hfil%
+ \box\SB@envbox\kern-\SB@parindent%
+ {\parfillskip\z@\finalhyphendemerits2000\par}%
+ \fi%
+ \else%
+ \SB@errscrip\scitehere%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Acolon}\MainImpl{Acolon}
+% \begin{macro}{\Bcolon}\MainImpl{Bcolon}
+% \changes{v1.13}{2005/05/12}{Added}
+% Typeset a line of poetry in a scripture quotation.
+% \begin{macrocode}
+\newcommand\Acolon{\SB@colon2\Acolon}
+\newcommand\Bcolon{\SB@colon1\Bcolon}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@colon}
+% Begin a group of temporary definitions that will end at the next
+% \meta{return}.
+% The \meta{return} will end the paragraph and close the local scope.
+% \begin{macrocode}
+\newcommand\SB@colon[2]{%
+ \ifSB@intersong\else%
+ \SB@errscrip#2%
+ \beginscripture{Unknown}%
+ \fi%
+ \ifhmode\par\fi%
+ \begingroup%
+ \rightskip\SB@parindent\@plus4em%
+ \advance\leftskip2\SB@parindent%
+ \advance\parindent-#1\SB@parindent%
+ \def\par{\endgraf\endgroup}%
+ \obeylines%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\strophe}\MainImpl{strophe}
+% \changes{v1.13}{2005/05/12}{Added}
+% Insert blank space indicative of a strophe division in a scripture quotation.
+% \begin{macrocode}
+\newcommand\strophe{%
+ \ifSB@intersong\else%
+ \SB@errscrip\strophe\beginscripture{Unknown}%
+ \fi%
+ \vskip.9ex\@plus.45ex\@minus.68ex\relax%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\scripindent}\MainImpl{scripindent}
+% \begin{macro}{\scripoutdent}\MainImpl{scripoutdent}
+% \begin{macro}{\SB@scripdent}
+% \changes{v1.13}{2005/05/12}{Added}
+% Create an indented sub-block within a scripture quotation.
+% \begin{macrocode}
+\newcommand\SB@scripdent[2]{%
+ \ifSB@intersong\else%
+ \SB@errscrip#2\beginscripture{Unknown}%
+ \fi%
+ \ifhmode\par\fi%
+ \advance\leftskip#1\SB@parindent\relax%
+}
+\newcommand\scripindent{\SB@scripdent1\scripindent}
+\newcommand\scripoutdent{\SB@scripdent-\scripoutdent}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\shiftdblquotes}\MainImpl{shiftdblquotes}
+% \changes{v1.13}{2005/05/12}{Added}
+% \begin{macro}{\SB@ldqleft}
+% \begin{macro}{\SB@ldqright}
+% \begin{macro}{\SB@rdqleft}
+% \begin{macro}{\SB@rdqright}
+% \begin{macro}{\SB@scanlq}
+% \begin{macro}{\SB@scanrq}
+% \begin{macro}{\SB@dolq}
+% \begin{macro}{\SB@dorq}
+% The Zaph Chancery font used by default to typeset scripture quotations
+% seems to have some kerning problems with double-quote ligatures. The
+% |\shiftdblquotes| macro allows one to modify the spacing around all
+% double-quotes until the current group ends.
+% \begin{macrocode}
+\newcommand\SB@quotesactive{%
+ \catcode`'\active%
+ \catcode``\active%
+}
+\newcommand\shiftdblquotes[4]{}
+\newcommand\SB@ldqleft{}
+\newcommand\SB@ldqright{}
+\newcommand\SB@rdqleft{}
+\newcommand\SB@rdqright{}
+\newcommand\SB@scanlq{}
+\newcommand\SB@scanrq{}
+\newcommand\SB@dolq{}
+\newcommand\SB@dorq{}
+{
+ \SB@quotesactive
+ \gdef\shiftdblquotes#1#2#3#4{%
+ \def\SB@ldqleft{\kern#1}%
+ \def\SB@ldqright{\kern#2}%
+ \def\SB@rdqleft{\kern#3}%
+ \def\SB@rdqright{\kern#4}%
+ \SB@quotesactive%
+ \def`{\futurelet\SB@next\SB@scanlq}%
+ \def'{\futurelet\SB@next\SB@scanrq}%
+ }
+ \gdef\SB@scanlq{%
+ \ifx\SB@next`%
+ \expandafter\SB@dolq%
+ \else%
+ \expandafter\lq%
+ \fi%
+ }
+ \gdef\SB@scanrq{%
+ \ifx\SB@next'%
+ \expandafter\SB@dorq%
+ \else%
+ \expandafter\rq%
+ \fi%
+ }
+ \gdef\SB@dolq`{%
+ \ifvmode\leavevmode\else\/\fi%
+ \vadjust{}%
+ \SB@ldqleft\lq\lq\SB@ldqright%
+ \vadjust{}%
+ }
+ \gdef\SB@dorq'{%
+ \ifvmode\leavevmode\else\/\fi%
+ \vadjust{}%
+ \SB@rdqleft\rq\rq\SB@rdqright%
+ \vadjust{}%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Transposition}
+%
+% The macros that transpose chords are contained in this section.
+%
+% \begin{macro}{\SB@transposefactor}
+% This counter identifies the requested number of halfsteps by which chords are
+% to be transposed (from $-11$ to $+11$).
+% \begin{macrocode}
+\SB@newcount\SB@transposefactor
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@convertnotes}
+% Even when transposition is not requested, the transposition logic can be
+% used to automatically convert note names to another form.
+% The following conditional turns that feature on or off.
+% \begin{macrocode}
+\newif\ifSB@convertnotes
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notenameA}
+% \begin{macro}{\notenameB}
+% \begin{macro}{\notenameC}
+% \begin{macro}{\notenameD}
+% \begin{macro}{\notenameE}
+% \begin{macro}{\notenameF}
+% \begin{macro}{\notenameG}
+% Reserve a control sequence for each note of the diatonic scale.
+% These will be used to identify which token sequences the input file uses
+% to denote the seven scale degrees.
+% Their eventual definitions \emph{must} consist entirely of uppercase
+% letters, and they must be assigned using |\def|, but that comes later.
+% \begin{macrocode}
+\newcommand\notenameA{}
+\newcommand\notenameB{}
+\newcommand\notenameC{}
+\newcommand\notenameD{}
+\newcommand\notenameE{}
+\newcommand\notenameF{}
+\newcommand\notenameG{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\printnoteA}
+% \begin{macro}{\printnoteB}
+% \begin{macro}{\printnoteC}
+% \begin{macro}{\printnoteD}
+% \begin{macro}{\printnoteE}
+% \begin{macro}{\printnoteF}
+% \begin{macro}{\printnoteG}
+% These control sequences are what the transposition logic actually
+% outputs to denote each scale degree.
+% They can include any \LaTeX{} code that is legal in horizontal mode.
+% \begin{macrocode}
+\newcommand\printnoteA{}
+\newcommand\printnoteB{}
+\newcommand\printnoteC{}
+\newcommand\printnoteD{}
+\newcommand\printnoteE{}
+\newcommand\printnoteF{}
+\newcommand\printnoteG{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\notenamesin}\MainImpl{notenamesin}
+% Set the note names used by the input file.
+% \begin{macrocode}
+\newcommand\notenamesin[7]{%
+ \def\notenameA{#1}%
+ \def\notenameB{#2}%
+ \def\notenameC{#3}%
+ \def\notenameD{#4}%
+ \def\notenameE{#5}%
+ \def\notenameF{#6}%
+ \def\notenameG{#7}%
+ \SB@convertnotestrue%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notenamesout}\MainImpl{notenamesout}
+% Set the note names that are output by the transposition logic.
+% \begin{macrocode}
+\newcommand\notenamesout[7]{%
+ \def\printnoteA{#1}%
+ \def\printnoteB{#2}%
+ \def\printnoteC{#3}%
+ \def\printnoteD{#4}%
+ \def\printnoteE{#5}%
+ \def\printnoteF{#6}%
+ \def\printnoteG{#7}%
+ \SB@convertnotestrue%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notenames}\MainImpl{notenames}
+% Set an identical input name and output name for each scale degree.
+% \begin{macrocode}
+\newcommand\notenames[7]{%
+ \notenamesin{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
+ \notenamesout{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
+ \SB@convertnotesfalse%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\alphascale}\MainImpl{alphascale}
+% \begin{macro}{\solfedge}\MainImpl{solfedge}
+% Predefine scales for alphabetic names and solfedge names, and
+% set alphabetic scales to be the default.
+% \begin{macrocode}
+\newcommand\alphascale{\notenames ABCDEFG}
+\newcommand\solfedge{\notenames{LA}{SI}{DO}{RE}{MI}{FA}{SOL}}
+\alphascale
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@prefshrps}
+% When a transposed chord falls on a black key, the code must choose which
+% enharmonically equivalent name to give the new chord.
+% (For example, should C transposed by +1 be named C$\#$ or D$\flat$?)
+% A heuristic is used to guess which name is most appropriate.
+% The following conditional records whether the current key signature is
+% sharped or flatted according to this heuristic guess.
+% \begin{macrocode}
+\newif\ifSB@prefshrps
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@needkey}
+% The first chord seen is usually the best indicator of the key of the song.
+% (Even when the first chord isn't the tonic, it will often be the dominant
+% or subdominant, which usually has the same kind of accidental in its key
+% signatures as the actual key.) This conditional remembers whether the current
+% chord is the first one seen in the song, and should therefore be used to
+% guess the key of the song.
+% \begin{macrocode}
+\newif\ifSB@needkey
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\transpose}\MainImpl{transpose}
+% The |\transpose| macro sets the transposition adjustment factor and
+% informs the transposition logic that the next chord seen will be the first
+% one in the new key.
+% \begin{macrocode}
+\newcommand\transpose[1]{%
+ \advance\SB@transposefactor by#1\relax%
+ \SB@cnt\SB@transposefactor%
+ \divide\SB@cnt12 %
+ \multiply\SB@cnt12 %
+ \advance\SB@transposefactor-\SB@cnt%
+ \SB@needkeytrue%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\capo}\MainImpl{capo}
+% Specifying a |\capo| normally just causes a textual note to musicians to be
+% typeset, but if the |transposecapos| option is active, it activates
+% transposition of the chords.
+% \begin{macrocode}
+\newcommand\capo[1]{%
+ \iftranscapos\transpose{#1}\else\musicnote{capo #1}\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\prefersharps}\MainImpl{prefersharps}
+% \begin{macro}{\preferflats}\MainImpl{preferflats}
+% One of these macros is called after the first chord has been seen to
+% register that we're transposing to a key with a sharped or flatted key
+% signature.
+% \begin{macrocode}
+\newcommand\prefersharps{\SB@prefshrpstrue\SB@needkeyfalse}
+\newcommand\preferflats{\SB@prefshrpsfalse\SB@needkeyfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\transposehere}\MainImpl{transposehere}
+% If automatic transposition has been requested, yield the given chord
+% transposed by the requested amount.
+% Otherwise return the given chord verbatim.
+% \begin{macrocode}
+\newcommand\transposehere[1]{%
+ \ifnum\SB@transposefactor=\z@%
+ \ifSB@convertnotes%
+ \SB@dotranspose{#1}%
+ \the\SB@toks%
+ \else%
+ #1%
+ \fi%
+ \else%
+ \ifSB@convertnotes%
+ {\SB@transposefactor\z@%
+ \SB@dotranspose{#1}%
+ \xdef\SB@tempv{\the\SB@toks}}%
+ \else%
+ \def\SB@tempv{#1}%
+ \fi%
+ \SB@dotranspose{#1}%
+ \expandafter\trchordformat\expandafter{\SB@tempv}{\the\SB@toks}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notrans}\MainImpl{notrans}
+% Suppress chord transposition without suppressing note name conversion.
+% When a |\notrans{|\meta{text}|}| macro appears within text undergoing
+% transposition, the |\notrans| macro and the group will be preserved
+% verbatim by the transposition parser.
+% When it is then expanded after parsing, we must therefore re-invoke
+% the transposition logic on the argument, but in an environment where
+% the transposition factor has been temporarily set to zero.
+% This causes note name conversion to occur without actually transposing.
+% \begin{macrocode}
+\newcommand\notrans[1]{%
+ \begingroup%
+ \SB@transposefactor\z@%
+ \transposehere{#1}%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@dotranspose}
+% Parse the argument to a chord macro, yielding the transposed equivalent in
+% the |\SB@toks| token register.
+% \begin{macrocode}
+\newcommand\SB@dotranspose[1]{%
+ \SB@toks{}%
+ \let\SB@dothis\SB@trmain%
+ \SB@trscan#1\SB@trend%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\trchordformat}\MainImpl{trchordformat}
+% By default, transposing means replacing old chords with new chords in the
+% new key. However, sometimes the user may want to typeset something more
+% sophisticated, like old chords followed by new chords in parentheses so
+% that musicians who use capos and those who don't can play from the same
+% piece of music. Such typesetting is possible by redefining the following
+% macro to something like |#1 (#2)| instead of |#2|.
+% \begin{macrocode}
+\newcommand\trchordformat[2]{#2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trscan}
+% This is the entrypoint to the code that scans over the list of tokens
+% comprising a chord and transposes note names as it goes.
+% Start by peeking ahead at the next symbol without consuming it.
+% \begin{macrocode}
+\newcommand\SB@trscan{\futurelet\SB@next\SB@dothis}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trmain}
+% Test to see whether the token was a begin-brace, end-brace, or space.
+% These tokens require special treatment because they cannot be
+% accepted as implicit arguments to macros.
+% \begin{macrocode}
+\newcommand\SB@trmain{%
+ \ifx\SB@next\bgroup%
+ \let\SB@donext\SB@trgroup%
+ \else\ifx\SB@next\egroup%
+ \SB@toks\expandafter{\the\SB@toks\egroup}%
+ \let\SB@donext\SB@trskip%
+ \else\ifcat\noexpand\SB@next\@sptoken%
+ \SB@appendsp\SB@toks%
+ \let\SB@donext\SB@trskip%
+ \else%
+ \let\SB@donext\SB@trstep%
+ \fi\fi\fi%
+ \SB@donext%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trgroup}
+% A begin-group brace lies next in the input stream.
+% Consume the entire group as an argument to this macro, and append it,
+% including the begin- and end-group tokens, to the list of tokens processed
+% so far.
+% No transposition takes place within a group; they are copied verbatim
+% because they probably contain macro code.
+% \begin{macrocode}
+\newcommand\SB@trgroup[1]{%
+ \SB@toks\expandafter{\the\SB@toks{#1}}%
+ \SB@trscan%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trspace}
+% A space or end-brace lies next in the input stream.
+% It has already been added to the token list, so skip over it.
+% \begin{macrocode}
+\newcommand\SB@trskip{%
+ \afterassignment\SB@trscan%
+ \let\SB@next= }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trstep}
+% A non-grouping token lies next in the input stream.
+% Consume it as an argument to this macro, and then test it to see whether
+% it's a note letter or some other recognized item.
+% If so, process it; otherwise just append it to the token list and continue
+% scanning.
+% \begin{macrocode}
+\newcommand\SB@trstep[1]{%
+ \let\SB@donext\SB@trscan%
+ \ifcat\noexpand\SB@next A%
+ \ifnum\uccode`#1=`#1%
+ \def\SB@temp{#1}%
+ \let\SB@dothis\SB@trnote%
+ \else%
+ \SB@toks\expandafter{\the\SB@toks#1}%
+ \fi%
+ \else\ifx\SB@next\SB@trend
+ \let\SB@donext\relax%
+ \else%
+ \SB@toks\expandafter{\the\SB@toks#1}%
+ \fi\fi%
+ \SB@donext%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trnote}
+% We're in the midst of processing a sequence of uppercase letters that
+% might comprise a note name.
+% Check to see whether the next token is an accidental (sharp or flat),
+% or yet another letter.
+% \begin{macrocode}
+\newcommand\SB@trnote{%
+ \ifcat\noexpand\SB@next A%
+ \let\SB@donext\SB@trnotestep%
+ \else\ifnum\SB@transposefactor=\z@%
+ \SB@cnt\z@%
+ \let\SB@donext\SB@trtrans%
+ \else\ifx\SB@next\flt%
+ \SB@cnt\m@ne%
+ \let\SB@donext\SB@tracc%
+ \else\ifx\SB@next\shrp%
+ \SB@cnt\@ne%
+ \let\SB@donext\SB@tracc%
+ \else%
+ \SB@cnt\z@%
+ \let\SB@donext\SB@trtrans%
+ \fi\fi\fi\fi%
+ \SB@donext%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trnotestep}
+% The next token is a letter.
+% Consume it and test to see whether it is an uppercase letter.
+% If so, add it to the note name being assembled; otherwise reinsert it into
+% the input stream and jump directly to the transposition logic.
+% \begin{macrocode}
+\newcommand\SB@trnotestep[1]{%
+ \ifnum\uccode`#1=`#1%
+ \expandafter\def\expandafter\SB@temp\expandafter{\SB@temp#1}%
+ \expandafter\SB@trscan%
+ \else%
+ \SB@cnt\z@%
+ \expandafter\SB@trtrans\expandafter#1%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@tracc}
+% We've encountered an accidental (sharp or flat) immediately following a
+% note name.
+% Peek ahead at the next token without consuming it, and then jump to the
+% transposition logic.
+% This is done because the transposition logic might need to infer the key
+% signature of the song, and if the next token is an m (for minor), then
+% that information can help.
+% \begin{macrocode}
+\newcommand\SB@tracc[1]{\futurelet\SB@next\SB@trtrans}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trtrans}
+% We've assembled a sequence of capital letters (in |\SB@temp|) that might
+% comprise a note name to be transposed.
+% If the letters were followed by a |\shrp| then |\SB@cnt| is 1; if they were
+% followed by a |\flt| then it is $-1$; otherwise it is 0.
+% If the assembled letters turn out to not match any valid note name, then
+% do nothing and return to scanning.
+% Otherwise compute a new transposed name.
+% \begin{macrocode}
+\newcommand\SB@trtrans{%
+ \advance\SB@cnt%
+ \ifx\SB@temp\notenameA\z@%
+ \else\ifx\SB@temp\notenameB\tw@%
+ \else\ifx\SB@temp\notenameC\thr@@%
+ \else\ifx\SB@temp\notenameD5 %
+ \else\ifx\SB@temp\notenameE7 %
+ \else\ifx\SB@temp\notenameF8 %
+ \else\ifx\SB@temp\notenameG10 %
+ \else-99 \fi\fi\fi\fi\fi\fi\fi%
+ \ifnum\SB@cnt<\m@ne%
+ \SB@toks\expandafter\expandafter\expandafter{%
+ \expandafter\the\expandafter\SB@toks\SB@temp}%
+ \else%
+ \advance\SB@cnt\SB@transposefactor%
+ \ifnum\SB@cnt<\z@\advance\SB@cnt12 \fi%
+ \ifnum\SB@cnt>11 \advance\SB@cnt-12 \fi%
+ \ifSB@needkey\ifnum\SB@transposefactor=\z@\else\SB@setkeysig\fi\fi%
+ \edef\SB@temp{%
+ \the\SB@toks%
+ \ifSB@prefshrps%
+ \ifcase\SB@cnt\printnoteA\or\printnoteA\noexpand\shrp\or%
+ \printnoteB\or\printnoteC\or\printnoteC\noexpand\shrp\or%
+ \printnoteD\or\printnoteD\noexpand\shrp\or\printnoteE\or%
+ \printnoteF\or\printnoteF\noexpand\shrp\or\printnoteG\or%
+ \printnoteG\noexpand\shrp\fi%
+ \else%
+ \ifcase\SB@cnt\printnoteA\or\printnoteB\noexpand\flt\or%
+ \printnoteB\or\printnoteC\or\printnoteD\noexpand\flt\or%
+ \printnoteD\or\printnoteE\noexpand\flt\or\printnoteE\or%
+ \printnoteF\or\printnoteG\noexpand\flt\or\printnoteG\or%
+ \printnoteA\noexpand\flt\fi%
+ \fi}%
+ \SB@toks\expandafter{\SB@temp}%
+ \fi%
+ \let\SB@dothis\SB@trmain%
+ \SB@trscan%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@setkeysig}
+% If this is the first chord of the song, assume that this is the tonic of the
+% key, and select whether to use a sharped or flatted key signature for the
+% rest of the song based on that.
+% Even if this isn't the tonic, it's probably the dominant or sub-dominant,
+% which almost always has a number of sharps or flats similar to the tonic.
+% If the bottom note of the chord turns out to be a black key, we choose the
+% enharmonic equivalent that is closest to C on the circle of fifths
+% (i.e., the one that has fewest sharps or flats).
+% \begin{macrocode}
+\newcommand\SB@setkeysig{%
+ \global\SB@needkeyfalse%
+ \ifcase\SB@cnt%
+ \global\SB@prefshrpstrue\or% A
+ \global\SB@prefshrpsfalse\or% Bb
+ \global\SB@prefshrpstrue\or% B
+ \ifx\SB@next m% C
+ \global\SB@prefshrpsfalse%
+ \else%
+ \global\SB@prefshrpstrue%
+ \fi\or%
+ \global\SB@prefshrpstrue\or% C#
+ \ifx\SB@next m% D
+ \global\SB@prefshrpsfalse%
+ \else%
+ \global\SB@prefshrpstrue%
+ \fi\or%
+ \global\SB@prefshrpsfalse\or% Eb
+ \global\SB@prefshrpstrue\or% E
+ \global\SB@prefshrpsfalse\or% F
+ \global\SB@prefshrpstrue\or% F#
+ \ifx\SB@next m% G
+ \global\SB@prefshrpsfalse%
+ \else%
+ \global\SB@prefshrpstrue%
+ \fi\or%
+ \global\SB@prefshrpsfalse\else% Ab
+ \global\SB@needkeytrue% non-chord
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@trend}
+% The following macro marks the end of chord text to be processed.
+% It should always be consumed and discarded by the chord-scanning
+% logic above, so generate an error if it is ever expanded.
+% \begin{macrocode}
+\newcommand\SB@trend{%
+ \SB@Error{Internal Error: Transposition failed}%
+ {This error should not occur.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Measure Bars}
+%
+% The following code handles the typesetting of measure bars.
+%
+% \begin{macro}{\SB@metertop}
+% \begin{macro}{\SB@meterbot}
+% These macros remember the current numerator and denominator of the meter.
+% \begin{macrocode}
+\newcommand\SB@metertop{}
+\newcommand\SB@meterbot{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\meter}\MainImpl{meter}
+% Set the current meter without producing an actual measure bar yet.
+% \begin{macrocode}
+\newcommand\meter[2]{\gdef\SB@metertop{#1}\gdef\SB@meterbot{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@measuremark}
+% Normally measure bar boxes should be as thin as possible so that they can be
+% slipped into lyrics without making them hard to read. But when two measure
+% bars appear consecutively, they need to be spaced apart more so that they
+% look like two separate lines instead of one thick line. To achieve this,
+% there needs to be a way to pull a vbox off the current list and determine
+% whether or not it is a box that contains a measure bar. The solution is to
+% insert a mark (|\SB@measuremark|) at the top of each measure bar vbox.
+% We can then see whether this measure bar immediately follows another measure
+% bar by using |\vsplit| on |\lastbox|.
+% \begin{macrocode}
+\newcommand\SB@measuremark{SB@IsMeasure}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@makembar}\MainImpl{mbar}
+% Typeset a measure bar. If provided, \argp{1} is the numerator and \argp{2} is
+% the denominator of the meter to be rendered above the bar. If those arguments
+% are left blank, render a measure bar without a meter marking.
+% \begin{macrocode}
+\newcommand\SB@makembar[2]{%
+ \ifSB@inverse\else%
+ \ifSB@inchorus\else\SB@errmbar\fi%
+ \fi%
+ \ifhmode%
+ \SB@skip\lastskip\unskip%
+ \setbox\SB@box\lastbox%
+ \copy\SB@box%
+ \ifvbox\SB@box%
+ \begingroup%
+ \setbox\SB@boxii\copy\SB@box%
+ \vbadness\@M\vfuzz\maxdimen%
+ \setbox\SB@boxii%
+ \vsplit\SB@boxii to\maxdimen%
+ \endgroup%
+ \long\edef\SB@temp{\splitfirstmark}%
+ \ifx\SB@temp\SB@measuremark%
+ \penalty100\hskip1em%
+ \else%
+ \penalty100\hskip\SB@skip%
+ \fi%
+ \else%
+ \penalty100\hskip\SB@skip%
+ \fi%
+ \fi%
+ \ifvmode\leavevmode\fi%
+ \setbox\SB@box\hbox{\tiny\sffamily{#1}}%
+ \setbox\SB@boxii\hbox{\tiny\sffamily{#2}}%
+ \ifdim\wd\SB@box>\wd\SB@boxii%
+ \SB@dimen\wd\SB@box\relax%
+ \else%
+ \SB@dimen\wd\SB@boxii\relax%
+ \fi%
+ \ifdim\SB@dimen<.5\p@%
+ \SB@dimen.5\p@%
+ \fi%
+ \SB@dimenii\baselineskip%
+ \advance\SB@dimenii-2\p@%
+ \advance\SB@dimenii-\ht\SB@box%
+ \advance\SB@dimenii-\dp\SB@box%
+ \advance\SB@dimenii-\ht\SB@boxii%
+ \advance\SB@dimenii-\dp\SB@boxii%
+ \vbox{%
+ \mark{\SB@measuremark}%
+ \hbox to\SB@dimen{%
+ \hfil%
+ \box\SB@box%
+ \hfil%
+ }%
+ \nointerlineskip%
+ \hbox to\SB@dimen{%
+ \hfil%
+ \box\SB@boxii%
+ \hfil%
+ }%
+ \nointerlineskip%
+ \hbox to\SB@dimen{%
+ \hfil%
+ \vrule\@width.5\p@\@height\SB@dimenii%
+ \hfil%
+ }%
+ }%
+ \meter{}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mbar}
+% The |\mbar| macro invokes |\SB@mbar|, which gets redefined by macros and
+% options that turn measure bars on and off.
+% \begin{macrocode}
+\newcommand\mbar{\SB@mbar}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\measurebar}\MainImpl{measurebar}
+% Make a measure bar using the most recently defined meter.
+% Then set the meter to nothing so that the next measure bar will not
+% display any meter unless the meter changes.
+% \begin{macrocode}
+\newcommand\measurebar{%
+ \mbar\SB@metertop\SB@meterbot%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@repcolon}
+% Create the colon that preceeds or follows a repeat sign.
+% \begin{macrocode}
+\newcommand\SB@repcolon{{%
+ \usefont{OT1}{cmss}{m}{n}\selectfont%
+ \ifchorded%
+ \baselineskip.5\SB@dimen%
+ \vbox{\hbox{:}\hbox{:}\kern.5\p@}%
+ \else%
+ \raise.5\p@\hbox{:}%
+ \fi%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lrep}\MainImpl{lrep}
+% Create a begin-repeat sign.
+% \begin{macrocode}
+\newcommand\lrep{%
+ \SB@dimen\baselineskip%
+ \advance\SB@dimen-2\p@%
+ \vrule\@width1.5\p@\@height\SB@dimen\@depth\p@%
+ \kern1.5\p@%
+ \vrule\@width.5\p@\@height\SB@dimen\@depth\p@%
+ \SB@repcolon%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rrep}\MainImpl{rrep}
+% Create an end-repeat sign.
+% \begin{macrocode}
+\newcommand\rrep{%
+ \SB@dimen\baselineskip%
+ \advance\SB@dimen-2\p@%
+ \SB@repcolon%
+ \vrule\@width.5\p@\@height\SB@dimen\@depth\p@%
+ \kern1.5\p@%
+ \vrule\@width1.5\p@\@height\SB@dimen\@depth\p@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Lyric Scanning}\label{sec:lyricscan}
+%
+% The obvious way to create a chord macro is as a normal macro with
+% two arguments, one for the chord name and one for the lyrics to go
+% under the chord---e.g.~|\chord{|\meta{chordname}|{|\meta{lyric}|}|.
+% However, in practice such a macro is extremely cumbersome and
+% difficult to use.
+% The problem is that in order to use such a macro properly, the user
+% must remember a bunch of complex style rules that govern what
+% part of the lyric text needs to go in the \meta{lyric} parameter and
+% what part should be typed after the closing brace.
+% To avoid separating a word from its trailing punctuation, the
+% \meta{lyric} parameter must often include punctuation but not certain
+% special punctuation like hyphens, should include the rest of the
+% word but not if there's another chord in the word, should omit
+% measure bars but only if measure bars are being shown, etc.
+% This is way too difficult for the average user.
+%
+% To avoid this problem, we define chords using a one-argument macro
+% (the argument is the chord name), but with no explicit argument for
+% the lyric part.
+% Instead, the macro scans ahead in the input stream, automatically
+% determining what portion of the lyric text that follows should be
+% sucked in as an implicit second argument.
+% The following code does this look-ahead scanning.
+%
+% \begin{macro}{\ifSB@wordends}
+% \begin{macro}{\ifSB@brokenword}
+% Chord macros must look ahead in the input stream to see whether this chord
+% is immediately followed by whitespace or the remainder of a word.
+% If the latter, hyphenation might need to be introduced.
+% These macros keep track of the need for hyphenation, if any.
+% \begin{macrocode}
+\newif\ifSB@wordends
+\newif\ifSB@brokenword
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@lyric}
+% Lyrics appearing after a chord are scanned into the following token list
+% register.
+% \begin{macrocode}
+\SB@newtoks\SB@lyric
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@numhyps}
+% Hyphens appearing in lyrics require special treatment.
+% The following counter counts the number of explicit hyphens ending
+% the lyric syllable that follows the current chord.
+% \begin{macrocode}
+\SB@newcount\SB@numhyps
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@lyricnohyp}
+% When a lyric syllable under a chord ends in exactly one hyphen, the
+% following token register is set to be the syllable without the hyphen.
+% \begin{macrocode}
+\SB@newtoks\SB@lyricnohyp
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@lyricbox}
+% \begin{macro}{\SB@chordbox}
+% The following two boxes hold the part of the lyric text that is to be
+% typeset under the chord, and the chord text that is to be typeset above.
+% \begin{macrocode}
+\SB@newbox\SB@lyricbox
+\SB@newbox\SB@chordbox
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chbstok}
+% \changes{v1.22}{2007/05/15}{Added.}
+% When |\MultiwordChords| is active, the following reserved control
+% sequence remembers the first (space) token not yet included into the
+% |\SB@lyricbox| box.
+% \begin{macrocode}
+\newcommand\SB@chbstok{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@setchord}
+% \changes{v2.3}{2007/09/23}{Support replayed chords over ligatures}
+% \changes{v2.7}{2009/01/08}{Extend rather than replace chordbox}
+% The following macro typesets its argument as a chord and stores the
+% result in box |\SB@chordbox| for later placement into the document.
+% The hat token (|^|) is redefined so that outside of math mode it
+% suppresses chord memorization, but inside of math mode it retains
+% its usual superscript meaning.
+% If memorization is active, the chord's token sequence is stored in
+% the current replay register.
+% If |\SB@chordbox| is non-empty, the new chord is appended to it
+% rather than replacing it.
+% This allows consecutive chords not separated by whitespace to be
+% typeset as a single chord sequence atop a common lyric.
+% \begin{macrocode}
+\newcommand\SB@setchord{}
+{
+ \catcode`^\active
+ \catcode`!7
+ \gdef\SB@setchord#1{%
+ \SB@gettabindtrue\SB@nohattrue%
+ \setbox\SB@chordbox\hbox{%
+ \unhbox\SB@chordbox%
+ \begingroup%
+ \ifSB@trackch%
+ \def\SB@activehat{\ifmmode!\else\global\SB@nohatfalse\fi}%
+ \else%
+ \def\SB@activehat{%
+ \ifmmode!\else\SB@lop\SB@ctail\SB@toks\the\SB@toks\fi%
+ }%
+ \fi%
+ \let^\SB@activehat%
+ \printchord{%
+ \ifSB@firstchord\else\kern.15em\fi%
+ \vphantom/%
+ \transposehere{#1}%
+ \kern.2em%
+ }%
+ \endgroup%
+ }%
+ \SB@gettabindfalse%
+ \ifSB@trackch\ifSB@nohat%
+ \global\SB@creg\expandafter{\the\SB@creg#1\\}%
+ \fi\fi%
+ \let\SB@noreplay\@firstofone%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@outertest}
+% \begin{macro}{\SB@otesta}
+% \begin{macro}{\SB@otestb}
+% The lyric-scanning code must preemptively determine whether the next token
+% is a macro declared |\outer| before it tries to accept that token as an
+% argument.
+% Otherwise \TeX{} will abort with a parsing error.
+% Macros declared |\outer| are not allowed in arguments, so determining
+% whether a token is |\outer| is a delicate process.
+% The following does so by consulting |\meaning|.
+% A macro can be identified as |\outer| if its meaning has the
+% word ``|\outer|'' before the first colon.
+% \begin{macrocode}
+\newcommand\SB@outertest{%
+ \expandafter\SB@otesta\meaning\SB@next:\SB@otesta%
+}
+\newcommand\SB@otesta{}
+\edef\SB@otesta#1:#2\SB@otesta{%
+ \noexpand\SB@otestb%
+ #1\string\outer%
+ \noexpand\SB@otestb%
+}
+\newcommand\SB@otestb{}
+\expandafter\def\expandafter\SB@otestb%
+\expandafter#\expandafter1\string\outer#2\SB@otestb{%
+ \def\SB@temp{#2}%
+ \ifx\SB@temp\@empty\SB@testfalse\else\SB@testtrue\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@UTFtest}
+% \begin{macro}{\SB@U@two}
+% \begin{macro}{\SB@U@three}
+% \begin{macro}{\SB@U@four}
+% \begin{macro}{\SB@@UTFtest}
+% \changes{v1.22}{2007/05/15}{Added.}
+% To support UTF-8 encoded \LaTeX{} source files, we need to be able to
+% identify multibyte characters during the lyric scanning process.
+% Alas, the |utf8.def| file provides no clean way of identifying the
+% macros it defines for this purpose.
+% The best solution seems to be to look for any token named
+% |\UTFviii@|$\ldots$|@octets| in the top-level expansion of the macro.
+% \begin{macrocode}
+\newcommand\SB@UTFtest{}
+\edef\SB@UTFtest#1{%
+ \noexpand\expandafter%
+ \noexpand\SB@@UTFtest%
+ \noexpand\meaning#1%
+ \string\UTFviii@zero@octets%
+ \noexpand\SB@@UTFtest%
+}
+\newcommand\SB@U@two{\global\SB@cnt\tw@}
+\newcommand\SB@U@three{\global\SB@cnt\thr@@}
+\newcommand\SB@U@four{\global\SB@cnt4\relax}
+\newcommand\SB@@UTFtest{}
+{\escapechar\m@ne
+ \xdef\SB@temp{\string\@octets}}
+\edef\SB@temp{##1\string\UTFviii@##2\SB@temp}
+\expandafter\def\expandafter\SB@@UTFtest\SB@temp#3\SB@@UTFtest{%
+ \SB@cnt\z@%
+ {\csname SB@U@#2\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\DeclareLyricChar}\MainImpl{DeclareLyricChar}
+% \begin{macro}{\DeclareNonLyric}\MainImpl{DeclareNonLyric}
+% \begin{macro}{\DeclareNoHyphen}\MainImpl{DeclareNoHyphen}
+% \begin{macro}{\SB@declare}
+% \changes{v1.22}{2007/05/15}{Added \cs{DeclareLyricChar}.}
+% \changes{v2.1}{2007/08/02}{Added \cs{DeclareNonLyric} and \cs{DeclareNoHyphen}.}
+% \changes{v2.6}{2008/03/27}{Macro tests made name-based instead of def-based}
+% When scanning the lyric text that follows a chord, it is necessary to
+% distinguish accents and other intra-word macros (which should be included
+% in the under-chord lyric text) from other macros (which should be pushed
+% out away from the text).
+% The following macros allow users to declare a token to be lyric-continuing
+% or lyric-ending.
+% \begin{macrocode}
+\newcommand\SB@declare[3]{%
+ \afterassignment\iffalse\let\SB@next= #3\relax\fi%
+ \SB@UTFtest\SB@next%
+ \ifcase\SB@cnt%
+ \ifcat\noexpand#3\relax%
+ \SB@addNtest\SB@macrotests#1#2#3%
+ \else\ifcat\noexpand#3.%
+ \SB@addDtest\SB@othertests#1#2%
+ \else\ifcat\noexpand#3A%
+ \SB@addDtest\SB@lettertests#1#2%
+ \else%
+ \SB@addDtest\relax0#2%
+ \fi\fi\fi%
+ \or%
+ \SB@addNtest\SB@macrotests#1#2#3%
+ \else%
+ \SB@addMtest\SB@multitests#1#2#3\relax\relax\relax%
+ \fi%
+}
+\newcommand\DeclareLyricChar{\SB@declare\SB@testtrue0}
+\newcommand\DeclareNonLyric{%
+ \SB@declare\SB@testfalse\SB@testfalse%
+}
+\newcommand\DeclareNoHyphen{%
+ \SB@declare\SB@testfalse\SB@testtrue%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@lettertests}
+% \begin{macro}{\SB@macrotests}
+% \begin{macro}{\SB@multitests}
+% \begin{macro}{\SB@othertests}
+% For speed, token tests introduced by |\DeclareLyricChar| and friends
+% are broken out into separate macros based on category codes.
+% \begin{macrocode}
+\newcommand\SB@lettertests{}
+\newcommand\SB@macrotests{}
+\newcommand\SB@multitests{}
+\newcommand\SB@othertests{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The following macros add tests to the test macros defined above.
+% In each, \argp{1} is the test macro to which the test should be added,
+% \argp{2} and \argp{3} is the code to be executed at scanning-time and
+% at hyphenation-time if the test succeeds (or ``0'' if no action is to
+% be performed), and \argp{4} is the token to which the currently scanned
+% token should be compared to determine whether it matches.
+%
+% \begin{macro}{\SB@addDtest}
+% A definition-test: The test succeeds if the next lyric token has the same
+% meaning (at test-time) of the non-macro, non-active character token that
+% was given to the |\Declare| macro.
+% \begin{macrocode}
+\newcommand\SB@addDtest[3]{%
+ \ifx0#2\else%
+ \def#1{{\csname SB@!\meaning\SB@next\endcsname}}%
+ \expandafter\def\csname SB@!\meaning\SB@next\endcsname{\global#2}%
+ \fi%
+ \ifx0#3\else%
+ \expandafter\def\csname SB@HT@\meaning\SB@next\endcsname{\global#3}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@addNtest}
+% A name-test: The test succeeds if the next token is a non-|\outer|
+% macro or active character and its |\string|ified name matches the
+% |\string|ified name of the control sequence that was given to the
+% |\Declare| macro.
+% \begin{macrocode}
+\newcommand\SB@addNtest[4]{%
+ \ifx0#2\else%
+ \def#1{{\csname SB@!\SB@nextname\endcsname}}%
+ \expandafter\def\csname SB@!\string#4\endcsname{\global#2}%
+ \fi%
+ \ifx0#3\else%
+ \expandafter\def\csname SB@HT@\string#4\endcsname{\global#3}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@addMtest}
+% A multibyte-test: The test succeeds if the next lyric token is the
+% beginning of a UTF-8 encoded multibyte character sequence that matches
+% the multibyte sequence given to the |\Declare| macro.
+% \begin{macrocode}
+\newcommand\SB@addMtest[7]{%
+ \edef\SB@temp{%
+ \string#4%
+ \ifx\relax#5\else\string#5\fi%
+ \ifx\relax#6\else\string#6\fi%
+ \ifx\relax#7\else\string#7\fi%
+ }%
+ \ifx0#2\else%
+ \def#1{{\csname SB@!\SB@nextname\endcsname}}%
+ \expandafter\def\csname SB@!\SB@temp\endcsname{\global#2}%
+ \fi%
+ \ifx0#3\else%
+ \expandafter\def\csname SB@HT@\SB@temp\endcsname{\global#3}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following code declares the common intra-word macros provided by
+% \TeX{} (as listed on p.~52 of The \TeX book) to be lyric-continuing.
+% \begin{macrocode}
+\DeclareLyricChar\`
+\DeclareLyricChar\'
+\DeclareLyricChar\^
+\DeclareLyricChar\"
+\DeclareLyricChar\~
+\DeclareLyricChar\=
+\DeclareLyricChar\.
+\DeclareLyricChar\u
+\DeclareLyricChar\v
+\DeclareLyricChar\H
+\DeclareLyricChar\t
+\DeclareLyricChar\c
+\DeclareLyricChar\d
+\DeclareLyricChar\b
+\DeclareLyricChar\oe
+\DeclareLyricChar\OE
+\DeclareLyricChar\ae
+\DeclareLyricChar\AE
+\DeclareLyricChar\aa
+\DeclareLyricChar\AA
+\DeclareLyricChar\o
+\DeclareLyricChar\O
+\DeclareLyricChar\l
+\DeclareLyricChar\L
+\DeclareLyricChar\ss
+\DeclareLyricChar\i
+\DeclareLyricChar\j
+\DeclareLyricChar\/
+\DeclareLyricChar\-
+\DeclareLyricChar\discretionary
+% \end{macrocode}
+%
+% We declare |\par| to be lyric-ending without introducing hyphenation.
+% The |\par| macro doesn't actually appear in most verses because we use
+% |\obeylines|, but we include a check for it in case the user says |\par|
+% explicitly somewhere.
+% \begin{macrocode}
+\DeclareNoHyphen\par
+% \end{macrocode}
+%
+% \begin{macro}{\SB@bracket}
+% This macro gets invoked by the |\[|\eat\] macro whenever a chord begins.
+% It gets redefined by code that turns chords on and off, so its initial
+% definition doesn't matter.
+% \begin{macrocode}
+\newcommand\SB@bracket{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chord}
+% Begin parsing a chord macro.
+% While parsing the chord name argument, we set some special catcodes so
+% that chord names can use |#| and |&| for sharps and flats.
+% \begin{macrocode}
+\newcommand\SB@chord{\SB@begincname\SB@@chord}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@begincname}
+% \begin{macro}{\SB@endcname}
+% While parsing a chord name, certain characters such as |#| and |&| are
+% temporarily set active so that they can be used as abbreviations for
+% sharps and flats.
+% To accomplish this, |\SB@begincname| must always be invoked before any
+% macro whose argument is a chord name, and |\SB@endcname| must be invoked
+% at the start of the body of any macro whose argument is a chord name.
+% To aid in debugging, we also temporarily set \meta{return} characters and
+% chord macros |\outer|.
+% This will cause \TeX{} to halt with a runaway argument error on the correct
+% source line if the user forgets to type a closing end-brace (a common typo).
+% Colon characters are also set non-active to avoid a conflict between the
+% \textsf{Babel} French package and the |\gtab| macro.
+% \begin{macrocode}
+\newcommand\SB@begincname{}
+{\catcode`\^^M\active
+ \gdef\SB@begincname{%
+ \begingroup%
+ \catcode`##\active\catcode`&\active%
+ \catcode`:12\relax%
+ \catcode`\^^M\active\SB@outer\def^^M{}%
+ \SB@outer\def\[{}%
+ \chordlocals\relax%
+ }
+}
+\newcommand\SB@endcname{}
+\let\SB@endcname\endgroup
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@nbsp}
+% Non-breaking spaces (|~|) should be treated as spaces by the lyric-scanner
+% code that follows.
+% Although |~| is usually an active character that creates a non-breaking
+% space, some packages (e.g., the \textsf{Babel} package) redefine it to
+% produce accents, which are typically not lyric-ending.
+% To distinguish the real |~| from redefined |~|, we need to create a macro
+% whose definition is the non-breaking space definition normally assigned to
+% |~|.
+% \begin{macrocode}
+\newcommand\SB@nbsp{}
+\def\SB@nbsp{\nobreakspace{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@firstchord}
+% The following conditional is true when the current chord is the first
+% chord in a sequence of one or more chord macros.
+% \begin{macrocode}
+\newif\ifSB@firstchord\SB@firstchordtrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@@chord}
+% Finish processing the chord name and then begin scanning the implicit
+% lyric argument that follows it.
+% This is the main entrypoint to the lyric-scanner code.
+% \begin{macrocode}
+\newcommand*\SB@@chord{}
+\def\SB@@chord#1]{%
+ \SB@endcname%
+ \ifSB@firstchord%
+ \setbox\SB@lyricbox\hbox{\kern\SB@tabindent}%
+ \global\SB@tabindent\z@%
+ \SB@lyric{}%
+ \SB@numhyps\z@%
+ \SB@spcinit%
+ \setbox\SB@chordbox\box\voidb@x%
+ \fi%
+ \SB@setchord{#1}%
+ \SB@firstchordfalse%
+ \let\SB@dothis\SB@chstart%
+ \SB@chscan%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MultiwordChords}\MainImpl{MultiwordChords}
+% \begin{macro}{\SB@spcinit}
+% \changes{v1.22}{2007/05/15}{Added.}
+% The |\SB@spcinit| macro is invoked at the beginning of the lyric
+% scanning process.
+% By default it does nothing, but if |\MultiwordChords| is invoked,
+% it initializes the lyric-scanner state to process spaces as part of
+% lyrics.
+% \begin{macrocode}
+\newcommand\SB@spcinit{}
+\newcommand\MultiwordChords{%
+ \def\SB@spcinit{%
+ \let\SB@chdone\SB@chlyrdone%
+ \let\SB@chimpspace\SB@chnxtdone%
+ \let\SB@chexpspace\SB@chnxtdone%
+ \let\SB@chespace\SB@chendspace%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chscan}
+% \begin{macro}{\SB@chmain}
+% This is the main loop of the lyric-scanner.
+% Peek ahead at the next token without consuming it, then execute
+% a loop body based on the current state (|\SB@dothis|), and finally
+% go to the next iteration (|\SB@donext|).
+% \begin{macrocode}
+\newcommand\SB@chscan{%
+ \let\SB@nextname\relax%
+ \futurelet\SB@next\SB@chmain%
+}
+\newcommand\SB@chmain{\SB@dothis\SB@donext}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chnxtrelax}
+% \begin{macro}{\SB@chnxtstep}
+% \begin{macro}{\SB@chnxtdone}
+% To shorten the lyric parser macros that follow and thereby improve their
+% speed, we here define some abbreviations for common logic in untaken
+% branches.
+% \begin{macrocode}
+\newcommand\SB@chnxtrelax{\let\SB@donext\relax}
+\newcommand\SB@chnxtstep{\let\SB@donext\SB@chstep}
+\newcommand\SB@chnxtdone{\let\SB@donext\SB@chdone}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Warning: In the lyric-scanner macros that follow, |\SB@next|
+% might be a macro declared |\outer|.
+% This means that it must \emph{never} be passed as an argument to
+% a macro and it must never explicitly appear in any untaken branch
+% of a conditional.
+% If it does, the \TeX{} parser will complain of a runaway argument
+% when it tries to skip over an |\outer| macro while consuming tokens
+% at high speed.
+%
+% \begin{macro}{\SB@chstart}
+% We begin lyric-scanning with two special cases:
+% (1) If the chord macro is immediately followed by another chord macro with
+% no intervening whitespace, drop out of the lyric scanner and reenter it when
+% the second macro is parsed.
+% The chord texts will get concatenated together above the lyric that follows.
+% (2) If the chord macro is immediately followed by one or more quote
+% tokens, then consume them all and output them \emph{before} the chord.
+% This causes the chord to sit above the actual word instead of the
+% left-quote or left-double-quote symbol, which looks better.
+% \begin{macrocode}
+\newcommand\SB@chstart{%
+ \ifx\SB@next\[\SB@chnxtrelax%
+ \else\ifx\SB@next\SB@activehat\SB@chnxtrelax%
+ \else\ifx\SB@next\ch\SB@chnxtrelax%
+ \else\ifx\SB@next\mch\SB@chnxtrelax%
+ \else\ifx\SB@next`\SB@chnxtstep%
+ \else\ifx\SB@next'\SB@chnxtstep%
+ \else\ifx\SB@next"\SB@chnxtstep%
+ \else%
+ \the\SB@lyric%
+ \SB@lyric{}%
+ \SB@firstchordtrue%
+ \let\SB@dothis\SB@chnorm%
+ \SB@chnorm%
+ \fi\fi\fi\fi\fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \eat\]
+%
+% \begin{macro}{\SB@chnorm}
+% \changes{v2.0}{2007/06/18}{Rewritten for speed}
+% First, check to see whether the lyric token is a letter.
+% Since that's the most common case, we do this check first for speed.
+% \begin{macrocode}
+\newcommand\SB@chnorm{%
+ \ifcat\noexpand\SB@next A%
+ \SB@testtrue\SB@lettertests%
+ \ifSB@test%
+ \SB@chespace\SB@chnxtstep%
+ \else%
+ \SB@chnxtdone%
+ \fi%
+ \else%
+ \SB@chtrymacro%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chtrymacro}
+% Next, check to see whether it's a macro or active character.
+% We do these checks next because these are the only cases when the
+% token might be |\outer|.
+% Once we eliminate that ugly possibility, we can write the rest of
+% the code without having to worry about putting |\SB@next| in
+% places where |\outer| tokens are illegal.
+% \begin{macrocode}
+\newcommand\SB@chtrymacro{%
+ \ifcat\noexpand\SB@next\relax%
+ \SB@chmacro%
+ \else%
+ \SB@chother%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chother}
+% The token is not a letter, macro, or active character.
+% The only other cases of interest are spaces, braces, and hyphens.
+% If it's one of those, take the appropriate action; otherwise end the
+% lyric here.
+% Since we've eliminated the possibility of macros and active characters,
+% we can be sure that the token isn't |\outer| at this point.
+% \begin{macrocode}
+\newcommand\SB@chother{%
+ \ifcat\noexpand\SB@next\@sptoken%
+ \SB@chexpspace%
+ \else\ifcat\noexpand\SB@next\bgroup%
+ \SB@chespace\let\SB@donext\SB@chbgroup%
+ \else\ifcat\noexpand\SB@next\egroup%
+ \SB@chespace\let\SB@donext\SB@chegroup%
+ \else\ifx\SB@next-%
+ \SB@numhyps\@ne\relax%
+ \SB@lyricnohyp\expandafter{\the\SB@lyric}%
+ \let\SB@dothis\SB@chhyph%
+ \SB@chespace\SB@chnxtstep%
+ \else\ifcat\noexpand\SB@next.%
+ \SB@testtrue\SB@othertests%
+ \ifSB@test%
+ \SB@chespace\SB@chnxtstep%
+ \else%
+ \SB@chnxtdone%
+ \fi%
+ \else%
+ \SB@chespace\SB@chnxtstep%
+ \fi\fi\fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chmacro}
+% \changes{v1.22}{2007/05/15}{Added support for UTF-8.}
+% The lyric-scanner has encountered a macro or active character.
+% If it's |\outer|, it should never be used in an argument, so stop here.
+% \begin{macrocode}
+\newcommand\SB@chmacro{%
+ \SB@outertest%
+ \ifSB@test%
+ \SB@chnxtdone%
+ \else%
+ \let\SB@donext\SB@chgetname%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chgetname}
+% We've encountered a non-|\outer| macro or active character.
+% Use |\string| to get its name, but insert the token back into the
+% input stream since we haven't decided whether to consume it yet.
+% \begin{macrocode}
+\newcommand\SB@chgetname[1]{%
+ \edef\SB@nextname{\string#1}%
+ \SB@@chmacro\SB@donext#1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@@chmacro}
+% The lyric-scanner has encountered a non-|\outer| macro or active character.
+% Its |\string|ified name has been stored in |\SB@nextname|.
+% Test to see whether it's a known macro or the beginning of a
+% multibyte-encoded international character.
+% If the former, dispatch some macro-specific code to handle it.
+% If the latter, grab the full multibyte sequence and include it in the lyric.
+% \begin{macrocode}
+\newcommand\SB@@chmacro{%
+ \ifx\SB@next\SB@activehat%
+ \SB@chnxtdone%
+ \else\ifx\SB@next\SB@par%
+ \SB@chnxtdone%
+ \else\ifx\SB@next\measurebar%
+ \SB@chmbar%
+ \else\ifx\SB@next\mbar%
+ \SB@chmbar%
+ \else\ifx\SB@next\ch%
+ \SB@chespace\let\SB@donext\SB@chlig%
+ \else\ifx\SB@next\mch%
+ \SB@chespace\let\SB@donext\SB@mchlig%
+ \else\ifx\SB@next\ %
+ \SB@chimpspace%
+ \else\ifx\SB@next\SB@nbsp%
+ \SB@chimpspace%
+ \else%
+ \SB@UTFtest\SB@next%
+ \ifcase\SB@cnt\SB@chothermac%
+ \or\or\SB@chespace\let\SB@donext\SB@chsteptwo%
+ \or\SB@chespace\let\SB@donext\SB@chstepthree%
+ \or\SB@chespace\let\SB@donext\SB@chstepfour\fi%
+ \fi\fi\fi\fi\fi\fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chothermac}
+% \changes{v2.6}{2008/03/26}{All active chars now included in lyrics by default.}
+% The lyric-scanner has encountered a macro or active character that is
+% not |\outer|, not a known macro that requires special treatment,
+% and not a multibyte international character.
+% First, check the macro's name (stored in |\SB@nextname|) to see whether it
+% begins with a non-escape character.
+% If so, it's probably an accenting or punctuation character made active
+% by the |inputenc| or |babel| packages.
+% Most such characters should be included in the lyric, so include it by
+% default; otherwise exclude it by default.
+% The user can override the defaults using |\DeclareLyricChar| and friends.
+% \begin{macrocode}
+\newcommand\SB@chothermac{%
+ \SB@testfalse%
+ \afterassignment\iffalse%
+ \SB@cnt\expandafter`\SB@nextname x\fi%
+ \ifnum\the\catcode\SB@cnt=\z@\else\SB@testtrue\fi%
+ \SB@macrotests%
+ \ifSB@test%
+ \SB@chespace\SB@chnxtstep%
+ \else%
+ \SB@chnxtdone%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chstep}
+% \begin{macro}{\SB@chsteptwo}
+% \begin{macro}{\SB@chstepthree}
+% \begin{macro}{\SB@chstepfour}
+% \begin{macro}{\SB@chmulti}
+% \begin{macro}{\SB@chmstop}
+% We've encountered one or more tokens that should be included in the
+% lyric text.
+% (More than one means we've encountered a multibyte encoding of an
+% international character.)
+% Consume them (as arguments to this macro) and add them to the list
+% of tokens we've already consumed.
+% \begin{macrocode}
+\newcommand\SB@chstep[1]{%
+ \SB@lyric\expandafter{\the\SB@lyric#1}%
+ \SB@chscan%
+}
+\newcommand\SB@chsteptwo[2]{\SB@chmulti{#1#2}{\string#1\string#2}}
+\newcommand\SB@chstepthree[3]{%
+ \SB@chmulti{#1#2#3}{\string#1\string#2\string#3}%
+}
+\newcommand\SB@chstepfour[4]{%
+ \SB@chmulti{#1#2#3#4}{\string#1\string#2\string#3\string#4}%
+}
+\newcommand\SB@chmulti[2]{%
+ \def\SB@next{#1}%
+ \edef\SB@nextname{#2}%
+ \SB@testtrue\SB@multitests%
+ \ifSB@test%
+ \SB@lyric\expandafter{\the\SB@lyric#1}%
+ \expandafter\SB@chscan%
+ \else%
+ \expandafter\SB@chmstop%
+ \fi%
+}
+\newcommand\SB@chmstop{\expandafter\SB@chdone\SB@next}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chhyph}
+% We've encountered a hyphen.
+% Continue to digest hyphens, but terminate as soon as we see anything
+% else.
+% \begin{macrocode}
+\newcommand\SB@chhyph{%
+ \ifx\SB@next-%
+ \advance\SB@numhyps\@ne\relax%
+ \SB@chnxtstep%
+ \else%
+ \SB@chnxtdone%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chimpspace}
+% \begin{macro}{\SB@chexpspace}
+% We've encountered an implicit or explicit space.
+% Normally this just ends the lyric, but if |\MultiwordChords| is
+% active, these macros both get redefined to process the space.
+% \begin{macrocode}
+\newcommand\SB@chimpspace{}
+\let\SB@chimpspace\SB@chnxtdone
+\newcommand\SB@chexpspace{}
+\let\SB@chexpspace\SB@chnxtdone
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chespace}
+% \begin{macro}{\SB@chendspace}
+% \changes{v1.22}{2007/05/15}{Added.}
+% The |\SB@chespace| macro gets invoked by the lyric-scanner just before a
+% non-space token is about to be accepted as part of an under-chord lyric.
+% Normally it does nothing; however, if |\MultiwordChords| is active, it
+% gets redefined to do one of three things:
+% (1) Initially it is set equal to |\SB@chendspace| so that if the very
+% first token following the chord macro is not a space, the lyric-scanner
+% macros are redefined to process any future spaces encountered.
+% Otherwise the very first token is a space, and the lyric ends immediately.
+% (2) While scanning non-space lyric tokens, it is set to nothing, since no
+% special action needs to be taken until we encounter a sequence of one or
+% more spaces.
+% (3) When a space token is encountered (but not the very first token after
+% the chord macro), it is set equal to |\SB@chendspace| again so that
+% |\SB@chendspace| is invoked once the sequence of one or more space tokens
+% is finished.
+% \begin{macrocode}
+\newcommand\SB@chespace{}
+\newcommand\SB@chendspace{%
+ \let\SB@chdone\SB@chlyrdone%
+ \def\SB@chexpspace{\SB@chbspace\SB@chexpspace}%
+ \def\SB@chimpspace{\SB@chbspace\SB@chimpspace}%
+ \def\SB@chespace{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chbspace}
+% \begin{macro}{\SB@chgetspace}
+% \changes{v1.22}{2007/05/15}{Added.}
+% The |\SB@chbspace| macro gets invoked when |\MultiwordChords| is active
+% and the lyric-scanner has encountered a space token that was immediately
+% preceded by a non-space token.
+% Before processing the space, we add all lyrics seen so far to the
+% |\SB@lyricbox| and check its width.
+% If we've seen enough lyrics to match or exceed the width of the chord,
+% a space stops the lyric-scanning process.
+% (This is important because it minimizes the size of the chord box,
+% providing as many line breakpoints as possible to the paragraph-formatter.)
+%
+% Otherwise we begin scanning space tokens without adding them to the
+% lyric until we see what the next non-space token is.
+% If the next non-space token would have ended the lyric anyway, roll back
+% and end the lyric here, reinserting the space tokens back into the token
+% stream.
+% If the next non-space token would have been included in the lyric,
+% the lyric-scanner proceeds as normal.
+% \begin{macrocode}
+\newcommand\SB@chbspace{%
+ \setbox\SB@lyricbox\hbox{%
+ \unhbox\SB@lyricbox%
+ \the\SB@lyric%
+ }%
+ \SB@lyric{}%
+ \ifdim\wd\SB@lyricbox<\wd\SB@chordbox%
+ \let\SB@chbstok= \SB@next%
+ \def\SB@chexpspace{\let\SB@donext\SB@chgetspace}%
+ \let\SB@chimpspace\SB@chnxtstep%
+ \let\SB@chespace\SB@chendspace%
+ \let\SB@chdone\SB@chspcdone%
+ \else%
+ \let\SB@chimpspace\SB@chnxtdone%
+ \let\SB@chexpspace\SB@chnxtdone%
+ \fi%
+}
+\newcommand\SB@chgetspace{%
+ \SB@appendsp\SB@lyric%
+ \let\SB@nextname\relax%
+ \afterassignment\SB@chscan%
+ \let\SB@next= }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chmbar}
+% We've encountered a measure bar.
+% Either ignore it or end the lyric text, depending on whether
+% measure bars are being displayed.
+% \begin{macrocode}
+\newcommand\SB@chmbar{%
+ \ifmeasures%
+ \SB@chnxtdone%
+ \else%
+ \SB@chespace\SB@chnxtstep%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chbgroup}
+% We've encountered a begin-group brace.
+% Consume the entire group that it begins, and add it to the list
+% of tokens including the begin and end group tokens.
+% \begin{macrocode}
+\newcommand\SB@chbgroup[1]{%
+ \SB@lyric\expandafter{\the\SB@lyric{#1}}%
+ \SB@chscan%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chegroup}
+% \begin{macro}{\SB@chegrpscan}
+% \begin{macro}{\SB@chegrpmacro}
+% \begin{macro}{\SB@chegrpouter}
+% \begin{macro}{\SB@chegrpname}
+% \begin{macro}{\SB@chegrpdone}
+% We've encountered an end-group brace whose matching begin-group brace
+% must have come before the chord macro itself.
+% This forcibly ends the lyric text.
+% Before stopping, we must set |\SB@next| to the token following the brace
+% and |\SB@nextname| to its |\string|ified name so that |\SB@emitchord| will
+% know whether to add hyphenation.
+% Therefore, we temporarily consume the end-group brace, then scan the
+% next token without consuming it, and finally reinsert the end-group brace
+% and stop.
+% \begin{macrocode}
+\newcommand\SB@chegroup{%
+ \let\SB@nextname\relax%
+ \afterassignment\SB@chegrpscan%
+ \let\SB@next= }
+\newcommand\SB@chegrpscan{%
+ \futurelet\SB@next\SB@chegrpmacro%
+}
+\newcommand\SB@chegrpmacro{%
+ \ifcat\noexpand\SB@next\relax%
+ \expandafter\SB@chegrpouter%
+ \else%
+ \expandafter\SB@chegrpdone%
+ \fi%
+}
+\newcommand\SB@chegrpouter{%
+ \SB@outertest%
+ \ifSB@test%
+ \expandafter\SB@chegrpdone%
+ \else%
+ \expandafter\SB@chegrpname%
+ \fi%
+}
+\newcommand\SB@chegrpname[1]{%
+ \edef\SB@nextname{\string#1}%
+ \SB@chegrpdone#1%
+}
+\newcommand\SB@chegrpdone{\SB@chdone\egroup}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chlig}
+% \begin{macro}{\SB@mchlig}
+% We've encountered a |\ch| chord-over-ligature macro, or an
+% |\mch| measurebar-and-chord-over-ligature macro.
+% Consume it and all of its arguments, and load them into some
+% registers for future processing.
+% (Part of the ligature might fall into this lyric text or might
+% not, depending on whether we decide to add hyphenation.)
+% Then end the lyric text here.
+% \begin{macrocode}
+\newcommand\SB@chlig[5]{%
+ \gdef\SB@ligpre{{#3}}%
+ \gdef\SB@ligpost{\[#2]{#4}}%
+ \gdef\SB@ligfull{\[\SB@noreplay{\hphantom{{\lyricfont#3}}}#2]{#5}}%
+ \SB@chdone%
+}
+\newcommand\SB@mchlig[5]{%
+ \SB@lyric\expandafter{\the\SB@lyric#3}%
+ \let\SB@next\measurebar%
+ \edef\SB@nextname{\string\measurebar}%
+ \gdef\SB@ligpost{\measurebar\[#2]{#4}}%
+ \gdef\SB@ligfull{\measurebar\[#2]{#4}}%
+ \SB@chdone%
+}
+% \end{macrocode}
+% \eat\]
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@chdone}
+% \begin{macro}{\SB@chlyrdone}
+% \begin{macro}{\SB@chspcdone}
+% The |\SB@chdone| macro is invoked when we've decided to end the lyric
+% text (usually because we've encountered a non-lyric token).
+% Normally this expands to |\SB@chlyrdone|, which adds any uncontributed
+% lyric material to the |\SB@lyricbox| and jumps to the main chord
+% formatting macro.
+% However, if |\MultiwordChords| is active and if the lyric ended with
+% a sequence of one or more space tokens, then we instead reinsert the
+% space tokens into the token stream without contributing them to the
+% |\SB@lyricbox|.
+% \begin{macrocode}
+\newcommand\SB@chlyrdone{%
+ \setbox\SB@lyricbox\hbox{%
+ \unhbox\SB@lyricbox%
+ \ifnum\SB@numhyps=\@ne%
+ \the\SB@lyricnohyp%
+ \else%
+ \the\SB@lyric%
+ \fi%
+ }%
+ \SB@emitchord%
+}
+\newcommand\SB@chspcdone{%
+ \let\SB@nextname\relax%
+ \let\SB@next= \SB@chbstok%
+ \expandafter\SB@emitchord\the\SB@lyric%
+}
+\newcommand\SB@chdone{}
+\let\SB@chdone\SB@chlyrdone
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@ligpre}
+% \begin{macro}{\SB@ligpost}
+% \begin{macro}{\SB@ligfull}
+% The following three macros record arguments passed to a |\ch| macro that
+% concludes the lyric text of the |\[]|\eat\] macro currently being processed.
+% \begin{macrocode}
+\newcommand\SB@ligpre{}
+\newcommand\SB@ligpost{}
+\newcommand\SB@ligfull{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@clearlig}
+% Clear all ligature-chord registers.
+% \begin{macrocode}
+\newcommand\SB@clearlig{%
+ \gdef\SB@ligpre{}%
+ \gdef\SB@ligpost{}%
+ \gdef\SB@ligfull{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Chords}
+%
+% \begin{macro}{\SB@emitchord}\MainImpl{[}
+% \changes{v1.12}{2005/05/10}{Inhibited hyphenation of trailing punctuation}
+% \changes{v1.13}{2005/05/12}{Added code to preserve the spacefactor}
+% \changes{v1.16}{2005/07/23}{Chord macros massively reorganized to take lyrics as implicit rather than explicit arguments}
+% The |\SB@emitchord| macro does the actual work of typesetting chord text
+% over lyric text, introducing appropriate hyphenation when necessary.
+% We begin by consulting |\SB@next|, which should have been set by the
+% lyric-scanning code in \S\ref{sec:lyricscan} to the token that immediately
+% follows the lyric under this chord, to determine whether the lyric text
+% ends on a word boundary.
+% \begin{macrocode}
+\newcommand\SB@emitchord{%
+ \ifSB@inverse\else\ifSB@inchorus\else\SB@errchord\fi\fi%
+ \SB@testfalse%
+ \ifcat\noexpand\SB@next\@sptoken\SB@testtrue\fi%
+ \ifcat\noexpand\SB@next.\SB@testtrue\fi%
+ \ifx\SB@next\SB@par\SB@testtrue\fi%
+ \ifx\SB@next\egroup\SB@testtrue\fi%
+ \ifx\SB@next\endgroup\SB@testtrue\fi%
+ {\csname%
+ SB@HT@\ifx\SB@nextname\relax\meaning\SB@next\else\SB@nextname\fi%
+ \endcsname}%
+ \ifSB@test\SB@wordendstrue\else\SB@wordendsfalse\fi%
+% \end{macrocode}
+% Next, compare the width of the lyric to the width of the chord to
+% determine whether hyphenation might be necessary.
+% The original lyric text might have ended in a string of one or more
+% explicit hyphens, enumerated by |\SB@numhyps|.
+% If it ended in exactly one, the lyric-scanning code suppresses that hyphen
+% so that we can here add a new hyphen that floats out away from the word
+% when the chord above it is long.
+% If it ended in more than one (e.g., the encoding of an en- or em-dash) then
+% the lyric-scanner leaves it alone; we must not add any hyphenation or float
+% the dash away from the word.
+%
+% There is also code here to insert a penalty that discourages linebreaking
+% immediately before lyricless chords.
+% Beginning a wrapped line with a lyricless chord is undesirable because it
+% makes it look as though the wrapped line is extra-indented (due to the
+% empty lyric space below the chord).
+% It should therefore happen only as a last resort.
+% \begin{macrocode}
+ \SB@dimen\wd\SB@chordbox%
+ \ifvmode\leavevmode\fi%
+ \SB@brokenwordfalse%
+ \ifdim\wd\SB@lyricbox>\z@%
+ \ifdim\SB@dimen>\wd\SB@lyricbox%
+ \ifSB@wordends\else\SB@brokenwordtrue\fi%
+ \fi%
+ \else%
+ \SB@skip\lastskip%
+ \unskip\penalty200\hskip\SB@skip%
+ \fi%
+ \ifnum\SB@numhyps>\z@%
+ \ifnum\SB@numhyps>\@ne%
+ \SB@brokenwordfalse%
+ \else%
+ \SB@brokenwordtrue%
+ \fi%
+ \fi%
+% \end{macrocode}
+% If lyrics are suppressed on this line (e.g., by using |\nolyrics|), then just
+% typeset the chord text on the natural baseline.
+% \begin{macrocode}
+ \SB@testfalse%
+ \ifnolyrics\ifdim\wd\SB@lyricbox=\z@\SB@testtrue\fi\fi%
+ \ifSB@test%
+ \unhbox\SB@chordbox%
+ \gdef\SB@temp{\expandafter\SB@clearlig\SB@ligfull}%
+ \else%
+% \end{macrocode}
+% Otherwise, typeset the chord above the lyric on a double-height line.
+% \begin{macrocode}
+ \vbox{\clineparams\relax%
+ \ifSB@brokenword%
+ \global\setbox\SB@lyricbox\hbox{%
+ \unhbox\SB@lyricbox%
+ \SB@ligpre%
+ }%
+ \SB@maxmin\SB@dimen<{\wd\SB@lyricbox}%
+ \advance\SB@dimen.5em%
+ \hbox to\SB@dimen{\unhbox\SB@chordbox\hfil}%
+ \hbox to\SB@dimen{%
+ \unhcopy\SB@lyricbox\hfil\char\hyphenchar\font\hfil%
+ }%
+ \global\SB@cnt\@m%
+ \gdef\SB@temp{\expandafter\SB@clearlig\SB@ligpost}%
+ \else%
+ \box\SB@chordbox%
+ \hbox{%
+ \unhcopy\SB@lyricbox%
+ \global\SB@cnt\spacefactor%
+ \hfil%
+ }%
+ \gdef\SB@temp{\expandafter\SB@clearlig\SB@ligfull}%
+ \fi%
+ }%
+% \end{macrocode}
+% If the chord is lyricless, inhibit a linebreak immediately following it.
+% This prevents sequences of lyricless chords (which often end lines) from
+% being wrapped in the middle, which looks very unsightly and makes them
+% difficult to read.
+% If the chord has a lyric but it doesn't end on a word boundary, insert
+% an appropriate penalty to prevent linebreaking without hyphenation.
+% Also preserve the spacefactor in this case, which allows \LaTeX{} to
+% fine-tune the spacing between consecutive characters in the word that
+% contains the chord.
+% \begin{macrocode}
+ \ifSB@wordends%
+ \ifdim\wd\SB@lyricbox>\z@\else\nobreak\fi%
+ \else%
+ \penalty%
+ \ifnum\SB@numhyps>\z@\exhyphenpenalty%
+ \else\ifSB@brokenword\hyphenpenalty%
+ \else\@M\fi\fi%
+ \spacefactor\SB@cnt%
+ \fi%
+ \fi%
+% \end{macrocode}
+% Finally, end the macro with some code that handles the special case that
+% this chord is immediately followed by a chord-over-ligature macro.
+% The code above sets |\SB@temp| to the portion of the ligature that should
+% come after this chord but before the chord that tops the ligature.
+% This text must be inserted here.
+% \begin{macrocode}
+ \SB@temp%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@accidental}
+% Typeset an accidental symbol as a superscript within a chord.
+% Since chord names are often in italics but math symbols like sharp and
+% flat are not, we need to do some kerning adjustments before and after the
+% accidental to position it as if it were italicized.
+% The pre-adjustment is just a simple italic correction using |\/|.
+% The post-adjustment is based on the current font's slant-per-point metric.
+% \begin{macrocode}
+\newcommand\SB@accidental[1]{{%
+ \/%
+ \m@th#1%
+ \SB@dimen-\fontdimen\@ne\font%
+ \advance\SB@dimen.088142\p@%
+ \ifdim\SB@dimen<\z@%
+ \kern\f@size\SB@dimen%
+ \fi%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sharpsymbol}\MainImpl{sharpsymbol}
+% \begin{macro}{\flatsymbol}\MainImpl{flatsymbol}
+% When changing the sharp or flat symbol, change these macros rather than
+% changing |\shrp| or |\flt|.
+% This will ensure that other shortcuts like |#| and |&| will reflect your
+% change.
+% \begin{macrocode}
+\newcommand\sharpsymbol{\ensuremath{^\#}}
+\newcommand\flatsymbol{\raise.5ex\hbox{{\SB@flatsize$\flat$}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\shrp}\MainImpl{shrp}
+% \begin{macro}{\flt}\MainImpl{flt}
+% \changes{v2.10}{2009/08/18}{Font size made relative}
+% These macros typeset sharp and flat symbols.
+% \begin{macrocode}
+\newcommand\shrp{\SB@accidental\sharpsymbol}
+\newcommand\flt{\SB@accidental\flatsymbol}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\DeclareFlatSize}
+% The |\flat| math symbol is too small for properly typesetting
+% chord names.
+% (Its size was designed for staff notation not textual chord names.)
+% The correct size for the symbol should be approximately 30\% larger
+% than the current superscript size, or 90\% of the base font size $b$.
+% However, simply computing $0.9b$ does not work well because most fonts
+% do not render well in arbitrary sizes.
+% To solve the problem, we must therefore choose an appropriate size
+% individually for each possible base font size $b$.
+% This is the solution adopted by the rest of \LaTeX{} for such things.
+% For example, \LaTeX's |\DeclareMathSizes| macro defines an appropriate
+% superscript size for each possible base font size.
+% The macro below creates a similar macro that that defines an appropriate
+% flat-symbol size for each possible base font size.
+% \begin{macrocode}
+\newcommand\DeclareFlatSize[2]{%
+ \expandafter\xdef\csname SB@flatsize@#1\endcsname{#2}%
+}
+\DeclareFlatSize\@vpt\@vpt
+\DeclareFlatSize\@vipt\@vipt
+\DeclareFlatSize\@viipt\@vipt
+\DeclareFlatSize\@viiipt\@viipt
+\DeclareFlatSize\@ixpt\@viiipt
+\DeclareFlatSize\@xpt\@ixpt
+\DeclareFlatSize\@xipt\@xpt
+\DeclareFlatSize\@xiipt\@xipt
+\DeclareFlatSize\@xivpt\@xiipt
+\DeclareFlatSize\@xviipt\@xivpt
+\DeclareFlatSize\@xxpt\@xviipt
+\DeclareFlatSize\@xxvpt\@xxpt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@flatsize}
+% Select the correct flat symbol size based on the current font size.
+% \begin{macrocode}
+\newcommand\SB@flatsize{%
+ \@ifundefined{SB@flatsize@\f@size}{}{%
+ \expandafter\fontsize%
+ \csname SB@flatsize@\f@size\endcsname\f@baselineskip%
+ \selectfont%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% In the following code, the |\ch|, |\mch|, |\[|\eat\], and |^| macros are
+% each defined to be a single macro that then expands to the real definition.
+% This is necessary because the top-level definitions of each must stay the
+% same in order to allow the lyric-scanning code to uniquely identify them,
+% yet their internal definitions must be redefined by code that turns
+% chords and/or measure bars on and off.
+% Such code redefines |\SB@ch|, |\SB@mch|, |\SB@bracket|, and |\SB@rechord|
+% to effect a change of mode without touching the top-level definitions.
+%
+% \begin{macro}{\ch}\MainImpl{ch}
+% \begin{macro}{\SB@ch}
+% \begin{macro}{\SB@ch@on}
+% \begin{macro}{\SB@@ch}
+% \begin{macro}{\SB@@@ch}
+% \begin{macro}{\SB@ch@off}
+% The |\ch| macro puts a chord atop a ligature without breaking the ligature.
+% Normally this just means placing the chord midway over the unbroken
+% ligature (ignoring the third argument completely).
+% However, when a previous chord macro encounters it while scanning ahead in
+% the input stream to parse its lyric, the |\ch| macro itself is not actually
+% expanded at all.
+% Instead, the chord macro scans ahead, spots the |\ch| macro, gobbles it,
+% and then steals its arguments, breaking the ligature with hyphenation.
+% Thus, the |\ch| macro is only actually expanded when the ligature
+% shouldn't be broken.
+% \begin{macrocode}
+\newcommand\ch{\SB@ch}
+\newcommand\SB@ch{}
+\newcommand\SB@ch@on{\SB@begincname\SB@@ch}
+\newcommand*\SB@@ch[1]{\SB@endcname\SB@@@ch{#1}}
+\newcommand*\SB@@@ch[4]{\[\SB@noreplay{\hphantom{#2}}#1]#4}
+\newcommand*\SB@ch@off[4]{#4}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \eat\]
+%
+% \begin{macro}{\mch}\MainImpl{mch}
+% \begin{macro}{\SB@mch}
+% \begin{macro}{\SB@mch@m}
+% \begin{macro}{\SB@mch@on}
+% \begin{macro}{\SB@@mch}
+% \begin{macro}{\SB@@@mch}
+% The |\mch| macro is like |\ch| except that it also introduces a measure
+% bar.
+% \begin{macrocode}
+\newcommand\mch{\SB@mch}
+\newcommand\SB@mch{}
+\newcommand*\SB@mch@m[4]{#2\measurebar#3}
+\newcommand\SB@mch@on{\SB@begincname\SB@@mch}
+\newcommand*\SB@@mch[1]{\SB@endcname\SB@@@mch{#1}}
+\newcommand*\SB@@@mch[4]{#2\measurebar\[#1]#3}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \eat\]
+%
+% \begin{macro}{\SB@activehat}
+% This macro must always contain the current definition of the |^|
+% chord-replay active character, in order for the lyric scanner to properly
+% identify it and insert proper hyphenation when necessary.
+% \begin{macrocode}
+\newcommand\SB@activehat{%
+ \ifmmode^\else\expandafter\SB@rechord\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@loadactives}
+% It's cumbersome to have to type |\shrp|, |\flt|, and |\mbar| every time you
+% want a sharp, flat, or measure bar, so within verses and choruses we allow
+% the hash, ampersand, and pipe symbols to perform the those functions too.
+% It's also cumbersome to have to type something like |\chord{Am}{lyric}| to
+% produce each chord.
+% As an easier alternative, we here define |\[Am]|\eat\]
+% to typeset chords.
+% \begin{macrocode}
+\newcommand\SB@loadactives{}
+{
+ \catcode`&\active
+ \catcode`#\active
+ \catcode`|\active
+ \catcode`^\active
+ \global\let&\flt
+ \global\let#\shrp
+ \global\let|\measurebar
+ \global\let^\SB@activehat
+ \gdef\SB@loadactives{%
+ \catcode`^\ifchorded\active\else9 \fi%
+ \catcode`|\ifmeasures\active\else9 \fi%
+ \def\[{\SB@bracket}%
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Chord Replaying}
+%
+% \begin{macro}{\SB@trackch}
+% While inside a verse where the chord history is being remembered for future
+% verses, |\SB@trackch| is true.
+% \begin{macrocode}
+\newif\ifSB@trackch
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@cr@}
+% Reserve token registers to record a history of the chords seen in a verse.
+% \begin{macrocode}
+\SB@newtoks\SB@cr@
+\SB@newtoks\SB@ctail
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@creg}
+% The following control sequence equals the token register being memorized
+% into or replayed from.
+% \begin{macrocode}
+\newcommand\SB@creg{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newchords}\MainImpl{newchords}
+% \changes{v2.6}{2008/02/23}{Added}
+% Allocate a new chord-replay register to hold memorized chords.
+% \begin{macrocode}
+\newcommand\newchords[1]{%
+ \@ifundefined{SB@cr@#1}{%
+ \expandafter\SB@newtoks\csname SB@cr@#1\endcsname%
+ \global\csname SB@cr@#1\endcsname{\\}%
+ }{\SB@errdup{#1}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\memorize}\MainImpl{memorize}
+% \begin{macro}{\SB@memorize}
+% \changes{v2.6}{2008/02/23}{Optional argument added}
+% Saying |\memorize| throws out any previously memorized list of chords and
+% starts memorizing chords until the end of the current verse or chorus.
+% \begin{macrocode}
+\newcommand\memorize{%
+ \@ifnextchar[\SB@memorize{\SB@memorize[]}%
+}
+\newcommand\SB@memorize{}
+\def\SB@memorize[#1]{%
+ \@ifundefined{SB@cr@#1}{\SB@errreg{#1}}{%
+ \SB@trackchtrue%
+ \global\expandafter\let\expandafter\SB@creg%
+ \csname SB@cr@#1\endcsname%
+ \global\SB@creg{\\}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\replay}\MainImpl{replay}
+% \begin{macro}{\SB@replay}
+% \begin{macro}{\SB@@replay}
+% \changes{v2.6}{2008/02/23}{Added}
+% Saying |\replay| stops any memorization and begins replaying memorized
+% chords.
+% \begin{macrocode}
+\newcommand\replay{\@ifnextchar[\SB@replay\SB@@replay}
+\newcommand\SB@replay{}
+\def\SB@replay[#1]{%
+ \@ifundefined{SB@cr@#1}{\SB@errreg{#1}}{%
+ \SB@trackchfalse%
+ \global\expandafter\let\expandafter\SB@creg%
+ \csname SB@cr@#1\endcsname%
+ \global\SB@ctail\SB@creg%
+ }%
+}
+\newcommand\SB@@replay{%
+ \SB@trackchfalse%
+ \global\SB@ctail\SB@creg%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@rechord}
+% \begin{macro}{\SB@@rechord}
+% Replay the same chord that was in a previous verse.
+% \begin{macrocode}
+\newcommand\SB@rechord{}
+\newcommand\SB@@rechord{%
+ \SB@ifempty\SB@ctail{%
+ \SB@errreplay%
+ \SB@toks{}%
+ \let\SB@donext\@gobble%
+ }{%
+ \SB@lop\SB@ctail\SB@toks%
+ \let\SB@donext\SB@chord%
+ \let\SB@noreplay\@gobble%
+ }%
+ \expandafter\SB@donext\the\SB@toks]%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@nohat}
+% The |\ifSB@nohat| conditional is set to false when a chord macro contains
+% a |^| in its argument.
+% This suppresses the recording mechanism momentarily so that replays will
+% skip this chord.
+% \begin{macrocode}
+\newif\ifSB@nohat
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@noreplay}
+% Sometimes material must be added to a chord but omitted when the chord is
+% replayed.
+% We accomplish this by enclosing such material in |\SB@noreplay| macros,
+% which are set to |\@gobble| just before a replay and reset to
+% |\@firstofone| at other times.
+% \begin{macrocode}
+\newcommand\SB@noreplay{}
+\let\SB@noreplay\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Guitar Tablatures}
+%
+% The song book software not only supports chord names alone, but can also
+% typeset guitar tablature diagrams. The macros for producing these diagrams
+% are found here.
+%
+% \begin{macro}{\SB@fretwidth}
+% Set the width of each vertical string in the tablature diagram.
+% \begin{macrocode}
+\newlength\SB@fretwidth
+\setlength\SB@fretwidth{6\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@fretnum}
+% Typeset a fret number to appear to the left of the diagram.
+% \begin{macrocode}
+\newcommand\SB@fretnum[1]{{%
+ \sffamily\fontsize\@xpt\@xpt\selectfont#1%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@onfret}
+% Typeset one string of one fret with \argp{1} typeset overtop of it (usually
+% a dot or nothing at all).
+% \begin{macrocode}
+\newcommand\SB@onfret[1]{%
+ \rlap{\hbox to\SB@fretwidth{\hfil\vrule\@height6\p@\hfil}}%
+ \hbox to\SB@fretwidth{\hfil#1\hfil}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@atopfret}
+% Typeset material (given by \argp{1}) to be placed above a string in the
+% tablature diagram.
+% \begin{macrocode}
+\newcommand\SB@atopfret[1]{%
+ \hbox to\SB@fretwidth{\hfil#1\hfil}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@fretbar}
+% Typeset a horizontal fret bar of width |\SB@dimen|.
+% \begin{macrocode}
+\newcommand\SB@fretbar{%
+ \nointerlineskip%
+ \hbox to\SB@dimen{%
+ \advance\SB@dimen-\SB@fretwidth%
+ \advance\SB@dimen.4\p@%
+ \hfil%
+ \vrule\@width\SB@dimen\@height.4\p@\@depth\z@%
+ \hfil%
+ }%
+ \nointerlineskip%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@topempty}
+% \begin{macro}{\SB@topX}
+% \begin{macro}{\SB@topO}
+% Above a string in a tablature diagram there can be nothing,
+% an $\times$, or an $\circ$.
+% \begin{macrocode}
+\newcommand\SB@topempty{\SB@atopfret\relax}
+\newcommand\SB@topX{\SB@atopfret{%
+ \hbox{%
+ \kern-.2\p@%
+ \fontencoding{OMS}\fontfamily{cmsy}%
+ \fontseries{m}\fontshape{n}%
+ \fontsize\@viipt\@viipt\selectfont\char\tw@%
+ \kern-.2\p@%
+ }%
+}}
+\newcommand\SB@topO{\SB@atopfret{%
+ \vrule\@width\z@\@height4.3333\p@\@depth.8333\p@%
+ \lower.74\p@\hbox{%
+ \fontencoding{OMS}\fontfamily{cmsy}%
+ \fontseries{m}\fontshape{n}%
+ \fontsize\@xpt\@xpt\selectfont\char14%
+ }%
+}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@fretempty}
+% \begin{macro}{\SB@frethit}
+% On a string in a fret diagram there can be nothing or a filled circle.
+% \begin{macrocode}
+\newcommand\SB@fretempty{\SB@onfret\relax}
+\newcommand\SB@frethit{\SB@onfret{%
+ \hbox{%
+ \fontencoding{OMS}\fontfamily{cmsy}%
+ \fontseries{m}\fontshape{n}%
+ \fontsize\@xiipt\@xiipt\selectfont\char15%
+ }%
+}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@finger}
+% If we're including fingering info in the tablature diagram, then below
+% each string there might be a number.
+% \begin{macrocode}
+\newcommand\SB@finger[1]{%
+ \SB@atopfret{\sffamily\fontsize\@vipt\@vipt\selectfont#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifSB@gettabind}
+% \begin{macro}{\SB@tabindent}
+% Lyrics under tablature diagrams look odd if they aren't aligned with the
+% leftmost string of the diagram.
+% To accomplish this, the following two macros record the amount by which
+% a lyric under this tablature diagram must be indented to position it
+% properly.
+% \begin{macrocode}
+\newif\ifSB@gettabind\SB@gettabindfalse
+\SB@newdimen\SB@tabindent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@targfret}
+% \begin{macro}{\SB@targstr}
+% \begin{macro}{\SB@targfing}
+% Reserve some macro names in which to store the three pieces of the
+% second argument to the |\gtab| macro.
+% The first is for the fret number, the second is for the \meta{strings}
+% info, and the last is for the \meta{fingering} info.
+% \begin{macrocode}
+\newcommand\SB@targfret{}
+\newcommand\SB@targstr{}
+\newcommand\SB@targfing{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% In general |\gtab| macros often appear inside chord macros, which means
+% that their arguments have already been scanned by the time the
+% |\gtab| macro itself is expanded.
+% This means that catcodes cannot be reassigned (without resorting to
+% $\varepsilon$-\TeX).
+%
+% We therefore adopt the alternative strategy of converting each token
+% in the \meta{strings} and \meta{fingering} arguments of a |\gtab| macro
+% into a control sequence (using |\csname|).
+% We can then temporarily assign meanings to those control sequences and
+% replay the arguments to achieve various effects.
+%
+% \begin{macro}{\SB@csify}
+% \begin{macro}{\SB@@csify}
+% Convert all tokens in the first argument to control sequences and store
+% the resulting sequence into the macro given by the first argument.
+% Store the length in tokens into counter register |\SB@cnt|.
+% \begin{macrocode}
+\newcommand\SB@csify[2]{%
+ \SB@toks{}%
+ \SB@cnt\z@%
+ \SB@@csify#2\SB@@csify%
+ \edef#1{\the\SB@toks}%
+}
+\newcommand\SB@@csify[1]{%
+ \ifx#1\SB@@csify\else%
+ \advance\SB@cnt\@ne%
+ \SB@toks\expandafter{\the\SB@toks\csname#1\endcsname}%
+ \expandafter\SB@@csify%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\SB@gttop}
+% \begin{macro}{\SB@gtinit}
+% \begin{macro}{\SB@gtinc}
+% \begin{macro}{\SB@gtset}
+% Different meanings are assigned to digits, |X|'s, and |O|'s
+% depending on whether we are currently typesetting
+% the material overtop the diagram,
+% the interior of the diagram,
+% or the fingering numbers below the diagram.
+% These meanings are set by |\SB@gttop|, |\SB@gtinit| \&
+% |\SB@gtinc|, and |\SB@gtset|, respectively.
+% \begin{macrocode}
+\newcommand\SB@gttop{%
+ \let\X\SB@topX\let\0\SB@topO\let\O\0\let\1\SB@topempty%
+ \let\2\1\let\3\1\let\4\1\let\5\1%
+ \let\6\1\let\7\1\let\8\1\let\9\1%
+}
+\newcommand\SB@gtinit{%
+ \let\X\SB@fretempty\let\0\X\let\O\X\let\1\SB@frethit%
+ \let\2\X\let\3\X\let\4\X\let\5\X%
+ \let\6\X\let\7\X\let\8\X\let\9\X%
+}
+\newcommand\SB@gtinc{%
+ \let\9\8\let\8\7\let\7\6\let\6\5\let\5\4%
+ \let\4\3\let\3\2\let\2\1\let\1\0%
+}
+\newcommand\SB@gtset[2]{%
+ \let\X#1\let\0\X\let\O\X%
+ \def\1{#21}\def\2{#22}\def\3{#23}%
+ \def\4{#24}\def\5{#25}\def\6{#26}%
+ \def\7{#27}\def\8{#28}\def\9{#29}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@gtmax}
+% To compute the height of the tablature diagram, we must identify the
+% maximum fret number in the \meta{strings} argument.
+% This is accomplished by using the following macro in combination with
+% |\SB@gtset| above.
+% \begin{macrocode}
+\newcommand\SB@gtmax[1]{\ifnum\SB@cnt<#1\SB@cnt#1\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gtab}
+% \begin{macro}{\SB@gtab}
+% \changes{v2.9}{2009/03/27}{Fixed compatibility issue with Babel French}
+% A |\gtab| macro begins by setting catcodes suitable for parsing a chord
+% name as its first argument.
+% This allows tokens like |#| and |&| to be used for sharp and flat even
+% when |\gtab| is used outside a chord macro.
+% Colon is reset to a non-active character while processing the second
+% argument to avoid a potential conflict with \textsf{Babel} French.
+% \begin{macrocode}
+\newcommand\gtab{\SB@begincname\SB@gtab}
+\newcommand*\SB@gtab[1]{%
+ \SB@endcname%
+ \begingroup%
+ \catcode`:12\relax%
+ \SB@@gtab{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@@gtab}
+% If transposition is currently taking place, allow the user to customize
+% the behavior by redefining |\gtabtrans|.
+% Using |\gtab| within |\gtabtrans| should go directly to |\SB@@@gtab|
+% (otherwise an infinite loop would result!).
+% \begin{macrocode}
+\newcommand*\SB@@gtab[2]{%
+ \endgroup%
+ \ifnum\SB@transposefactor=\z@%
+ \SB@@@gtab{#1}{#2}%
+ \else%
+ \begingroup%
+ \let\gtab\SB@@@gtab%
+ \gtabtrans{#1}{#2}%
+ \endgroup%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gtabtrans}\MainImpl{gtabtrans}
+% By default, transposed guitar tablatures just display the transposed
+% chord name and omit the diagram.
+% Transposing a tablature diagram requires manual judgment calls for most
+% stringed instruments, so we can't do it automatically.
+% \begin{macrocode}
+\newcommand\gtabtrans[2]{\transposehere{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@@@gtab}\MainImpl{gtab}
+% \changes{v2.13}{2011/04/16}{Added transposition for chord names}
+% Typeset a full tablature diagram.
+% Text \argp{1} is a chord name placed above the diagram.
+% Text \argp{2} consists of a colon-separated list of:
+% (1) an optional fret number placed to the left of the diagram;
+% (2) a sequence of tokens, each of which can be
+% |X| (to place an $\times$ above the string),
+% |0| or |O| (to place an $\circ$ above the string), or
+% one of |1| through |9| (to place a filled circle on that string at the
+% fret of the given number); and
+% (3) an optional sequence of tokens, each of which is either |0|
+% (no fingering information for that string),
+% or one of |1| through |4| (to place the given number under that string).
+% \begin{macrocode}
+\newcommand\SB@@@gtab[2]{%
+ \let\SB@targfret\@empty%
+ \let\SB@targstr\@empty%
+ \let\SB@targfing\@empty%
+ \SB@tabargs#2:::\SB@tabargs%
+ \ifx\SB@targstr\@empty%
+ \def\SB@targstr{\0\0\0\0\0\0}%
+ \fi%
+ \ifvmode\leavevmode\fi%
+ \vbox{%
+ \normalfont\normalsize%
+ \setbox\SB@box\hbox{%
+ \thinspace{\printchord{\transposehere{#1}\strut}}\thinspace%
+ }%
+ \setbox\SB@boxii\hbox{\SB@fretnum{\SB@targfret}}%
+ \setbox\SB@boxiii\hbox{{\SB@gttop\SB@targstr}}%
+ \hsize\wd\SB@box%
+ \ifSB@gettabind%
+ \global\SB@tabindent\wd\SB@boxii%
+ \global\advance\SB@tabindent.5\SB@fretwidth%
+ \global\advance\SB@tabindent-.5\p@%
+ \fi%
+ \SB@dimen\wd\SB@boxii%
+ \advance\SB@dimen\wd\SB@boxiii%
+ \ifdim\hsize<\SB@dimen%
+ \hsize\SB@dimen%
+ \else\ifSB@gettabind%
+ \SB@dimenii\hsize%
+ \advance\SB@dimenii-\SB@dimen%
+ \divide\SB@dimenii\tw@%
+ \global\advance\SB@tabindent\SB@dimenii%
+ \fi\fi%
+ \hbox to\hsize{\hfil\unhbox\SB@box\hfil}%
+ \kern-\p@\nointerlineskip%
+ \hbox to\hsize{%
+ \hfil%
+ \vtop{\kern\p@\kern2\p@\box\SB@boxii}%
+ \vtop{%
+ \SB@dimen\wd\SB@boxiii%
+ \box\SB@boxiii%
+ \SB@cnt\minfrets%
+ \SB@gtset\relax\SB@gtmax\SB@targstr%
+ \SB@gtinit%
+ \loop%
+ \SB@fretbar\hbox{\SB@targstr}%
+ \advance\SB@cnt\m@ne%
+ \ifnum\SB@cnt>\z@\SB@gtinc\repeat%
+ \SB@fretbar%
+ \ifx\SB@targsfing\@empty\else%
+ \kern1.5\p@%
+ \SB@gtset\SB@topempty\SB@finger%
+ \hbox{\SB@targfing}%
+ \fi%
+ }%
+ \hfil%
+ }%
+ \kern3\p@%
+ }%
+ \SB@gettabindfalse%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@tabargs}
+% \begin{macro}{\SB@ctoken}
+% Break the second argument to a |\gtab| macro into three sub-arguments.
+% The possible forms are:
+% (a) \meta{strings},
+% (b) \meta{fret}|:|\meta{strings},
+% (c) \meta{strings}|:|\meta{fingering}, or
+% (d) \meta{fret}|:|\meta{strings}|:|\meta{fingering}.
+% To distinguish forms (b) and (c), we count the number of tokens before
+% the first colon.
+% If there is only one token, we assume it must be form (b), since frets
+% larger than 9 and 1-stringed instruments are both rare.
+% Otherwise we assume form (c).
+% \begin{macrocode}
+\newcommand\SB@ctoken{} \def\SB@ctoken{:}
+\newcommand\SB@tabargs{}
+\def\SB@tabargs#1:#2:#3:#4\SB@tabargs{%
+ \def\SB@temp{#4}%
+ \ifx\SB@temp\@empty%
+ \SB@csify\SB@targstr{#1}%
+ \else\ifx\SB@temp\SB@ctoken%
+ \SB@csify\SB@targstr{#1}%
+ \ifnum\SB@cnt>\@ne%
+ \SB@cntii\SB@cnt%
+ \SB@csify\SB@targfing{#2}%
+ \SB@cnt\SB@cntii%
+ \else%
+ \def\SB@targfret{#1}%
+ \SB@csify\SB@targstr{#2}%
+ \fi%
+ \else%
+ \def\SB@targfret{#1}%
+ \SB@csify\SB@targfing{#3}%
+ \SB@csify\SB@targstr{#2}%
+ \fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Book Sectioning}
+%
+% The following macros divide the song book into distinct sections, each with
+% different headers, different song numbering styles, different indexes, etc.
+%
+% \begin{macro}{\songchapter}\MainImpl{songchapter}
+% \changes{v1.19}{2005/10/24}{Added}
+% Format the chapter header for a chapter in a song book.
+% By default, chapter headers on a song book omit the chapter number, but do
+% include an entry in the pdf index or table of contents.
+% Thus, the chapter has a number; it's just not displayed at the start of
+% the chapter.
+% \begin{macrocode}
+\newcommand\songchapter{%
+ \let\SB@temp\@seccntformat%
+ \def\@seccntformat##1{}%
+ \@startsection{chapter}{0}{\z@}%
+ {3.5ex\@plus1ex\@minus.2ex}%
+ {.4ex\let\@seccntformat\SB@temp}%
+ {\sffamily\bfseries\LARGE\centering}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\songsection}\MainImpl{songsection}
+% \changes{v1.19}{2005/10/24}{Section headers changed to omit numbers}
+% Format the section header for a section in a song book.
+% This is the same as for chapter headers except at the section level.
+% \begin{macrocode}
+\newcommand\songsection{%
+ \let\SB@temp\@seccntformat%
+ \def\@seccntformat##1{}%
+ \@startsection{section}{1}{\z@}%
+ {3.5ex\@plus1ex\@minus.2ex}%
+ {.4ex\let\@seccntformat\SB@temp}%
+ {\sffamily\bfseries\LARGE\centering}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{songs}\MainEnvImpl{songs}
+% \changes{v1.19}{2005/10/24}{Song numbers now starts at one instead of zero}
+% Begin and end a book section.
+% The argument is a list of indexes with which to associate songs in this
+% section.
+% \begin{macrocode}
+\newenvironment{songs}[1]{%
+ \ifSB@songsenv\SB@errnse\fi%
+ \gdef\SB@indexlist{#1}%
+ \SB@chkidxlst%
+ \stepcounter{SB@songsnum}%
+ \setcounter{songnum}{1}%
+ \let\SB@sgroup\@empty%
+ \ifinner\else\ifdim\pagetotal>\z@%
+ \null\nointerlineskip%
+ \fi\fi%
+ \songcolumns\SB@numcols%
+ \SB@songsenvtrue%
+}{%
+ \commitsongs%
+ \global\let\SB@indexlist\@empty%
+ \ifinner\else\clearpage\fi%
+ \SB@songsenvfalse%
+}
+% \end{macrocode}
+% \end{environment}
+%
+% Each |songs| section needs a unique number to aid in hyperlinking.
+% \begin{macrocode}
+\newcounter{SB@songsnum}
+% \end{macrocode}
+%
+% \subsection{Index Generation}
+% \label{sec:indexgen}
+%
+% The following macros generate the various types of indexes. At present there
+% are four types:
+% \begin{enumerate}
+% \item A ``large'' index has a separate section for each capital letter and
+% is printed in two columns.
+% \item A ``small'' index has only a single column, centered, and has no
+% sections.
+% \item A ``scripture'' index has three columns and each entry has a
+% comma-separated list of references.
+% \item An ``author'' index is like a large index except in bold and without
+% the sectioning.
+% \end{enumerate}
+% ``Large'' and ``small'' indexes will be chosen automatically based on the
+% number of index entries when building a song index. The other two types are
+% designated by the user.
+%
+% As is typical of \LaTeX{} indexes, generation of song book indexes requires
+% two passes of document compilation. During the first pass, data files are
+% generated with song titles, authors, and scripture references. An external
+% program is then used to produce \LaTeX{} source files from those data files.
+% During the second pass of document compilation, those source files are
+% imported to typeset all the indexes and display them in the document.
+%
+% Internally, this package code uses a \emph{four} step process to move
+% the index data from the source |.tex| file to the |.sxd| data files.
+% \begin{enumerate}
+% \item While the current song box is in the midst of construction,
+% the data is stored in a box of non-immediate write whatsit nodes.
+% \item The whatsits are migrated out to the top of the song box when
+% it is finalized at |\endsong|.
+% \item When the song box is shipped out to the output file, \TeX{} expands
+% the whatsits, causing the data to be written to the |.sxc| auxiliary file.
+% \item At the |\end{document}| line, the |.sxc| is processed multiple
+% times---once for each index---to split the data into the respective
+% |.sxd| files.
+% \end{enumerate}
+% The first and second steps allow index references to point to the
+% beginning of the song no matter where the indexing commands appear
+% within the song.
+% The third step allows \TeX{} to drop index entries that refer to
+% songs that do not actually appear in the output (e.g., because of
+% |\includeonlysongs|).
+% It also allows index entries to refer to information that is only decided
+% at shipout time, such as page numbers.
+% The fourth step allows all indexing to be accomplished with at most one
+% write register.
+% \LaTeX{} provides extremely few write registers, so using as
+% few as possible is essential for supporting books with many indexes.
+%
+% \begin{macro}{\songtarget}\MainImpl{songtarget}
+% This macro is invoked by each \env{song} environment with two arguments:
+% (1) a suggested pdf bookmark index level, and
+% (2) a target name to which hyperlinks for this song in the index will refer.
+% The macro is expected to produce a suitable pdf bookmark entry and/or
+% link target.
+% The default definition tries to use |\pdfbookmark| if generating a PDF,
+% and resorts to |\hypertarget| (if it exists) otherwise.
+% The user can redefine the macro to customize how and whether bookmarks
+% and/or links are created.
+% \begin{macrocode}
+\newcommand\songtarget[2]{%
+ \ifnum\@ne=0\ifSB@pdf\ifx\pdfbookmark\undefined\else%
+ \ifx\pdfbookmark\relax\else1\fi\fi\fi\relax%
+ \pdfbookmark[#1]{\thesongnum. \songtitle}{#2}%
+ \else\ifx\hypertarget\undefined%
+ \else\ifx\hypertarget\relax\else%
+ \hypertarget{#2}{\relax}%
+ \fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\songlink}\MainImpl{songlink}
+% This macro is invoked by the index code to produce a link to a song target
+% created by \mac{songtarget}.
+% Its two arguments are:
+% (1) the target name (same as the second argument to \mac{songtarget}, and
+% (2) the text that is to be linked.
+% The default implementation uses |\hyperlink| if it exists; otherwise it
+% just leaves the text unlinked.
+% \begin{macrocode}
+\newcommand\songlink{%
+ \ifnum\@ne=0\ifx\hyperlink\undefined\else%
+ \ifx\hyperlink\relax\else1\fi\fi\relax%
+ \expandafter\hyperlink%
+ \else%
+ \expandafter\@gobble%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@indexlist}
+% This macro records the comma-separated list of the identifiers of indexes
+% associated with the current book section.
+% \begin{macrocode}
+\newcommand\SB@indexlist{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@allindexes}
+% This macro records a comma-separated list of all the index identifiers
+% for the entire document.
+% \begin{macrocode}
+\newcommand\SB@allindexes{}
+\let\SB@allindexes\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@out}
+% The |\SB@out| control sequence is reserved for the write register allocated
+% by the package code, if one is needed.
+% (It is allocated at the first index declaration.)
+% \begin{macrocode}
+\newcommand\SB@out{}
+\let\SB@out\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@newindex}
+% Initialize a new title, author, or scripture index.
+% \begin{macrocode}
+\newcommand\SB@newindex[4]{%
+ \expandafter\newcommand\csname SB@idxfilename@#3\endcsname{#4}%
+ \expandafter\newcommand\csname SB@idxsel@#3\endcsname[3]{###1}%
+ \expandafter\newcommand\csname SB@idxref@#3\endcsname{\thesongnum}%
+ \xdef\SB@allindexes{%
+ \ifx\SB@allindexes\@empty\else\SB@allindexes,\fi#3%
+ }%
+ \if@filesw%
+ \ifx\SB@out\relax%
+ \SB@newwrite\SB@out%
+ \immediate\openout\SB@out=\jobname.sxc\relax%
+ \fi%
+ \immediate\write\SB@out{\noexpand\SB@iwrite{#3}{#2}}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newindex}\MainImpl{newindex}
+% Define a new title index.
+% The first argument is an identifier for the index (used in constructing
+% index-specific control sequence names).
+% The second argument is a filename root; auxiliary file \argp{2}|.sxd| is
+% where the index data is stored at the end of processing.
+% \begin{macrocode}
+\newcommand\newindex{\SB@newindex1{TITLE INDEX DATA FILE}}
+\@onlypreamble\newindex
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newscripindex}\MainImpl{newscripindex}
+% Define a new scripture index. This is exactly like |\newindex| except that
+% scripture references are added to the auxiliary file instead of titles.
+% \begin{macrocode}
+\newcommand\newscripindex{\SB@newindex2{SCRIPTURE INDEX DATA FILE}}
+\@onlypreamble\newscripindex
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newauthorindex}\MainImpl{newauthorindex}
+% Define a new author index. This is exactly like |\newindex| except that
+% author info is added to the auxiliary file instead of titles.
+% \begin{macrocode}
+\newcommand\newauthorindex{\SB@newindex3{AUTHOR INDEX DATA FILE}}
+\@onlypreamble\newauthorindex
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@cwrite}
+% Write index data to a Song indeX Combined (|.sxc|) auxiliary file.
+% The first argument is the identifier for the index to which the data
+% ultimately belongs.
+% The second argument is the data itself.
+% The write is non-immediate so that it is only output if its enclosing
+% song is ultimately shipped to the output file.
+% \begin{macrocode}
+\newcommand\SB@cwrite[2]{%
+ \ifx\SB@out\relax\else%
+ \protected@write\SB@out\SB@keepactive{\protect\SB@iwrite{#1}{#2}}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@keepactive}
+% By default, the |inputenc| package expands Unicode characters into macro
+% names when writing them to files.
+% This behavior must be inhibited when writing to the |.sxc| file, since
+% |songidx| needs the original Unicode characters for sorting.
+% To achieve this, we temporarily redefine most active characters so that
+% they expand to an unexpandable string version of themselves.
+% \begin{macrocode}
+\newcommand\SB@keepactive{}
+{\catcode`\~\active
+ \catcode`\.12
+ \def\\#1#2{%
+ \endgroup
+ \expandafter\gdef\expandafter\SB@keepactive
+ \expandafter{\SB@keepactive\def#1{#2}}%
+ }
+ \def\SB@temp#1#2{%
+ \SB@cnt#1\relax
+ \loop
+ \begingroup
+ \uccode`\~\SB@cnt
+ \uccode`\.\SB@cnt
+ \uppercase{\\~.}
+ \ifnum\SB@cnt<#2\relax
+ \advance\SB@cnt\@ne
+ \repeat
+ }
+ \SB@temp{1}{8}
+ \SB@temp{11}{11}
+ \SB@temp{14}{91}
+ \SB@temp{93}{255}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@iwrite}
+% The line contributed by |\SB@cwrite| to the |.sxc| file is an |\SB@iwrite|
+% macro that re-outputs the data to an appropriate |.sxd| file.
+% \begin{macrocode}
+\newcommand\SB@iwrite[2]{%
+ \def\SB@tempii{#1}%
+ \ifx\SB@temp\SB@tempii%
+ \SB@toks{#2}%
+ \immediate\write\SB@out{\the\SB@toks}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@uncombine}
+% At the end of the document, the |.sxc| file can be processed multiple
+% times to produce all the |.sxd| files without resorting to multiple write
+% registers.
+% Each pass activates the subset of the |\SB@iwrite| commands that apply to
+% one index.
+% \begin{macrocode}
+\newcommand\SB@uncombine{%
+ \ifx\SB@out\relax\else%
+ \immediate\closeout\SB@out%
+ \ifsongindexes%
+ \@for\SB@temp:=\SB@allindexes\do{%
+ \immediate\openout\SB@out=%
+ \csname SB@idxfilename@\SB@temp\endcsname.sxd\relax%
+ \begingroup\makeatletter\catcode`\%12\relax%
+ \input{\jobname.sxc}\endgroup%
+ \immediate\closeout\SB@out%
+ }%
+ \fi%
+ \fi%
+}
+\AtEndDocument{\SB@uncombine}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@songwrites}
+% The following box register stores index data until it can be migrated to
+% the top of the song box currently under construction.
+% \begin{macrocode}
+\SB@newbox\SB@songwrites
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@addtoindex}
+% \changes{v2.8}{2009/02/03}{Writes made non-immediate}
+% Queue data \argp{2} associated with the current song for eventual writing
+% to the index whose identifier is given by \argp{1}.
+% \begin{macrocode}
+\newcommand\SB@addtoindex[2]{%
+ \protected@edef\SB@tempii{#2}%
+ \ifx\SB@tempii\@empty\else%
+ \global\setbox\SB@songwrites\vbox{%
+ \unvbox\SB@songwrites%
+ \SB@cwrite{#1}{#2}%
+ \SB@cwrite{#1}{\csname SB@idxref@#1\endcsname}%
+ \SB@cwrite{#1}{song\theSB@songsnum-\thesongnum.%
+ \ifnum\c@section=\z@1\else2\fi}%
+ }%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@addtoindexes}
+% Add \argp{1} to all title indexes, \argp{2} to all scripture indexes, and
+% \argp{3} to all author indexes.
+% \begin{macrocode}
+\newcommand\SB@addtoindexes[3]{%
+ \@for\SB@temp:=\SB@indexlist\do{%
+ \SB@addtoindex\SB@temp%
+ {\csname SB@idxsel@\SB@temp\endcsname{#1}{#2}{#3}}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@addtotitles}
+% Add \argp{1} to all title indexes, but leave other indexes unaffected.
+% \begin{macrocode}
+\newcommand\SB@addtotitles[1]{%
+ \@for\SB@temp:=\SB@indexlist\do{%
+ \csname SB@idxsel@\SB@temp\endcsname%
+ {\SB@addtoindex\SB@temp{#1}}{}{}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@chkidxlst}
+% \changes{v2.3}{2007/09/23}{Added.}
+% Check the current list of indexes and flag an error if any are undefined.
+% \begin{macrocode}
+\newcommand\SB@chkidxlst{%
+ \let\SB@temp\SB@indexlist%
+ \let\SB@indexlist\@empty%
+ \@for\SB@tempii:=\SB@temp\do{%
+ \@ifundefined{SB@idxsel@\SB@tempii}{\SB@errnoidx\SB@tempii}{%
+ \ifx\SB@indexlist\@empty%
+ \SB@toks\expandafter{\SB@tempii}%
+ \else%
+ \SB@toks\expandafter\expandafter\expandafter{%
+ \expandafter\SB@indexlist\expandafter,\SB@tempii}%
+ \fi%
+ \edef\SB@indexlist{\the\SB@toks}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\indexentry}\MainImpl{indexentry}
+% \changes{v2.3}{2007/09/23}{Optional argument added}
+% \begin{macro}{\SB@idxentry}
+% \begin{macro}{\SB@@idxentry}
+% |\SB@addtoindexes| will be called automatically for each song in a section.
+% However, |\indexentry| may be called by the user in order to add an
+% alternative index entry for the given song.
+% Usually this is done to index the song by its first line or some other
+% memorable line in a chorus or verse somewhere.
+% \begin{macrocode}
+\newcommand\indexentry{\@ifnextchar[{\SB@idxentry*}{\SB@@idxentry*}}
+\newcommand\SB@idxentry{}
+\def\SB@idxentry#1[#2]#3{{%
+ \def\SB@indexlist{#2}%
+ \SB@chkidxlst%
+ \SB@addtoindexes{#1#3}{#3}{#3}%
+}}
+\newcommand\SB@@idxentry[2]{\SB@addtotitles{#1#2}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\indextitleentry}\MainImpl{indextitleentry}
+% \changes{v2.3}{2007/09/23}{Optional argument added}
+% |\indextitleentry| may be used to add an alternate title for the song to
+% the index.
+% (The only difference between the effects of |\indexentry| and
+% |\indextitleentry| is that the latter are italicized in the rendered index
+% and the former are not.)
+% \begin{macrocode}
+\newcommand\indextitleentry{%
+ \@ifnextchar[{\SB@idxentry{}}{\SB@@idxentry{}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\indexsongsas}\MainImpl{indexsongsas}
+% \changes{v2.8}{2009/02/03}{Added.}
+% The following macro allows the user to change how songs are indexed on the
+% right side of index entries.
+% By default, the song's number is listed.
+% \begin{macrocode}
+\newcommand\indexsongsas[1]{%
+ \@ifundefined{SB@idxref@#1}%
+ {\SB@errnoidx{#1}\@gobble}%
+ {\expandafter\renewcommand\csname SB@idxref@#1\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxcmd}
+% \begin{macro}{\SB@@idxcmd}
+% \begin{macro}{\authsepword}\MainImpl{authsepword}
+% \begin{macro}{\authbyword}\MainImpl{authbyword}
+% \begin{macro}{\authignoreword}\MainImpl{authignoreword}
+% \begin{macro}{\titleprefixword}\MainImpl{titleprefixword}
+% \changes{v2.0}{2007/06/18}{Added.}
+% The |songidx| index-generation program understands several different
+% directives that each dictate various aspects of how index entries are
+% parsed, sorted, and displayed.
+% Such directives should typically appear at the start of the |.sxd|
+% file just after the header line that identifies the type of index.
+% \begin{macrocode}
+\newcommand\SB@idxcmd[3]{%
+ \ifx\SB@out\relax\else%
+ \@for\SB@temp:=\SB@allindexes\do{%
+ \csname SB@idxsel@\SB@temp\endcsname%
+ {\SB@@idxcmd{#1}}{\SB@@idxcmd{#2}}{\SB@@idxcmd{#3}}%
+ }%
+ \fi%
+}
+\newcommand\SB@@idxcmd[1]{%
+ \def\SB@tempii{#1}%
+ \ifx\SB@tempii\@empty\else%
+ \immediate\write\SB@out{%
+ \noexpand\SB@iwrite{\SB@temp}{#1}%
+ }%
+ \fi%
+}
+\newcommand\authsepword[1]{}
+\newcommand\authbyword[1]{}
+\newcommand\authignoreword[1]{}
+\newcommand\titleprefixword[1]{}
+{\catcode`\%=12
+ \gdef\authsepword#1{\SB@idxcmd{}{}{%sep #1}}
+ \gdef\authbyword#1{\SB@idxcmd{}{}{%after #1}}
+ \gdef\authignoreword#1{\SB@idxcmd{}{}{%ignore #1}}
+ \gdef\titleprefixword#1{\SB@idxcmd{%prefix #1}{}{}}}
+\@onlypreamble\authsepword
+\@onlypreamble\authbyword
+\@onlypreamble\authignoreword
+\@onlypreamble\titleprefixword
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxlineskip}
+% Set the spacing between lines in an index.
+% \begin{macrocode}
+\newcommand\SB@idxlineskip[1]{%
+ \vskip#1\p@\@plus#1\p@\@minus#1\p@%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% When rendering an index entry $X\ldots Y$ that is too long to fit on one
+% physical line, we must break text $X$ and/or $Y$ up into multiple lines.
+% Text $X$ should be typeset as a left-justified paragraph with a right
+% margin of about 2em; however, it's final line must not be so long that it
+% cannot fit even the first item of list $Y$.
+% Text $Y$ should be typeset as a right-justified paragraph whose first line
+% begins on the last line of $X$.
+% However, breaking $Y$ up the way paragraphs are normally broken up doesn't
+% work well because that causes most of $Y$ to be crammed into the first few
+% lines, leaving the last line very short.
+% This looks strange and is hard to read.
+% It looks much better to instead break $Y$ up in such a way that the portion
+% of $Y$ that is placed on each line is of approximately equal width (subject
+% to the constraint that we don't want to introduce any more lines than are
+% necessary).
+% This makes it visually clear that all of these lines are associated with $X$.
+% The following code performs the width computations that do this
+% horizontal-balancing of text.
+%
+% \begin{macro}{\SB@ellipspread}
+% Typeset an index entry of the form $X\ldots Y$.
+% In the common case, the entire entry fits on one line so we just typeset
+% it in the usual way.
+% If it doesn't fit on one line, we call |\SB@balancerows| for a more
+% sophisticated treatment.
+% \begin{macrocode}
+\newcommand\SB@ellipspread[2]{%
+ \begingroup%
+ \SB@dimen\z@%
+ \def\SB@temp{#1}%
+ \SB@toks{#2}%
+ \setbox\SB@box\hbox{{%
+ \SB@temp%
+ \leaders\hbox to.5em{\hss.\hss}\hskip2em\@plus1fil%
+ {\the\SB@toks}%
+ }}%
+ \ifdim\wd\SB@box>\hsize%
+ \SB@balancerows%
+ \else%
+ \hbox to\hsize{\unhbox\SB@box}\par%
+ \fi%
+ \endgroup%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@balancerows}
+% Typeset an index entry of the form $X\ldots Y$ that doesn't fit on one line,
+% where $X$ is the content of macro |\SB@temp| and
+% $Y$ is the content of token register |\SB@toks|.
+%
+% First, we must pre-compute the width $w_1$ of the final line of $X$ when
+% $X$ is typeset as a left-justified paragraph, storing it in |\SB@dimenii|.
+% This is necessary because in order to force \TeX{} to typeset the first
+% line of $Y$ at some chosen width $w_2$, we must insert leaders of width
+% $c-w_1-w_2$ into the paragraph between $X$ and $Y$, where $c$ is the column
+% width.
+%
+% Computing this width $w_1$ is a bit tricky.
+% We must tell \TeX{} that the last line of $X$ must not be so long that it
+% does not even have room for the first item of $Y$.
+% Thus, we must strip off the first item of $Y$ and add it (or a non-breaking
+% space of equivalent width) to the end of $X$ to typeset the paragraph.
+% Then we use |\lastbox| to pull off the final line and check its width.
+% \begin{macrocode}
+\newcommand\SB@balancerows{%
+ \edef\SB@tempii{\the\SB@toks}%
+ \setbox\SB@box\vbox{%
+ \SB@toks\expandafter{\expandafter\\\the\SB@toks\\}%
+ \SB@lop\SB@toks\SB@toks%
+ \settowidth\SB@dimen{\the\SB@toks}%
+ \advance\SB@dimen-.5em%
+ \leftskip.5cm%
+ {\hbadness\@M\hfuzz\maxdimen%
+ \hskip-.5cm\relax\SB@temp\unskip\nobreak%
+ \hskip\SB@dimen\nobreak%
+ \rightskip2em\@plus1fil\par}%
+ \setbox\SB@box\lastbox%
+ \setbox\SB@box\hbox{%
+ \unhbox\SB@box%
+ \unskip\unskip\unpenalty%
+ \unpenalty\unskip\unpenalty%
+ }%
+ \expandafter%
+ }%
+ \expandafter\SB@dimenii\the\wd\SB@box\relax%
+% \end{macrocode}
+% Next, compute the smallest width $w_2$ such that the index entry text
+% produced by |\SB@multiline| with |\SB@dimen|=$w_2$ has no more lines than
+% with |\SB@dimen| set to the maximum available width for the right-hand side.
+% This effectively horizontal-balances the right-hand side of the index entry
+% text, making all lines of $Y$ roughly equal in width without introducing
+% any extra lines.
+% \begin{macrocode}
+ \SB@dimen\hsize%
+ \advance\SB@dimen-.5cm%
+ \setbox\SB@box\vbox{%
+ \SB@multiline{\hbadness\@M\hfuzz\maxdimen}%
+ }%
+ \SB@dimeniii.5\SB@dimen%
+ \SB@dimeniv\SB@dimeniii%
+ \loop%
+ \SB@dimeniv.5\SB@dimeniv%
+ \setbox\SB@boxii\vbox{%
+ \SB@dimen\SB@dimeniii%
+ \SB@multiline{\hbadness\@M\hfuzz\maxdimen}%
+ }%
+ \ifnum\SB@cnt<\@M%
+ \ifdim\ht\SB@boxii>\ht\SB@box%
+ \advance\SB@dimeniii\SB@dimeniv%
+ \else%
+ \SB@dimen\SB@dimeniii%
+ \advance\SB@dimeniii-\SB@dimeniv%
+ \fi%
+ \else%
+ \advance\SB@dimeniii\SB@dimeniv%
+ \fi%
+ \ifdim\SB@dimeniv>2\p@\repeat%
+ \setbox\SB@box\box\voidb@x%
+ \setbox\SB@boxii\box\voidb@x%
+% \end{macrocode}
+% Finally, typeset the results based on the quantities computed above.
+% \begin{macrocode}
+ \SB@multiline\relax%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@multiline}
+% Create a paragraph containing text $X\ldots Y$
+% where $X$ is the content of |\SB@temp|, $Y$ is the content of |\SB@tempii|,
+% and $Y$ is restricted to width |\SB@dimen| (but may span multiple
+% lines of that width).
+% Dimen register |\SB@dimenii| must be set with the expected width of the
+% final line of $X$.
+% The first argument contains any parameter definitions that should be in
+% effect when $X$ is processed.
+%
+% Note that the expansion of |\SB@tempii|, which may contain |\SB@idxitemsep|,
+% depends on |\SB@dimen|.
+% Therefore, the redefinition of |\SB@dimen| at the start of this macro must
+% not be removed!
+% \begin{macrocode}
+\newcommand\SB@multiline[1]{%
+ \begingroup%
+ \SB@dimen-\SB@dimen%
+ \advance\SB@dimen\hsize%
+ \SB@dimenii-\SB@dimenii%
+ \advance\SB@dimenii\SB@dimen%
+ {#1\hskip-.5cm\relax\SB@temp\unskip\nobreak%
+ \SB@maxmin\SB@dimenii<{1.5em}%
+ \leftskip.5cm\rightskip2em\@plus1fil%
+ \interlinepenalty\@M%
+ \leaders\hbox to.5em{\hss.\hss}\hskip\SB@dimenii\@plus1fill%
+ \nobreak{\SB@tempii\kern-2em}%
+ \par\global\SB@cnt\badness}%
+ \endgroup%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxitemsep}
+% \changes{v1.11}{2005/04/21}{Changed macro name to avoid a name clash}
+% If text $Y$ in index entry $X\ldots Y$ has multiple items in a list, those
+% items should be separated by |\\| macros instead of by commas.
+% The |\\| macro will be assigned the definition of |\SB@idxitemsep| during
+% index generation, which produces the comma along with the complex spacing
+% required if $Y$ ends up being broken into multiple lines.
+% In particular, it forces each wrapped line of $Y$ to be right-justified
+% with left margin at least |\SB@dimen|.
+% \begin{macrocode}
+\newcommand\SB@idxitemsep{%
+ ,\kern-2em\penalty-8\hskip2.33em\@minus.11em%
+ \hskip-\SB@dimen\@plus-1fill%
+ \vadjust{}\nobreak%
+ \hskip\SB@dimen\@plus1fill\relax%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following set of macros and environments are intended for use in the
+% |.sbx| files that are automatically generated by an index-generating
+% program; they shouldn't normally appear in the user's |.tex| or |.sbd|
+% files directly.
+% However, they are named as exported macros (no |@| symbols) since they are
+% used outside the package code and are therefore not stricly internal.
+%
+% \begin{environment}{idxblock}
+% Some indexes are divided into blocks (e.g., one for each letter of the
+% alphabet or one for each book of the bible).
+% Each such block should be enclosed between |\begin{idxblock}{X}| and
+% |\end{idxblock}| lines, where X is the title of the block. The actual
+% definition of the |idxblock| environment is set within the initialization
+% code for each type of index (below).
+% \begin{macrocode}
+\newenvironment{idxblock}[1]{}{}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\idxentry}
+% \begin{macro}{\idxaltentry}
+% Within each |idxblock| environment there should be a series of |\idxentry|
+% and/or |\idxaltentry| macros, one for each line of the index. Again, the
+% exact definitions of these macros will vary between index types.
+% \begin{macrocode}
+\newcommand\idxentry[2]{}
+\newcommand\idxaltentry[2]{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{SB@lgidx}
+% \begin{environment}{SB@smidx}
+% Some indexes actually have two definitions for each |idxblock|
+% environment---one for use when there are few enough entries to permit a
+% small style index, and another for use in a large style index. These macros
+% will be redefined appropriately within the initialization code for each
+% type of index.
+% \begin{macrocode}
+\newenvironment{SB@lgidx}[1]{}{}
+\newenvironment{SB@smidx}[1]{}{}
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \begin{macro}{\SB@idxsetup}
+% Set various parameters for a column of an index environment.
+% \begin{macrocode}
+\newcommand\SB@idxsetup{%
+ \hsize\SB@colwidth%
+ \parskip\z@skip\parfillskip\z@skip\parindent\z@%
+ \baselineskip\f@size\p@\@plus\p@\@minus\p@%
+ \lineskiplimit\z@\lineskip\p@\@plus\p@\@minus\p@%
+ \hyphenpenalty\@M\exhyphenpenalty\@M%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@makeidxcolumn}
+% Break off enough material from |\SB@box| to create one column of the
+% index.
+% \begin{macrocode}
+\newcommand\SB@makeidxcolumn{%
+ \ifdim\ht\SB@box=\z@%
+ \hskip\hsize\relax%
+ \else%
+ \splittopskip\z@skip\splitmaxdepth\maxdepth%
+ \vsplit\SB@box to\SB@dimen%
+ \global\setbox\SB@box\vbox{%
+ \SB@idxsetup%
+ \splitbotmark%
+ \unvbox\SB@box%
+ }%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@oneidxpage}
+% Construct one full page of the index.
+% The definition of |\SB@oneidxpage| is generated dynamically based on the
+% type of index and number of columns.
+% \begin{macrocode}
+\newcommand\SB@oneidxpage{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@displayindex}
+% \changes{v1.11}{2005/04/21}{Item separator macro now localized in scope to the index file}
+% \changes{v2.0}{2007/06/18}{Removed hyperref dependency}
+% \changes{v2.6}{2008/02/16}{Balance columns on final page}
+% \changes{v2.8}{2009/03/06}{Changed argument order}
+% Create an index with title \argp{2} and with \argp{1} columns (must be a
+% literal constant). Input the index contents from external file \argp{3},
+% which is expected to be a \TeX{} file.
+% \begin{macrocode}
+\newcommand\SB@displayindex[3]{%
+ \ifsongindexes\begingroup%
+ \SB@colwidth\hsize%
+ \advance\SB@colwidth-#1\columnsep%
+ \advance\SB@colwidth\columnsep%
+ \divide\SB@colwidth#1%
+ \setbox\SB@envbox\vbox{%
+ \let\SB@temp\songsection%
+ \ifx\chapter\undefined\else%
+ \ifx\chapter\relax\else%
+ \let\SB@temp\songchapter%
+ \fi%
+ \fi%
+ \SB@temp{#2}%
+ }%
+% \end{macrocode}
+% The |.sbx| index file might not exist (e.g., if this is the first pass
+% through the \TeX{} compiler).
+% If it exists, first try typesetting its content as a small index
+% (one column, centered, with no divisions).
+% \begin{macrocode}
+ \IfFileExists{\csname SB@idxfilename@#3\endcsname.sbx}{%
+ \ifsepindexes%
+ \global\setbox\SB@box\vbox{%
+ \null%
+ \vfil%
+ \unvcopy\SB@envbox%
+ \vskip.5in\@minus.3in\relax%
+ \hbox to\hsize{%
+ \hfil%
+ \vbox{%
+ \SB@idxsetup%
+ \renewenvironment{idxblock}[1]%
+ {\begin{SB@smidx}{####1}}{\end{SB@smidx}}%
+ \let\\\SB@idxitemsep%
+ \input{\csname SB@idxfilename@#3\endcsname.sbx}%
+ }%
+ \hfil%
+ }%
+ \vskip\z@\@plus2fil\relax%
+ }%
+% \end{macrocode}
+% Test whether the resulting small index fits within one page.
+% If not, re-typeset it as a large index.
+% \begin{macrocode}
+ {\vbadness\@M\vfuzz\maxdimen%
+ \splitmaxdepth\maxdepth\splittopskip\z@skip%
+ \global\setbox\SB@boxii\vsplit\SB@box to\textheight}%
+ \ifvoid\SB@box%
+ \box\SB@boxii%
+ \else%
+ \SB@lgindex{#1}{#3}%
+ \fi%
+ \else%
+ \SB@lgindex{#1}{#3}%
+ \fi%
+ }%
+% \end{macrocode}
+% If the |.sbx| file doesn't exist, then instead typeset a page with a
+% message on it indicating that the document must be compiled a second
+% time in order to generate the index.
+% \begin{macrocode}
+ {%
+ \ifsepindexes%
+ \vbox to\textheight{%
+ \vfil%
+ \unvbox\SB@envbox%
+ \vskip1em\relax%
+ \hbox to\hsize{\hfil[Index not yet generated.]\hfil}%
+ \vskip\z@\@plus2fil\relax%
+ }%
+ \else%
+ \unvbox\SB@envbox%
+ \hbox to\hsize{\hfil[Index not yet generated.]\hfil}%
+ \fi%
+ }%
+ \ifsepindexes\clearpage\fi%
+ \endgroup\fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@lgindex}
+% Typeset a large-style index.
+% We begin by typesetting the entire index into a box.
+% \begin{macrocode}
+\newcommand\SB@lgindex[2]{%
+ \global\setbox\SB@box\vbox{%
+ \renewenvironment{idxblock}[1]%
+ {\begin{SB@lgidx}{##1}}{\end{SB@lgidx}}%
+ \let\\\SB@idxitemsep%
+ \SB@idxsetup%
+ \input{\csname SB@idxfilename@#2\endcsname.sbx}%
+ \unskip%
+ }%
+% \end{macrocode}
+% Next, we split the box into columns and pages until the last page is reached.
+% \begin{macrocode}
+ \SB@toks{\SB@makeidxcolumn}%
+ \SB@cnt#1\relax%
+ \loop\ifnum\SB@cnt>\@ne%
+ \SB@toks\expandafter{\the\SB@toks%
+ \kern\columnsep\SB@makeidxcolumn}%
+ \advance\SB@cnt\m@ne%
+ \repeat%
+ \edef\SB@oneidxpage{\the\SB@toks}%
+ \unvbox\SB@envbox%
+ \vskip.2in\relax%
+ \nointerlineskip%
+ \null%
+ \nointerlineskip%
+ \SB@cnt\vbadness\vbadness\@M%
+ \SB@dimenii\vfuzz\vfuzz\maxdimen%
+ \loop%
+ \SB@dimen\textheight%
+ \ifinner\else\kern\z@\advance\SB@dimen-\pagetotal\fi%
+ \global\setbox\SB@boxii\copy\SB@box%
+ \global\setbox\SB@boxiii\hbox{\SB@oneidxpage}%
+ \ifdim\ht\SB@box>\z@%
+ \box\SB@boxiii%
+ \vfil\break%
+ \repeat%
+% \end{macrocode}
+% The final page of the index should have all equal-height columns instead
+% of a few full columns followed by some short or empty columns at the end.
+% To achieve this, we re-typeset the final page, trying different column
+% heights until we find one that causes the material to span an equal
+% percentage of all the columns on the page.
+% \begin{macrocode}
+ \SB@dimenii\ht\SB@boxii%
+ \divide\SB@dimenii#1\relax%
+ \SB@maxmin\SB@dimen>\SB@dimenii%
+ \loop%
+ \global\setbox\SB@box\copy\SB@boxii%
+ \global\setbox\SB@boxiii\hbox{\SB@oneidxpage}%
+ \ifdim\ht\SB@box>\z@%
+ \advance\SB@dimen\p@%
+ \repeat%
+ \box\SB@boxiii%
+ \global\setbox\SB@boxii\box\voidb@x%
+ \vbadness\SB@cnt\vfuzz\SB@dimenii%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\showindex}\MainImpl{showindex}
+% \changes{v2.8}{2009/03/06}{Added optional argument}
+% Create an index with title \argp{2} based on the data associated with index
+% identifier \argp{3} (which was passed to |\newindex|).
+% Optional argument \argp{1} specifies the number of columns.
+% This macro calls the appropriate index-creation macro depending on the type
+% of index that \argp{3} was declared to be.
+% \begin{macrocode}
+\newcommand\showindex[3][0]{%
+ \@ifundefined{SB@idxsel@#3}{\SB@errnoidx{#3}}{%
+ \expandafter\let\expandafter\SB@temp\csname SB@idxsel@#3\endcsname%
+ \SB@cnt#1\relax%
+ \ifnum\SB@cnt<\@ne\SB@cnt\SB@temp232\relax\fi%
+ \expandafter\SB@temp%
+ \expandafter\SB@maketitleindex%
+ \expandafter\SB@makescripindex%
+ \expandafter\SB@makeauthorindex%
+ \expandafter{\the\SB@cnt}%
+ {#2}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@maketitleindex}
+% \changes{v2.8}{2009/03/06}{Added columns argument}
+% Create a song title index.
+% \argp{1} is a column count,
+% \argp{2} is the title, and
+% \argp{3} is the index identifier (which was passed to |\newindex|).
+% \begin{macrocode}
+\newcommand\SB@maketitleindex{%
+ \ifnum\idxheadwidth>\z@%
+ \renewenvironment{SB@lgidx}[1]{
+ \hbox{\SB@colorbox\idxbgcolor{\vbox{%
+ \hbox to\idxheadwidth{{\idxheadfont\relax##1}\hfil}%
+ }}}%
+ \nobreak\vskip3\p@\@plus2\p@\@minus2\p@\nointerlineskip%
+ }{\penalty-50\vskip5\p@\@plus5\p@\@minus4\p@}%
+ \else%
+ \renewenvironment{SB@lgidx}[1]{}{}%
+ \fi%
+ \renewenvironment{SB@smidx}[1]{}{}%
+ \renewcommand\idxentry[2]{%
+ \SB@ellipspread{\idxtitlefont\relax\ignorespaces##1\unskip}%
+ {{\idxrefsfont\relax##2}}%
+ }%
+ \renewcommand\idxaltentry[2]{%
+ \SB@ellipspread{\idxlyricfont\relax\ignorespaces##1\unskip}%
+ {{\idxrefsfont\relax##2}}%
+ }%
+ \SB@displayindex%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxcolhead}
+% In a scripture index, this macro remembers the current book of the bible
+% we're in so that new columns can be headed with ``Bookname (continued)''.
+% \begin{macrocode}
+\newcommand\SB@idxcolhead{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxheadsep}
+% Add vertical space following the header line that begins (or continues) a
+% section of a scripture index.
+% \begin{macrocode}
+\newcommand\SB@idxheadsep{{%
+ \SB@dimen4\p@%
+ \advance\SB@dimen-\prevdepth%
+ \SB@maxmin\SB@dimen<\z@%
+ \SB@dimenii\SB@dimen%
+ \SB@maxmin\SB@dimenii>\p@%
+ \vskip\SB@dimen\@plus\p@\@minus\SB@dimenii%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@idxcont}
+% Typeset the ``Bookname (continued)'' line that continues a scripture
+% index section when it spans a column break.
+% \begin{macrocode}
+\newcommand\SB@idxcont[1]{%
+ \hbox to\hsize{{\idxcont{#1}}\hfil}%
+ \nobreak%
+ \SB@idxheadsep\nointerlineskip%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@makescripindex}
+% \changes{v2.4}{2007/10/08}{Scripture index spacing made more uniform}
+% \changes{v2.8}{2009/03/06}{Added columns argument}
+% Create a scripture index.
+% \argp{1} is a column count,
+% \argp{1} is the title, and
+% \argp{2} is the index identifier (which was passed to |\newscripindex|).
+% \begin{macrocode}
+\newcommand\SB@makescripindex{%
+ \renewenvironment{SB@lgidx}[1]{%
+ \gdef\SB@idxcolhead{##1}%
+ \hbox to\hsize{{\idxbook{##1}}\hfil}%
+ \nobreak%
+ \SB@idxheadsep\nointerlineskip%
+ }{%
+ \mark{\noexpand\relax}%
+ \penalty-20\vskip3\p@\@plus3\p@\relax%
+ }%
+ \renewenvironment{SB@smidx}[1]
+ {\begin{SB@lgidx}{##1}}{\end{SB@lgidx}}%
+ \renewcommand\idxentry[2]{%
+ \SB@ellipspread{\hskip.25cm\idxscripfont\relax##1}%
+ {{\idxrefsfont\relax##2}}%
+ \SB@toks\expandafter{\SB@idxcolhead}%
+ \mark{\noexpand\SB@idxcont{\the\SB@toks}}%
+ }%
+ \renewcommand\idxaltentry[2]{\SB@erridx{a scripture}}%
+ \SB@displayindex%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@makeauthorindex}
+% \changes{v2.8}{2009/03/06}{Added columns argument}
+% Create an author index.
+% \argp{1} is a column count,
+% \argp{2} is the title, and
+% \argp{2} is the index identifier (which was passed to |\newauthindex|).
+% \begin{macrocode}
+\newcommand\SB@makeauthorindex{%
+ \renewenvironment{SB@lgidx}[1]{}{}%
+ \renewenvironment{SB@smidx}[1]{}{}%
+ \renewcommand\idxentry[2]{%
+ \SB@ellipspread{{\idxauthfont\relax\sfcode`.\@m##1}}%
+ {{\idxrefsfont##2}}%
+ }%
+ \renewcommand\idxaltentry[2]{\SB@erridx{an author}}%
+ \SB@displayindex%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Error Messages}
+%
+% We break error messages out into separate macros here in order to reduce the
+% length (in tokens) of the more frequently used macros that do actual work.
+% This can result in a small speed improvement on slower machines.
+%
+% \begin{macro}{\SB@Error}
+% \begin{macro}{\SB@Warn}
+% All errors and warnings will be reported as coming from package ``songs''.
+% \begin{macrocode}
+\newcommand\SB@Error{\PackageError{songs}}
+\newcommand\SB@Warn{\PackageWarning{songs}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SB@errspos}
+% \begin{macrocode}
+\newcommand\SB@errspos{%
+ \SB@Error{Illegal \protect\songpos\space argument}{The argume%
+ nt to \protect\songpos\space must be a number from 0 to 3.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errnse}
+% \begin{macrocode}
+\newcommand\SB@errnse{%
+ \SB@Error{Nested songs environments are not supported}{End th%
+ e previous songs environment before beginning the next one.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errpl}
+% \begin{macrocode}
+\newcommand\SB@errpl{%
+ \SB@Error{\protect\includeonlysongs\space not permitted with%
+ in a songs environment}{\protect\includeonlysongs\space can o%
+ nly be used in the document preamble or between songs environ%
+ ments in the document body.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errrtopt}
+% \begin{macrocode}
+\newcommand\SB@errrtopt{%
+ \SB@Error{Cannot display chords in a rawtext dump}{You have u%
+ sed the rawtext option in the \protect\usepackage\space lin%
+ e and have either used the chorded option as well or have use%
+ d the \protect\chordson\space macro subsequently.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@warnrc}
+% \begin{macrocode}
+\newcommand\SB@warnrc{%
+ \SB@Warn{The \protect\repchoruses\space feature will not wor%
+ k when the number of columns is set to zero}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errboo}
+% \begin{macrocode}
+\newcommand\SB@errboo{%
+ \SB@Error{Encountered \protect\beginsong\space without seein%
+ g an \protect\endsong\space for the previous song}%
+ {Song \thesongnum\space might be missing a%
+ n \protect\endsong\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbor}
+% \begin{macrocode}
+\newcommand\SB@errbor{%
+ \SB@Error{Encountered \protect\beginsong\space without seein%
+ g an \protect\endscripture\space for the preceding scriptur%
+ e quotation}{A scripture quotation appearing after son%
+ g \thesongnum\space might be missing a%
+ n \protect\endscripture\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erreov}
+% \begin{macrocode}
+\newcommand\SB@erreov{%
+ \SB@Error{Encountered \protect\endsong\space without seein%
+ g an \protect\endverse\space for the preceding verse}{Son%
+ g \thesongnum\space has a \protect\beginverse\space%
+ line with no matching \protect\endverse\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erreoc}
+% \begin{macrocode}
+\newcommand\SB@erreoc{%
+ \SB@Error{Encountered \protect\endsong\space without seein%
+ g an \protect\endchorus\space for the preceding chorus}{Son%
+ g \thesongnum\space has a \protect\beginchorus\space%
+ line with no matching \protect\endchorus\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erreor}
+% \begin{macrocode}
+\newcommand\SB@erreor{%
+ \SB@Error{Encountered \protect\endsong\space without seein%
+ g an \protect\endscripture for the preceding scripture quot%
+ e}{A scripture quote appearing before song \thesongnum\space%
+ ended with \protect\endsong\space instead of wit%
+ h \protect\endscripture.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erreot}
+% \begin{macrocode}
+\newcommand\SB@erreot{%
+ \SB@Error{Encountered \protect\endsong\space with no matchin%
+ g \protect\beginsong}{Before song \thesongnum\space there wa%
+ s an \protect\endsong\space with no matchin%
+ g \protect\beginsong.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbvv}
+% \begin{macrocode}
+\newcommand\SB@errbvv{%
+ \SB@Error{Encountered \protect\beginverse\space without seein%
+ g an \protect\endverse\space for the preceding verse}{Son%
+ g \thesongnum\space might have a verse that has n%
+ o \protect\endendverse\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbvc}
+% \begin{macrocode}
+\newcommand\SB@errbvc{%
+ \SB@Error{Encountered \protect\beginverse\space without seein%
+ g an \protect\endchorus\space for the preceding chorus}{Son%
+ g \thesongnum\space might have a chorus that has n%
+ o \protect\endchorus\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbvt}
+% \begin{macrocode}
+\newcommand\SB@errbvt{%
+ \SB@Error{Encountered \protect\beginverse\space without firs%
+ t seeing a \protect\beginsong\space line}{Before son%
+ g \thesongnum, there is a \protect\beginverse\space line no%
+ t contained in any song.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errevc}
+% \begin{macrocode}
+\newcommand\SB@errevc{%
+ \SB@Error{Encountered \protect\endverse\space while process%
+ ing a chorus}{Song \thesongnum\space might hav%
+ e a \protect\beginchorus\space concluded by a%
+ n \protect\endverse\space instead of an \protect\endchorus.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errevo}
+% \begin{macrocode}
+\newcommand\SB@errevo{%
+ \SB@Error{Encountered \protect\endverse\space without firs%
+ t seeing a \protect\beginverse}{Song \thesongnum\space m%
+ ight have an \protect\endverse\space with no matchin%
+ g \protect\beginverse.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errevt}
+% \begin{macrocode}
+\newcommand\SB@errevt{%
+ \SB@Error{Encountered an \protect\endverse\space outside o%
+ f any song}{Before song \thesongnum, there is a%
+ n \protect\endverse\space line not preceded b%
+ y a \protect\beginsong\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erretex}
+% \begin{macrocode}
+\newcommand\SB@erretex{%
+ \SB@Error{The \protect\repchoruses\space feature requires e-%
+ TeX compatibility}{Your version of LaTeX2e does not appear t%
+ o be e-TeX compatible. Find a distribution that includes e-T%
+ eX support in order to use this feature.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbcv}
+% \begin{macrocode}
+\newcommand\SB@errbcv{%
+ \SB@Error{Encountered \protect\beginchorus\space without see%
+ ing an \protect\endverse\space for the preceding verse}{Son%
+ g \thesongnum\space might hav%
+ e a \protect\beginverse\space with no match%
+ ing \protect\endverse.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbcc}
+% \begin{macrocode}
+\newcommand\SB@errbcc{%
+ \SB@Error{Encountered \protect\beginchorus\space without see%
+ ing an \protect\endchorus\space for the preceding chorus}%
+ {Song \thesongnum\space might have a \protect\beginchorus%
+ \space with no matching \protect\endchorus.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbct}
+% \begin{macrocode}
+\newcommand\SB@errbct{%
+ \SB@Error{Encountered \protect\beginchorus\space without see%
+ ing a \protect\beginsong\space line first}{After son%
+ g \thesongnum\space there is a \protect\beginchorus\space%
+ line outside of any song.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errecv}
+% \begin{macrocode}
+\newcommand\SB@errecv{%
+ \SB@Error{Encountered an \protect\endchorus\space while proc%
+ essing a verse}{Song \thesongnum\space might hav%
+ e a \protect\beginverse\space concluded by \protect\endchorus%
+ \space instead of \protect\endverse.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erreco}
+% \begin{macrocode}
+\newcommand\SB@erreco{%
+ \SB@Error{Encountered \protect\endchorus\space without firs%
+ t seeing a \protect\beginchorus}{Song \thesongnum\space m%
+ ight have an \protect\endchorus\space with no match%
+ ing \protect\beginchorus.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errect}
+% \begin{macrocode}
+\newcommand\SB@errect{%
+ \SB@Error{Encountered an \protect\endchorus\space outside o%
+ f any song}{Before song \thesongnum, there is a%
+ n \protect\endchorus\space line not preceded b%
+ y a \protect\beginsong\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbro}
+% \begin{macrocode}
+\newcommand\SB@errbro{%
+ \SB@Error{Missing \protect\endsong}%
+ {Nested song and intersong environments are not supported%
+ . Song \thesongnum\space might be missing a%
+ n \protect\endsong\space line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errbrr}
+% \begin{macrocode}
+\newcommand\SB@errbrr{%
+ \SB@Error{Nested intersong environments are not supported}%
+ {A scripture quote or other intersong environment before s%
+ ong \thesongnum\space is missing its ending line.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errero}
+% \begin{macrocode}
+\newcommand\SB@errero{%
+ \SB@Error{Encountered an \protect\endscripture\space whil%
+ e processing a song}{Song \thesongnum\space ends wit%
+ h \protect\endscripture\space when it should end wit%
+ h \protect\endsong.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errert}
+% \begin{macrocode}
+\newcommand\SB@errert{%
+ \SB@Error{Encountered an \protect\endscripture\space with%
+ out first seeing a \protect\beginscripture}{Before son%
+ g \thesongnum, there is an \protect\endscripture\space w%
+ ith no matching \protect\beginscripture.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errscrip}
+% \begin{macrocode}
+\newcommand\SB@errscrip[1]{%
+ \SB@Error{Encountered a \protect#1\space outside a scriptu%
+ re quote}{\protect#1\space can only appear betwee%
+ n \protect\beginscripture\space an%
+ d \protect\endscripture\space lines.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errchord}
+% \begin{macrocode}
+\newcommand\SB@errchord{%
+ \SB@Error{Song \thesongnum\space seems to have chord%
+ s that appear outside of any verse or chorus}{All chords a%
+ nd lyrics should appear between \protect\beginverse\space%
+ and \protect\endverse, or between \protect\beginchorus\space%
+ and \protect\endchorus.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errreplay}
+% \begin{macrocode}
+\newcommand\SB@errreplay{%
+ \SB@Error{Replayed chord has no matching chord}{Son%
+ g \thesongnum\space uses \protect^ more times than the%
+ re are chords in the previously memorized verse.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errreg}
+% \begin{macrocode}
+\newcommand\SB@errreg[1]{%
+ \SB@Error{Unknown chord-replay register name: #1}{Chord-re%
+ play registers must be declared with \protect\newchords.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errdup}
+% \begin{macrocode}
+\newcommand\SB@errdup[1]{%
+ \SB@Error{Duplicate definition of chord-replay register%
+ : #1}{\protect\newchords\space was used to declare the sa%
+ me chord-replay register twice.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errmbar}
+% \begin{macrocode}
+\newcommand\SB@errmbar{%
+ \SB@Error{Song \thesongnum\space seems to have measur%
+ e bars that appear outside of any verse or chorus}{All mea%
+ sure bars (produced with \protect\mbar\space or |) must ap%
+ pear between \protect\beginverse\space an%
+ d \protect\endverse, or between \protect\beginchorus\space%
+ and \protect\endchorus.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errtab}
+% \begin{macrocode}
+\newcommand\SB@errtab{%
+ \SB@Error{Invalid argument to \protect\gtab\space macro. R%
+ eplacing it with \protect\0.}{Valid arguments consist onl%
+ y of: X, O, 0, 1, 2, 3, or 4.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@errnoidx}
+% \begin{macrocode}
+\newcommand\SB@errnoidx[1]{%
+ \SB@Error{Unknown index identifier: #1}{This index identifie%
+ r was never declared using \protect\newindex.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SB@erridx}
+% \begin{macrocode}
+\newcommand\SB@erridx[1]{%
+ \SB@Error{\protect\idxaltentry\space not allowed in #1 index}%
+ {This error should not occur. The index generation routines ha%
+ ve malfunctioned. Try deleting all temporary files and then re%
+ compiling.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Option Processing}\label{sec:optproc}
+%
+% \begin{macro}{\ifchorded}
+% \begin{macro}{\iflyric}
+% \begin{macro}{\ifslides}
+% \begin{macro}{\ifmeasures}
+% \begin{macro}{\ifpartiallist}
+% \begin{macro}{\ifrepchorus}
+% \begin{macro}{\iftranscapos}
+% \begin{macro}{\ifnolyrics}
+% \begin{macro}{\ifrawtext}
+% \begin{macro}{\ifsongindexes}
+% \begin{macro}{\ifsepindexes}
+% \begin{macro}{\ifpagepreludes}
+% \begin{macro}{\ifSB@colorboxes}
+% \begin{macro}{\ifSB@omitscrip}
+% Reserve conditionals for all of the various option settings.
+% We wait to define these since if any are used earlier than this, it is
+% an error in the package code, and we'd rather get an error than continue.
+% \begin{macrocode}
+\newif\ifchorded
+\newif\iflyric\lyrictrue
+\newif\ifslides
+\newif\ifmeasures
+\newif\ifpartiallist
+\newif\ifrepchorus
+\newif\iftranscapos
+\newif\ifnolyrics
+\newif\ifrawtext
+\newif\ifsongindexes\songindexestrue
+\newif\ifsepindexes\sepindexestrue
+\newif\ifpagepreludes
+\newif\ifSB@colorboxes\SB@colorboxestrue
+\newif\ifSB@omitscrip
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\nolyrics}
+% \begin{macro}{\pagepreludes}
+% The |\nolyrics| and |\pagepreludes| macros are just shorthand for
+% |\nolyricstrue| and |\pagepreludestrue|, respectively.
+% \begin{macrocode}
+\newcommand\nolyrics{}
+\let\nolyrics\nolyricstrue
+\newcommand\pagepreludes{\pagepreludestrue\songpos0}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Finally we're ready to process all of the package options.
+% This is delayed until near the end because the option processing code
+% needs to execute various macros found in the previous sections.
+% \begin{macrocode}
+\SB@chordson
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \begin{macro}{\SB@colorbox}
+% Include the colors package and define colors, if requested.
+% \begin{macrocode}
+\ifSB@colorboxes
+ \RequirePackage{color}
+ \definecolor{SongbookShade}{gray}{.80}
+ \newcommand\SB@colorbox[2]{%
+ \ifx\@empty#1%
+ \vbox{%
+ \kern3\p@%
+ \hbox{\kern3\p@{#2}\kern3\p@}%
+ \kern3\p@%
+ }%
+ \else%
+ \colorbox{#1}{#2}%
+ \fi%
+ }
+\else
+ \newcommand\SB@colorbox[2]{\vbox{%
+ \kern3\p@%
+ \hbox{\kern3\p@{#2}\kern3\p@}%
+ \kern3\p@%
+ }}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Rawtext Mode}
+%
+% If generating raw text, most of what has been defined previously is ignored
+% in favor of some very specialized macros that write all the song lyrics to
+% a text file.
+% \begin{macrocode}
+\ifrawtext
+ \SB@newwrite\SB@txtout
+ \immediate\openout\SB@txtout=\jobname.txt
+ \newif\ifSB@doEOL
+ {\catcode`\^^M12 %
+ \catcode`\^^J12 %
+ \gdef\SB@printEOL{\ifSB@doEOL^^M^^J\fi}}
+ {\catcode`#12\gdef\SB@hash{#}}
+ {\catcode`&12\gdef\SB@amp{&}}
+ \renewcommand\SB@@@beginsong{%
+ \begingroup%
+ \def\'{}\def\`{}\def\v{}\def\u{}\def\={}\def\^{}%
+ \def\.{}\def\H{}\def\~{}\def\"{}\def\t{}%
+ \def\copyright{(c)}%
+ \let~\space%
+ \let\par\SB@printEOL%
+ \let\#\SB@hash%
+ \let\&\SB@amp%
+ \catcode`|9 %
+ \catcode`*9 %
+ \catcode`^9 %
+ \def\[##1]{}%
+ \resettitles%
+ \immediate\write\SB@txtout{\thesongnum. \songtitle}%
+ \nexttitle%
+ \foreachtitle{\immediate\write\SB@txtout{(\songtitle)}}%
+ \ifx\songauthors\@empty\else%
+ \immediate\write\SB@txtout{\songauthors}%
+ \fi%
+ \ifx\SB@rawrefs\@empty\else%
+ \immediate\write\SB@txtout{\SB@rawrefs}%
+ \fi%
+ \immediate\write\SB@txtout{}%
+ \SB@doEOLfalse%
+ \obeylines%
+ }
+ \renewcommand\SB@endsong{%
+ \SB@doEOLtrue%
+ \immediate\write\SB@txtout{\songcopyright\space%
+ \songlicense\SB@printEOL}%
+ \endgroup%
+ \SB@insongfalse%
+ \stepcounter{songnum}%
+ }
+ \def\SB@parsesrefs#1{\def\songrefs{#1}}
+ \long\def\beginverse#1#2\endverse{%
+ \SB@doEOLtrue\begingroup%
+ \def\textnote##1{##1}%
+ \def\SB@temp{#1}%
+ \def\SB@star{*}%
+ \ifx\SB@temp\SB@star%
+ \immediate\write\SB@txtout{\@gobble#2}%
+ \else%
+ \immediate\write\SB@txtout{#2}%
+ \fi%
+ \endgroup\SB@doEOLfalse}
+ \long\def\beginchorus#1\endchorus{%
+ \SB@doEOLtrue\begingroup%
+ \def\textnote##1{##1}%
+ \immediate\write\SB@txtout{Chorus:#1}%
+ \endgroup\SB@doEOLfalse}
+ \long\def\beginscripture#1\endscripture{}
+ \def\musicnote#1{}
+ \def\textnote#1{%
+ \SB@doEOLtrue%
+ \immediate\write\SB@txtout{#1\SB@printEOL}%
+ \SB@doEOLfalse}
+ \def\brk{}
+ \def\rep#1{(x#1)}
+ \def\echo#1{(#1)}
+ \def\mbar#1#2{}
+ \def\lrep{}
+ \def\rrep{}
+ \def\nolyrics{}
+ \renewcommand\memorize[1][]{}
+ \renewcommand\replay[1][]{}
+\fi
+% \end{macrocode}
+%
+% \Finale
+\endinput
+
diff --git a/Build/source/utils/songs/songs-2.17/src/songs/songs.ins b/Build/source/utils/songs/songs-2.17/src/songs/songs.ins
new file mode 100644
index 00000000000..6a461051aab
--- /dev/null
+++ b/Build/source/utils/songs/songs-2.17/src/songs/songs.ins
@@ -0,0 +1,61 @@
+%% Copyright (C) 2013 Kevin W. Hamlen
+%%
+%% This program is free software; you can redistribute it and/or
+%% modify it under the terms of the GNU General Public License
+%% as published by the Free Software Foundation; either version 2
+%% of the License, or (at your option) any later version.
+%%
+%% This program is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%% GNU General Public License for more details.
+%%
+%% You should have received a copy of the GNU General Public License
+%% along with this program; if not, write to the Free Software
+%% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+%% MA 02110-1301, USA.
+%%
+%% The latest version of this program can be obtained from
+%% http://songs.sourceforge.net.
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/songs}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2013 by Kevin W. Hamlen
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3a of this license
+or (at your option) any later version. The latest version of this
+license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3a or later is part of all distributions of LaTeX version
+2004/10/01 or later.
+
+\endpreamble
+
+\generate{\file{songs.sty}{\from{songs.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* songs.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file songbook.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/Build/source/utils/songs/tests/myauth.sbx b/Build/source/utils/songs/tests/myauth.sbx
new file mode 100644
index 00000000000..0bd7cf614b2
--- /dev/null
+++ b/Build/source/utils/songs/tests/myauth.sbx
@@ -0,0 +1,4 @@
+\begin{idxblock}{}
+\idxentry{Bourgeois, Louis}{\songlink{song1-1.2}{1}}
+\idxentry{Ken, Thomas}{\songlink{song1-1.2}{1}}
+\end{idxblock}
diff --git a/Build/source/utils/songs/tests/myauth.sxd b/Build/source/utils/songs/tests/myauth.sxd
new file mode 100644
index 00000000000..98a3c37a6c6
--- /dev/null
+++ b/Build/source/utils/songs/tests/myauth.sxd
@@ -0,0 +1,4 @@
+AUTHOR INDEX DATA FILE
+Louis Bourgeois and Thomas Ken
+1
+song1-1.2
diff --git a/Build/source/utils/songs/tests/mybook.tex b/Build/source/utils/songs/tests/mybook.tex
new file mode 100644
index 00000000000..a640696039d
--- /dev/null
+++ b/Build/source/utils/songs/tests/mybook.tex
@@ -0,0 +1,32 @@
+\documentclass{article}
+\usepackage[chorded]{songs}
+%
+\newindex{titleidx}{mytitle}
+\newauthorindex{authidx}{myauth}
+\newscripindex{scripidx}{myscrip}
+%
+\noversenumbers
+%
+\begin{document}
+\showindex{Complete Index of Songs}{titleidx}
+\songsection{Worship Songs}
+%
+\begin{songs}{titleidx,authidx,scripidx}
+\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
+ sr={Revelation 5:13},
+ cr={Public domain.},
+ index={Praise God, from Whom all blessings flow}]
+\beginverse
+\[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;
+\[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;
+\[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav'n\[D]ly \[Em]host;
+\[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.
+\[C]A\[G]men.
+\endverse
+\endsong
+\end{songs}
+%
+\showindex{Index of Authors and Composers}{authidx}
+\showindex{Index of Scripture}{scripidx}
+%
+\end{document}
diff --git a/Build/source/utils/songs/tests/myscrip.sbx b/Build/source/utils/songs/tests/myscrip.sbx
new file mode 100644
index 00000000000..02ebdcab543
--- /dev/null
+++ b/Build/source/utils/songs/tests/myscrip.sbx
@@ -0,0 +1,3 @@
+\begin{idxblock}{Revelation}
+\idxentry{5:13}{\songlink{song1-1.2}{1}}
+\end{idxblock}
diff --git a/Build/source/utils/songs/tests/myscrip.sxd b/Build/source/utils/songs/tests/myscrip.sxd
new file mode 100644
index 00000000000..a700835bf12
--- /dev/null
+++ b/Build/source/utils/songs/tests/myscrip.sxd
@@ -0,0 +1,4 @@
+SCRIPTURE INDEX DATA FILE
+Revelation 5:13
+1
+song1-1.2
diff --git a/Build/source/utils/songs/tests/mytitle.sbx b/Build/source/utils/songs/tests/mytitle.sbx
new file mode 100644
index 00000000000..a89b5740513
--- /dev/null
+++ b/Build/source/utils/songs/tests/mytitle.sbx
@@ -0,0 +1,6 @@
+\begin{idxblock}{D}
+\idxentry{Doxology}{\songlink{song1-1.2}{1}}
+\end{idxblock}
+\begin{idxblock}{P}
+\idxaltentry{Praise God, from Whom all blessings flow}{\songlink{song1-1.2}{1}}
+\end{idxblock}
diff --git a/Build/source/utils/songs/tests/mytitle.sxd b/Build/source/utils/songs/tests/mytitle.sxd
new file mode 100644
index 00000000000..7369db5c9b8
--- /dev/null
+++ b/Build/source/utils/songs/tests/mytitle.sxd
@@ -0,0 +1,7 @@
+TITLE INDEX DATA FILE
+*Praise God, from Whom all blessings flow
+1
+song1-1.2
+Doxology
+1
+song1-1.2
diff --git a/Build/source/utils/songs/version.ac b/Build/source/utils/songs/version.ac
new file mode 100644
index 00000000000..c1041443fb8
--- /dev/null
+++ b/Build/source/utils/songs/version.ac
@@ -0,0 +1,11 @@
+dnl
+dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl --------------------------------------------------------
+dnl
+dnl m4-include this file to define the current songs version
+m4_define([songs_version], [2.17])