# PaCkAgE DaTaStReAm
automake 1 4166
# end of header
07070100024f30000081a400000000000000000000000153157abc00000114000001000001014cffffffffffffffff0000001100000000automake/pkginfo PKG=automake
NAME=GNU automake 1.13.2 SPARC 32bit Solaris 8
VERSION=1.13.2
PSTAMP=4th March 2014
VENDOR=GNU
EMAIL=http://www.gnu.org/software/automake/
DESC=GNU automake makefile generator
ARCH=sparc
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
07070100024f2f000081a400000000000000000000000153157abc00002e69000001000001014cffffffffffffffff0000001000000000automake/pkgmap : 1 4166
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/bin 0755 root root
1 f none /usr/local/bin/aclocal 0755 root root 36785 382 1393916586
1 l none /usr/local/bin/aclocal-1.13=/usr/local/bin/aclocal
1 l none /usr/local/bin/automake=/usr/local/bin/automake-1.13
1 f none /usr/local/bin/automake-1.13 0755 root root 252243 30751 1393916586
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/aclocal 0755 root root
1 d none /usr/local/share/aclocal-1.13 0755 root root
1 f none /usr/local/share/aclocal-1.13/amversion.m4 0644 root root 1617 60977 1393916591
1 f none /usr/local/share/aclocal-1.13/ar-lib.m4 0644 root root 2029 27701 1393916592
1 f none /usr/local/share/aclocal-1.13/as.m4 0644 root root 767 61761 1393916592
1 f none /usr/local/share/aclocal-1.13/auxdir.m4 0644 root root 2430 11928 1393916592
1 f none /usr/local/share/aclocal-1.13/cond-if.m4 0644 root root 1030 12795 1393916592
1 f none /usr/local/share/aclocal-1.13/cond.m4 0644 root root 1036 11926 1393916592
1 f none /usr/local/share/aclocal-1.13/depend.m4 0644 root root 7281 61084 1393916592
1 f none /usr/local/share/aclocal-1.13/depout.m4 0644 root root 2998 37916 1393916592
1 f none /usr/local/share/aclocal-1.13/dmalloc.m4 0644 root root 906 2508 1393916592
1 f none /usr/local/share/aclocal-1.13/extra-recurs.m4 0644 root root 738 60867 1393916592
1 f none /usr/local/share/aclocal-1.13/gcj.m4 0644 root root 649 51179 1393916592
1 f none /usr/local/share/aclocal-1.13/init.m4 0644 root root 5914 16722 1393916592
1 f none /usr/local/share/aclocal-1.13/install-sh.m4 0644 root root 677 51951 1393916593
1 d none /usr/local/share/aclocal-1.13/internal 0755 root root
1 f none /usr/local/share/aclocal-1.13/internal/ac-config-macro-dirs.m4 0644 root root 667 55180 1393916594
1 f none /usr/local/share/aclocal-1.13/lead-dot.m4 0644 root root 641 51920 1393916593
1 f none /usr/local/share/aclocal-1.13/lex.m4 0644 root root 689 55553 1393916593
1 f none /usr/local/share/aclocal-1.13/lispdir.m4 0644 root root 2152 39789 1393916593
1 f none /usr/local/share/aclocal-1.13/maintainer.m4 0644 root root 1656 6292 1393916593
1 f none /usr/local/share/aclocal-1.13/make.m4 0644 root root 1335 44062 1393916593
1 f none /usr/local/share/aclocal-1.13/minuso.m4 0644 root root 1283 36847 1393916593
1 f none /usr/local/share/aclocal-1.13/missing.m4 0644 root root 1155 26166 1393916593
1 f none /usr/local/share/aclocal-1.13/mkdirp.m4 0644 root root 1349 44628 1393916593
1 f none /usr/local/share/aclocal-1.13/obsolete.m4 0644 root root 1008 19750 1393916593
1 f none /usr/local/share/aclocal-1.13/options.m4 0644 root root 1090 16672 1393916593
1 f none /usr/local/share/aclocal-1.13/python.m4 0644 root root 9082 27581 1393916594
1 f none /usr/local/share/aclocal-1.13/runlog.m4 0644 root root 718 53895 1393916594
1 f none /usr/local/share/aclocal-1.13/sanity.m4 0644 root root 2646 21139 1393916594
1 f none /usr/local/share/aclocal-1.13/silent.m4 0644 root root 1911 20361 1393916594
1 f none /usr/local/share/aclocal-1.13/strip.m4 0644 root root 1392 50756 1393916594
1 f none /usr/local/share/aclocal-1.13/substnot.m4 0644 root root 675 50009 1393916594
1 f none /usr/local/share/aclocal-1.13/tar.m4 0644 root root 4471 20681 1393916594
1 f none /usr/local/share/aclocal-1.13/upc.m4 0644 root root 836 3458 1393916594
1 f none /usr/local/share/aclocal-1.13/vala.m4 0644 root root 1655 64477 1393916594
1 f none /usr/local/share/aclocal/README 0644 root root 368 33352 1393916598
1 d none /usr/local/share/automake-1.13 0755 root root
1 d none /usr/local/share/automake-1.13/Automake 0755 root root
1 f none /usr/local/share/automake-1.13/Automake/ChannelDefs.pm 0644 root root 11241 54610 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Channels.pm 0644 root root 20955 34274 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Condition.pm 0644 root root 15661 19580 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Config.pm 0644 root root 1806 17046 1393916600
1 f none /usr/local/share/automake-1.13/Automake/Configure_ac.pm 0644 root root 3458 19287 1393916595
1 f none /usr/local/share/automake-1.13/Automake/DisjConditions.pm 0644 root root 14791 24399 1393916595
1 f none /usr/local/share/automake-1.13/Automake/FileUtils.pm 0644 root root 9582 31852 1393916595
1 f none /usr/local/share/automake-1.13/Automake/General.pm 0644 root root 2193 46857 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Getopt.pm 0644 root root 2779 29727 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Item.pm 0644 root root 4613 46974 1393916596
1 f none /usr/local/share/automake-1.13/Automake/ItemDef.pm 0644 root root 2458 8558 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Location.pm 0644 root root 5983 34225 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Options.pm 0644 root root 11295 59933 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Rule.pm 0644 root root 24673 64686 1393916596
1 f none /usr/local/share/automake-1.13/Automake/RuleDef.pm 0644 root root 2762 31763 1393916596
1 f none /usr/local/share/automake-1.13/Automake/VarDef.pm 0644 root root 9043 10478 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Variable.pm 0644 root root 46296 9463 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Version.pm 0644 root root 4353 25336 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Wrap.pm 0644 root root 4215 13016 1393916596
1 f none /usr/local/share/automake-1.13/Automake/XFile.pm 0644 root root 7945 40151 1393916596
1 f none /usr/local/share/automake-1.13/COPYING 0644 root root 35147 30328 1393916597
1 f none /usr/local/share/automake-1.13/INSTALL 0644 root root 15749 11782 1393916597
1 d none /usr/local/share/automake-1.13/am 0755 root root
1 f none /usr/local/share/automake-1.13/am/check.am 0644 root root 21963 14493 1393916588
1 f none /usr/local/share/automake-1.13/am/check2.am 0644 root root 2195 41843 1393916588
1 f none /usr/local/share/automake-1.13/am/clean-hdr.am 0644 root root 818 3705 1393916588
1 f none /usr/local/share/automake-1.13/am/clean.am 0644 root root 2331 2979 1393916588
1 f none /usr/local/share/automake-1.13/am/compile.am 0644 root root 1010 19490 1393916588
1 f none /usr/local/share/automake-1.13/am/configure.am 0644 root root 6608 5393 1393916588
1 f none /usr/local/share/automake-1.13/am/data.am 0644 root root 3398 55021 1393916588
1 f none /usr/local/share/automake-1.13/am/dejagnu.am 0644 root root 3667 33293 1393916588
1 f none /usr/local/share/automake-1.13/am/depend.am 0644 root root 1039 22692 1393916588
1 f none /usr/local/share/automake-1.13/am/depend2.am 0644 root root 7412 31955 1393916588
1 f none /usr/local/share/automake-1.13/am/distdir.am 0644 root root 20793 20616 1393916589
1 f none /usr/local/share/automake-1.13/am/footer.am 0644 root root 881 8968 1393916589
1 f none /usr/local/share/automake-1.13/am/header-vars.am 0644 root root 5593 63008 1393916589
1 f none /usr/local/share/automake-1.13/am/header.am 0644 root root 786 993 1393916589
1 f none /usr/local/share/automake-1.13/am/inst-vars.am 0644 root root 3472 24288 1393916589
1 f none /usr/local/share/automake-1.13/am/install.am 0644 root root 3993 64966 1393916589
1 f none /usr/local/share/automake-1.13/am/java.am 0644 root root 2860 10147 1393916589
1 f none /usr/local/share/automake-1.13/am/lang-compile.am 0644 root root 1197 28238 1393916589
1 f none /usr/local/share/automake-1.13/am/lex.am 0644 root root 1323 39143 1393916589
1 f none /usr/local/share/automake-1.13/am/library.am 0644 root root 976 12393 1393916589
1 f none /usr/local/share/automake-1.13/am/libs.am 0644 root root 3889 28200 1393916590
1 f none /usr/local/share/automake-1.13/am/libtool.am 0644 root root 1030 22960 1393916590
1 f none /usr/local/share/automake-1.13/am/lisp.am 0644 root root 4112 45173 1393916590
1 f none /usr/local/share/automake-1.13/am/ltlib.am 0644 root root 4993 36768 1393916590
1 f none /usr/local/share/automake-1.13/am/ltlibrary.am 0644 root root 933 9783 1393916590
1 f none /usr/local/share/automake-1.13/am/mans-vars.am 0644 root root 857 6650 1393916590
1 f none /usr/local/share/automake-1.13/am/mans.am 0644 root root 6493 37010 1393916590
1 f none /usr/local/share/automake-1.13/am/program.am 0644 root root 1231 35595 1393916590
1 f none /usr/local/share/automake-1.13/am/progs.am 0644 root root 6390 17235 1393916590
1 f none /usr/local/share/automake-1.13/am/python.am 0644 root root 5216 536 1393916590
1 f none /usr/local/share/automake-1.13/am/remake-hdr.am 0644 root root 3258 9565 1393916590
1 f none /usr/local/share/automake-1.13/am/scripts.am 0644 root root 4713 21507 1393916591
1 f none /usr/local/share/automake-1.13/am/subdirs.am 0644 root root 2868 43239 1393916591
1 f none /usr/local/share/automake-1.13/am/tags.am 0644 root root 5161 5911 1393916591
1 f none /usr/local/share/automake-1.13/am/texi-vers.am 0644 root root 2406 62212 1393916591
1 f none /usr/local/share/automake-1.13/am/texibuild.am 0644 root root 6622 62157 1393916591
1 f none /usr/local/share/automake-1.13/am/texinfos.am 0644 root root 13437 43762 1393916591
1 f none /usr/local/share/automake-1.13/am/vala.am 0644 root root 768 64727 1393916591
1 f none /usr/local/share/automake-1.13/am/yacc.am 0644 root root 2404 63923 1393916591
1 f none /usr/local/share/automake-1.13/ar-lib 0755 root root 5826 50810 1393916598
1 f none /usr/local/share/automake-1.13/compile 0755 root root 7333 36792 1393916598
1 f none /usr/local/share/automake-1.13/config.guess 0755 root root 44922 1037 1393916597
1 f none /usr/local/share/automake-1.13/config.sub 0755 root root 35521 15491 1393916597
1 f none /usr/local/share/automake-1.13/depcomp 0755 root root 23491 21333 1393916598
1 f none /usr/local/share/automake-1.13/install-sh 0755 root root 13997 26788 1393916597
1 f none /usr/local/share/automake-1.13/mdate-sh 0755 root root 6047 33216 1393916597
1 f none /usr/local/share/automake-1.13/missing 0755 root root 6873 30733 1393916597
1 f none /usr/local/share/automake-1.13/mkinstalldirs 0755 root root 3538 65365 1393916597
1 f none /usr/local/share/automake-1.13/py-compile 0755 root root 4670 49002 1393916598
1 f none /usr/local/share/automake-1.13/tap-driver.pl 0755 root root 15285 16504 1393916598
1 f none /usr/local/share/automake-1.13/tap-driver.sh 0755 root root 19514 43151 1393916598
1 f none /usr/local/share/automake-1.13/test-driver 0755 root root 3977 3091 1393916598
1 f none /usr/local/share/automake-1.13/texinfo.tex 0644 root root 323102 52862 1393916597
1 f none /usr/local/share/automake-1.13/ylwrap 0755 root root 7006 22102 1393916598
1 d none /usr/local/share/doc 0755 root other
1 d none /usr/local/share/doc/automake 0755 root root
1 f none /usr/local/share/doc/automake/amhello-1.0.tar.gz 0644 root root 77423 41621 1393916595
1 d none /usr/local/share/info 0755 root other
1 f none /usr/local/share/info/automake-history.info 0644 root root 78473 58602 1393916599
1 f none /usr/local/share/info/automake.info 0644 root root 7647 48858 1393916599
1 f none /usr/local/share/info/automake.info-1 0644 root root 298077 6892 1393916599
1 f none /usr/local/share/info/automake.info-2 0644 root root 231712 12899 1393916599
1 f none /usr/local/share/info/automake.info-3 0644 root root 74226 29370 1393916599
1 f none /usr/local/share/info/dir 0644 root root 3344 55400 1393916599
1 d none /usr/local/share/man 0755 root other
1 d none /usr/local/share/man/man1 0755 root other
1 f none /usr/local/share/man/man1/aclocal-1.13.1 0644 root root 2397 8378 1393916600
1 f none /usr/local/share/man/man1/aclocal.1 0644 root root 24 1780 1393916599
1 f none /usr/local/share/man/man1/automake-1.13.1 0644 root root 3585 36987 1393916600
1 f none /usr/local/share/man/man1/automake.1 0644 root root 25 1916 1393916600
1 i checkinstall 784 2519 1393916604
1 i pkginfo 276 21461 1393916604
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!! 07070100024f30000081a400000000000000000000000153157abc00000114000001000001014cffffffffffffffff0000000800000000pkginfo PKG=automake
NAME=GNU automake 1.13.2 SPARC 32bit Solaris 8
VERSION=1.13.2
PSTAMP=4th March 2014
VENDOR=GNU
EMAIL=http://www.gnu.org/software/automake/
DESC=GNU automake makefile generator
ARCH=sparc
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
07070100024f2f000081a400000000000000000000000153157abc00002e69000001000001014cffffffffffffffff0000000700000000pkgmap : 1 4166
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/bin 0755 root root
1 f none /usr/local/bin/aclocal 0755 root root 36785 382 1393916586
1 l none /usr/local/bin/aclocal-1.13=/usr/local/bin/aclocal
1 l none /usr/local/bin/automake=/usr/local/bin/automake-1.13
1 f none /usr/local/bin/automake-1.13 0755 root root 252243 30751 1393916586
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/aclocal 0755 root root
1 d none /usr/local/share/aclocal-1.13 0755 root root
1 f none /usr/local/share/aclocal-1.13/amversion.m4 0644 root root 1617 60977 1393916591
1 f none /usr/local/share/aclocal-1.13/ar-lib.m4 0644 root root 2029 27701 1393916592
1 f none /usr/local/share/aclocal-1.13/as.m4 0644 root root 767 61761 1393916592
1 f none /usr/local/share/aclocal-1.13/auxdir.m4 0644 root root 2430 11928 1393916592
1 f none /usr/local/share/aclocal-1.13/cond-if.m4 0644 root root 1030 12795 1393916592
1 f none /usr/local/share/aclocal-1.13/cond.m4 0644 root root 1036 11926 1393916592
1 f none /usr/local/share/aclocal-1.13/depend.m4 0644 root root 7281 61084 1393916592
1 f none /usr/local/share/aclocal-1.13/depout.m4 0644 root root 2998 37916 1393916592
1 f none /usr/local/share/aclocal-1.13/dmalloc.m4 0644 root root 906 2508 1393916592
1 f none /usr/local/share/aclocal-1.13/extra-recurs.m4 0644 root root 738 60867 1393916592
1 f none /usr/local/share/aclocal-1.13/gcj.m4 0644 root root 649 51179 1393916592
1 f none /usr/local/share/aclocal-1.13/init.m4 0644 root root 5914 16722 1393916592
1 f none /usr/local/share/aclocal-1.13/install-sh.m4 0644 root root 677 51951 1393916593
1 d none /usr/local/share/aclocal-1.13/internal 0755 root root
1 f none /usr/local/share/aclocal-1.13/internal/ac-config-macro-dirs.m4 0644 root root 667 55180 1393916594
1 f none /usr/local/share/aclocal-1.13/lead-dot.m4 0644 root root 641 51920 1393916593
1 f none /usr/local/share/aclocal-1.13/lex.m4 0644 root root 689 55553 1393916593
1 f none /usr/local/share/aclocal-1.13/lispdir.m4 0644 root root 2152 39789 1393916593
1 f none /usr/local/share/aclocal-1.13/maintainer.m4 0644 root root 1656 6292 1393916593
1 f none /usr/local/share/aclocal-1.13/make.m4 0644 root root 1335 44062 1393916593
1 f none /usr/local/share/aclocal-1.13/minuso.m4 0644 root root 1283 36847 1393916593
1 f none /usr/local/share/aclocal-1.13/missing.m4 0644 root root 1155 26166 1393916593
1 f none /usr/local/share/aclocal-1.13/mkdirp.m4 0644 root root 1349 44628 1393916593
1 f none /usr/local/share/aclocal-1.13/obsolete.m4 0644 root root 1008 19750 1393916593
1 f none /usr/local/share/aclocal-1.13/options.m4 0644 root root 1090 16672 1393916593
1 f none /usr/local/share/aclocal-1.13/python.m4 0644 root root 9082 27581 1393916594
1 f none /usr/local/share/aclocal-1.13/runlog.m4 0644 root root 718 53895 1393916594
1 f none /usr/local/share/aclocal-1.13/sanity.m4 0644 root root 2646 21139 1393916594
1 f none /usr/local/share/aclocal-1.13/silent.m4 0644 root root 1911 20361 1393916594
1 f none /usr/local/share/aclocal-1.13/strip.m4 0644 root root 1392 50756 1393916594
1 f none /usr/local/share/aclocal-1.13/substnot.m4 0644 root root 675 50009 1393916594
1 f none /usr/local/share/aclocal-1.13/tar.m4 0644 root root 4471 20681 1393916594
1 f none /usr/local/share/aclocal-1.13/upc.m4 0644 root root 836 3458 1393916594
1 f none /usr/local/share/aclocal-1.13/vala.m4 0644 root root 1655 64477 1393916594
1 f none /usr/local/share/aclocal/README 0644 root root 368 33352 1393916598
1 d none /usr/local/share/automake-1.13 0755 root root
1 d none /usr/local/share/automake-1.13/Automake 0755 root root
1 f none /usr/local/share/automake-1.13/Automake/ChannelDefs.pm 0644 root root 11241 54610 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Channels.pm 0644 root root 20955 34274 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Condition.pm 0644 root root 15661 19580 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Config.pm 0644 root root 1806 17046 1393916600
1 f none /usr/local/share/automake-1.13/Automake/Configure_ac.pm 0644 root root 3458 19287 1393916595
1 f none /usr/local/share/automake-1.13/Automake/DisjConditions.pm 0644 root root 14791 24399 1393916595
1 f none /usr/local/share/automake-1.13/Automake/FileUtils.pm 0644 root root 9582 31852 1393916595
1 f none /usr/local/share/automake-1.13/Automake/General.pm 0644 root root 2193 46857 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Getopt.pm 0644 root root 2779 29727 1393916595
1 f none /usr/local/share/automake-1.13/Automake/Item.pm 0644 root root 4613 46974 1393916596
1 f none /usr/local/share/automake-1.13/Automake/ItemDef.pm 0644 root root 2458 8558 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Location.pm 0644 root root 5983 34225 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Options.pm 0644 root root 11295 59933 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Rule.pm 0644 root root 24673 64686 1393916596
1 f none /usr/local/share/automake-1.13/Automake/RuleDef.pm 0644 root root 2762 31763 1393916596
1 f none /usr/local/share/automake-1.13/Automake/VarDef.pm 0644 root root 9043 10478 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Variable.pm 0644 root root 46296 9463 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Version.pm 0644 root root 4353 25336 1393916596
1 f none /usr/local/share/automake-1.13/Automake/Wrap.pm 0644 root root 4215 13016 1393916596
1 f none /usr/local/share/automake-1.13/Automake/XFile.pm 0644 root root 7945 40151 1393916596
1 f none /usr/local/share/automake-1.13/COPYING 0644 root root 35147 30328 1393916597
1 f none /usr/local/share/automake-1.13/INSTALL 0644 root root 15749 11782 1393916597
1 d none /usr/local/share/automake-1.13/am 0755 root root
1 f none /usr/local/share/automake-1.13/am/check.am 0644 root root 21963 14493 1393916588
1 f none /usr/local/share/automake-1.13/am/check2.am 0644 root root 2195 41843 1393916588
1 f none /usr/local/share/automake-1.13/am/clean-hdr.am 0644 root root 818 3705 1393916588
1 f none /usr/local/share/automake-1.13/am/clean.am 0644 root root 2331 2979 1393916588
1 f none /usr/local/share/automake-1.13/am/compile.am 0644 root root 1010 19490 1393916588
1 f none /usr/local/share/automake-1.13/am/configure.am 0644 root root 6608 5393 1393916588
1 f none /usr/local/share/automake-1.13/am/data.am 0644 root root 3398 55021 1393916588
1 f none /usr/local/share/automake-1.13/am/dejagnu.am 0644 root root 3667 33293 1393916588
1 f none /usr/local/share/automake-1.13/am/depend.am 0644 root root 1039 22692 1393916588
1 f none /usr/local/share/automake-1.13/am/depend2.am 0644 root root 7412 31955 1393916588
1 f none /usr/local/share/automake-1.13/am/distdir.am 0644 root root 20793 20616 1393916589
1 f none /usr/local/share/automake-1.13/am/footer.am 0644 root root 881 8968 1393916589
1 f none /usr/local/share/automake-1.13/am/header-vars.am 0644 root root 5593 63008 1393916589
1 f none /usr/local/share/automake-1.13/am/header.am 0644 root root 786 993 1393916589
1 f none /usr/local/share/automake-1.13/am/inst-vars.am 0644 root root 3472 24288 1393916589
1 f none /usr/local/share/automake-1.13/am/install.am 0644 root root 3993 64966 1393916589
1 f none /usr/local/share/automake-1.13/am/java.am 0644 root root 2860 10147 1393916589
1 f none /usr/local/share/automake-1.13/am/lang-compile.am 0644 root root 1197 28238 1393916589
1 f none /usr/local/share/automake-1.13/am/lex.am 0644 root root 1323 39143 1393916589
1 f none /usr/local/share/automake-1.13/am/library.am 0644 root root 976 12393 1393916589
1 f none /usr/local/share/automake-1.13/am/libs.am 0644 root root 3889 28200 1393916590
1 f none /usr/local/share/automake-1.13/am/libtool.am 0644 root root 1030 22960 1393916590
1 f none /usr/local/share/automake-1.13/am/lisp.am 0644 root root 4112 45173 1393916590
1 f none /usr/local/share/automake-1.13/am/ltlib.am 0644 root root 4993 36768 1393916590
1 f none /usr/local/share/automake-1.13/am/ltlibrary.am 0644 root root 933 9783 1393916590
1 f none /usr/local/share/automake-1.13/am/mans-vars.am 0644 root root 857 6650 1393916590
1 f none /usr/local/share/automake-1.13/am/mans.am 0644 root root 6493 37010 1393916590
1 f none /usr/local/share/automake-1.13/am/program.am 0644 root root 1231 35595 1393916590
1 f none /usr/local/share/automake-1.13/am/progs.am 0644 root root 6390 17235 1393916590
1 f none /usr/local/share/automake-1.13/am/python.am 0644 root root 5216 536 1393916590
1 f none /usr/local/share/automake-1.13/am/remake-hdr.am 0644 root root 3258 9565 1393916590
1 f none /usr/local/share/automake-1.13/am/scripts.am 0644 root root 4713 21507 1393916591
1 f none /usr/local/share/automake-1.13/am/subdirs.am 0644 root root 2868 43239 1393916591
1 f none /usr/local/share/automake-1.13/am/tags.am 0644 root root 5161 5911 1393916591
1 f none /usr/local/share/automake-1.13/am/texi-vers.am 0644 root root 2406 62212 1393916591
1 f none /usr/local/share/automake-1.13/am/texibuild.am 0644 root root 6622 62157 1393916591
1 f none /usr/local/share/automake-1.13/am/texinfos.am 0644 root root 13437 43762 1393916591
1 f none /usr/local/share/automake-1.13/am/vala.am 0644 root root 768 64727 1393916591
1 f none /usr/local/share/automake-1.13/am/yacc.am 0644 root root 2404 63923 1393916591
1 f none /usr/local/share/automake-1.13/ar-lib 0755 root root 5826 50810 1393916598
1 f none /usr/local/share/automake-1.13/compile 0755 root root 7333 36792 1393916598
1 f none /usr/local/share/automake-1.13/config.guess 0755 root root 44922 1037 1393916597
1 f none /usr/local/share/automake-1.13/config.sub 0755 root root 35521 15491 1393916597
1 f none /usr/local/share/automake-1.13/depcomp 0755 root root 23491 21333 1393916598
1 f none /usr/local/share/automake-1.13/install-sh 0755 root root 13997 26788 1393916597
1 f none /usr/local/share/automake-1.13/mdate-sh 0755 root root 6047 33216 1393916597
1 f none /usr/local/share/automake-1.13/missing 0755 root root 6873 30733 1393916597
1 f none /usr/local/share/automake-1.13/mkinstalldirs 0755 root root 3538 65365 1393916597
1 f none /usr/local/share/automake-1.13/py-compile 0755 root root 4670 49002 1393916598
1 f none /usr/local/share/automake-1.13/tap-driver.pl 0755 root root 15285 16504 1393916598
1 f none /usr/local/share/automake-1.13/tap-driver.sh 0755 root root 19514 43151 1393916598
1 f none /usr/local/share/automake-1.13/test-driver 0755 root root 3977 3091 1393916598
1 f none /usr/local/share/automake-1.13/texinfo.tex 0644 root root 323102 52862 1393916597
1 f none /usr/local/share/automake-1.13/ylwrap 0755 root root 7006 22102 1393916598
1 d none /usr/local/share/doc 0755 root other
1 d none /usr/local/share/doc/automake 0755 root root
1 f none /usr/local/share/doc/automake/amhello-1.0.tar.gz 0644 root root 77423 41621 1393916595
1 d none /usr/local/share/info 0755 root other
1 f none /usr/local/share/info/automake-history.info 0644 root root 78473 58602 1393916599
1 f none /usr/local/share/info/automake.info 0644 root root 7647 48858 1393916599
1 f none /usr/local/share/info/automake.info-1 0644 root root 298077 6892 1393916599
1 f none /usr/local/share/info/automake.info-2 0644 root root 231712 12899 1393916599
1 f none /usr/local/share/info/automake.info-3 0644 root root 74226 29370 1393916599
1 f none /usr/local/share/info/dir 0644 root root 3344 55400 1393916599
1 d none /usr/local/share/man 0755 root other
1 d none /usr/local/share/man/man1 0755 root other
1 f none /usr/local/share/man/man1/aclocal-1.13.1 0644 root root 2397 8378 1393916600
1 f none /usr/local/share/man/man1/aclocal.1 0644 root root 24 1780 1393916599
1 f none /usr/local/share/man/man1/automake-1.13.1 0644 root root 3585 36987 1393916600
1 f none /usr/local/share/man/man1/automake.1 0644 root root 25 1916 1393916600
1 i checkinstall 784 2519 1393916604
1 i pkginfo 276 21461 1393916604
07070100024fbc000041ed00000000000000000000000253157abd00000000000001000001014cffffffffffffffff0000000800000000install 07070100024fbd000081ed00000000000000000000000153157abc00000310000001000001014cffffffffffffffff0000001500000000install/checkinstall #!/bin/sh
#
expected_bits="32"
expected_release="5.8"
expected_platform="sparc"
#
release=`uname -r`
platform=`uname -p`
bits=`isainfo -b`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${release} != ${expected_release} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${bits} != ${expected_bits} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n"
echo "\tYour machine is running a ${bits} bit O.S. currently\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
exit 0
07070100024f31000041ed00000000000000000000000353157abc00000000000001000001014cffffffffffffffff0000000500000000root 07070100024f32000041ed00000000000000000000000353157abc00000000000001000001014cffffffffffffffff0000000900000000root/usr 07070100024f33000041ed00000000000000000000000453157abc00000000000001000001014cffffffffffffffff0000000f00000000root/usr/local 07070100024f34000041ed00000000000000000000000253157abc00000000000001000001014cffffffffffffffff0000001300000000root/usr/local/bin 07070100024f35000081ed00000000000000000000000153157aaa00008fb1000001000001014cffffffffffffffff0000001b00000000root/usr/local/bin/aclocal #!/usr/local/bin/perl -w
# -*- perl -*-
# Generated from aclocal.in; do not edit by hand.
eval 'case $# in 0) exec /usr/local/bin/perl -S "$0";; *) exec /usr/local/bin/perl -S "$0" "$@";; esac'
if 0;
# aclocal - create aclocal.m4 by scanning configure.ac
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# 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, 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, see .
# Written by Tom Tromey , and
# Alexandre Duret-Lutz .
BEGIN
{
@Aclocal::perl_libdirs = ('/usr/local/share/automake-1.13')
unless @Aclocal::perl_libdirs;
unshift @INC, @Aclocal::perl_libdirs;
}
use strict;
use Automake::Config;
use Automake::General;
use Automake::Configure_ac;
use Automake::Channels;
use Automake::ChannelDefs;
use Automake::XFile;
use Automake::FileUtils;
use File::Basename;
use File::Path ();
# Some globals.
# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
# FIXME: To be removed in Automake 2.0, once we can assume autoconf
# 2.70 or later.
# FIXME: keep in sync with 'internal/ac-config-macro-dirs.m4'.
my $ac_config_macro_dirs_fallback =
'm4_ifndef([AC_CONFIG_MACRO_DIRS], [' .
'm4_defun([_AM_CONFIG_MACRO_DIRS], [])' .
'm4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])' .
'])';
# We do not operate in threaded mode.
$perl_threads = 0;
# Include paths for searching macros. We search macros in this order:
# user-supplied directories first, then the directory containing the
# automake macros, and finally the system-wide directories for
# third-party macros.
# @user_includes can be augmented with -I or AC_CONFIG_MACRO_DIRS.
# @automake_includes can be reset with the '--automake-acdir' option.
# @system_includes can be augmented with the 'dirlist' file or the
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
# option.
my @user_includes = ();
my @automake_includes = ("/usr/local/share/aclocal-$APIVERSION");
my @system_includes = ('/usr/local/share/aclocal');
# Whether we should copy M4 file in $user_includes[0].
my $install = 0;
# --diff
my @diff_command;
# --dry-run
my $dry_run = 0;
# configure.ac or configure.in.
my $configure_ac;
# Output file name.
my $output_file = 'aclocal.m4';
# Option --force.
my $force_output = 0;
# Modification time of the youngest dependency.
my $greatest_mtime = 0;
# Which macros have been seen.
my %macro_seen = ();
# Remember the order into which we scanned the files.
# It's important to output the contents of aclocal.m4 in the opposite order.
# (Definitions in first files we have scanned should override those from
# later files. So they must appear last in the output.)
my @file_order = ();
# Map macro names to file names.
my %map = ();
# Ditto, but records the last definition of each macro as returned by --trace.
my %map_traced_defs = ();
# Map basenames to macro names.
my %invmap = ();
# Map file names to file contents.
my %file_contents = ();
# Map file names to file types.
my %file_type = ();
use constant FT_USER => 1;
use constant FT_AUTOMAKE => 2;
use constant FT_SYSTEM => 3;
# Map file names to included files (transitively closed).
my %file_includes = ();
# Files which have already been added.
my %file_added = ();
# Files that have already been scanned.
my %scanned_configure_dep = ();
# Serial numbers, for files that have one.
# The key is the basename of the file,
# the value is the serial number represented as a list.
my %serial = ();
# Matches a macro definition.
# AC_DEFUN([macroname], ...)
# or
# AC_DEFUN(macroname, ...)
# When macroname is '['-quoted , we accept any character in the name,
# except ']'. Otherwise macroname stops on the first ']', ',', ')',
# or '\n' encountered.
my $ac_defun_rx =
"(?:AU_ALIAS|A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
# Matches an AC_REQUIRE line.
my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Matches an m4_include line.
my $m4_include_rx = "(m4_|m4_s|s)include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Match a serial number.
my $serial_line_rx = '^#\s*serial\s+(\S*)';
my $serial_number_rx = '^\d+(?:\.\d+)*$';
# Autoconf version. This variable is set by 'trace_used_macros'.
my $ac_version;
# User directory containing extra m4 files for macros definition,
# as extracted from calls to the macro AC_CONFIG_MACRO_DIRS.
# This variable is updated by 'trace_used_macros'.
my @ac_config_macro_dirs;
# If set, names a temporary file that must be erased on abnormal exit.
my $erase_me;
# Constants for the $ERR_LEVEL parameter of the 'scan_m4_dirs' function.
use constant SCAN_M4_DIRS_SILENT => 0;
use constant SCAN_M4_DIRS_WARN => 1;
use constant SCAN_M4_DIRS_ERROR => 2;
################################################################
# Prototypes for all subroutines.
sub unlink_tmp (;$);
sub xmkdir_p ($);
sub check_acinclude ();
sub reset_maps ();
sub install_file ($$);
sub list_compare (\@\@);
sub scan_m4_dirs ($$@);
sub scan_m4_files ();
sub add_macro ($);
sub scan_configure_dep ($);
sub add_file ($);
sub scan_file ($$$);
sub strip_redundant_includes (%);
sub trace_used_macros ();
sub scan_configure ();
sub write_aclocal ($@);
sub usage ($);
sub version ();
sub handle_acdir_option ($$);
sub parse_arguments ();
sub parse_ACLOCAL_PATH ();
################################################################
# Erase temporary file ERASE_ME. Handle signals.
sub unlink_tmp (;$)
{
my ($sig) = @_;
if ($sig)
{
verb "caught SIG$sig, bailing out";
}
if (defined $erase_me && -e $erase_me && !unlink ($erase_me))
{
fatal "could not remove '$erase_me': $!";
}
undef $erase_me;
# reraise default handler.
if ($sig)
{
$SIG{$sig} = 'DEFAULT';
kill $sig => $$;
}
}
$SIG{'INT'} = $SIG{'TERM'} = $SIG{'QUIT'} = $SIG{'HUP'} = 'unlink_tmp';
END { unlink_tmp }
sub xmkdir_p ($)
{
my $dir = shift;
local $@ = undef;
return
if -d $dir or eval { File::Path::mkpath $dir };
chomp $@;
$@ =~ s/\s+at\s.*\bline\s\d+.*$//;
fatal "could not create directory '$dir': $@";
}
# Check macros in acinclude.m4. If one is not used, warn.
sub check_acinclude ()
{
foreach my $key (keys %map)
{
# FIXME: should print line number of acinclude.m4.
msg ('syntax', "macro '$key' defined in acinclude.m4 but never used")
if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
}
}
sub reset_maps ()
{
$greatest_mtime = 0;
%macro_seen = ();
@file_order = ();
%map = ();
%map_traced_defs = ();
%file_contents = ();
%file_type = ();
%file_includes = ();
%file_added = ();
%scanned_configure_dep = ();
%invmap = ();
%serial = ();
undef &search;
}
# install_file ($SRC, $DESTDIR)
sub install_file ($$)
{
my ($src, $destdir) = @_;
my $dest = $destdir . "/" . basename ($src);
my $diff_dest;
verb "installing $src to $dest";
if ($force_output
|| !exists $file_contents{$dest}
|| $file_contents{$src} ne $file_contents{$dest})
{
if (-e $dest)
{
msg 'note', "overwriting '$dest' with '$src'";
$diff_dest = $dest;
}
else
{
msg 'note', "installing '$dest' from '$src'";
}
if (@diff_command)
{
if (! defined $diff_dest)
{
# $dest does not exist. We create an empty one just to
# run diff, and we erase it afterward. Using the real
# the destination file (rather than a temporary file) is
# good when diff is run with options that display the
# file name.
#
# If creating $dest fails, fall back to /dev/null. At
# least one diff implementation (Tru64's) cannot deal
# with /dev/null. However working around this is not
# worth the trouble since nobody run aclocal on a
# read-only tree anyway.
$erase_me = $dest;
my $f = new IO::File "> $dest";
if (! defined $f)
{
undef $erase_me;
$diff_dest = '/dev/null';
}
else
{
$diff_dest = $dest;
$f->close;
}
}
my @cmd = (@diff_command, $diff_dest, $src);
$! = 0;
verb "running: @cmd";
my $res = system (@cmd);
Automake::FileUtils::handle_exec_errors "@cmd", 1
if $res;
unlink_tmp;
}
elsif (!$dry_run)
{
xmkdir_p ($destdir);
xsystem ('cp', $src, $dest);
}
}
}
# Compare two lists of numbers.
sub list_compare (\@\@)
{
my @l = @{$_[0]};
my @r = @{$_[1]};
while (1)
{
if (0 == @l)
{
return (0 == @r) ? 0 : -1;
}
elsif (0 == @r)
{
return 1;
}
elsif ($l[0] < $r[0])
{
return -1;
}
elsif ($l[0] > $r[0])
{
return 1;
}
shift @l;
shift @r;
}
}
################################################################
# scan_m4_dirs($TYPE, $ERR_LEVEL, @DIRS)
# -----------------------------------------------
# Scan all M4 files installed in @DIRS for new macro definitions.
# Register each file as of type $TYPE (one of the FT_* constants).
# If a directory in @DIRS cannot be read:
# - fail hard if $ERR_LEVEL == SCAN_M4_DIRS_ERROR
# - just print a warning if $ERR_LEVEL == SCAN_M4_DIRS_WA
# - continue silently if $ERR_LEVEL == SCAN_M4_DIRS_SILENT
sub scan_m4_dirs ($$@)
{
my ($type, $err_level, @dirlist) = @_;
foreach my $m4dir (@dirlist)
{
if (! opendir (DIR, $m4dir))
{
# TODO: maybe avoid complaining only if errno == ENONENT?
my $message = "couldn't open directory '$m4dir': $!";
if ($err_level == SCAN_M4_DIRS_ERROR)
{
fatal $message;
}
elsif ($err_level == SCAN_M4_DIRS_WARN)
{
msg ('unsupported', $message);
next;
}
elsif ($err_level == SCAN_M4_DIRS_SILENT)
{
next; # Silently ignore.
}
else
{
prog_error "invalid \$err_level value '$err_level'";
}
}
# We reverse the directory contents so that foo2.m4 gets
# used in preference to foo1.m4.
foreach my $file (reverse sort grep (! /^\./, readdir (DIR)))
{
# Only examine .m4 files.
next unless $file =~ /\.m4$/;
# Skip some files when running out of srcdir.
next if $file eq 'aclocal.m4';
my $fullfile = File::Spec->canonpath ("$m4dir/$file");
scan_file ($type, $fullfile, 'aclocal');
}
closedir (DIR);
}
}
# Scan all the installed m4 files and construct a map.
sub scan_m4_files ()
{
# First, scan configure.ac. It may contain macro definitions,
# or may include other files that define macros.
scan_file (FT_USER, $configure_ac, 'aclocal');
# Then, scan acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
scan_file (FT_USER, 'acinclude.m4', 'aclocal');
}
# Finally, scan all files in our search paths.
if (@user_includes)
{
# Don't explore the same directory multiple times. This is here not
# only for speedup purposes. We need this when the user has e.g.
# specified 'ACLOCAL_AMFLAGS = -I m4' and has also set
# AC_CONFIG_MACRO_DIR[S]([m4]) in configure.ac. This makes the 'm4'
# directory to occur twice here and fail on the second call to
# scan_m4_dirs([m4]) when the 'm4' directory doesn't exist.
# TODO: Shouldn't there be rather a check in scan_m4_dirs for
# @user_includes[0]?
@user_includes = uniq @user_includes;
# Don't complain if the first user directory doesn't exist, in case
# we need to create it later (can happen if '--install' was given).
scan_m4_dirs (FT_USER,
$install ? SCAN_M4_DIRS_SILENT : SCAN_M4_DIRS_WARN,
$user_includes[0]);
scan_m4_dirs (FT_USER,
SCAN_M4_DIRS_ERROR,
@user_includes[1..$#user_includes]);
}
scan_m4_dirs (FT_AUTOMAKE, SCAN_M4_DIRS_ERROR, @automake_includes);
scan_m4_dirs (FT_SYSTEM, SCAN_M4_DIRS_ERROR, @system_includes);
# Construct a new function that does the searching. We use a
# function (instead of just evaluating $search in the loop) so that
# "die" is correctly and easily propagated if run.
my $search = "sub search {\nmy \$found = 0;\n";
foreach my $key (reverse sort keys %map)
{
$search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
. '"); $found = 1; }' . "\n");
}
$search .= "return \$found;\n};\n";
eval $search;
prog_error "$@\n search is $search" if $@;
}
################################################################
# Add a macro to the output.
sub add_macro ($)
{
my ($macro) = @_;
# Ignore unknown required macros. Either they are not really
# needed (e.g., a conditional AC_REQUIRE), in which case aclocal
# should be quiet, or they are needed and Autoconf itself will
# complain when we trace for macro usage later.
return unless defined $map{$macro};
verb "saw macro $macro";
$macro_seen{$macro} = 1;
add_file ($map{$macro});
}
# scan_configure_dep ($file)
# --------------------------
# Scan a configure dependency (configure.ac, or separate m4 files)
# for uses of known macros and AC_REQUIREs of possibly unknown macros.
# Recursively scan m4_included files.
sub scan_configure_dep ($)
{
my ($file) = @_;
# Do not scan a file twice.
return ()
if exists $scanned_configure_dep{$file};
$scanned_configure_dep{$file} = 1;
my $mtime = mtime $file;
$greatest_mtime = $mtime if $greatest_mtime < $mtime;
my $contents = exists $file_contents{$file} ?
$file_contents{$file} : contents $file;
my $line = 0;
my @rlist = ();
my @ilist = ();
foreach (split ("\n", $contents))
{
++$line;
# Remove comments from current line.
s/\bdnl\b.*$//;
s/\#.*$//;
# Avoid running all the following regexes on white lines.
next if /^\s*$/;
while (/$m4_include_rx/go)
{
my $ifile = $2 || $3;
# Skip missing 'sinclude'd files.
next if $1 ne 'm4_' && ! -f $ifile;
push @ilist, $ifile;
}
while (/$ac_require_rx/go)
{
push (@rlist, $1 || $2);
}
# The search function is constructed dynamically by
# scan_m4_files. The last parenthetical match makes sure we
# don't match things that look like macro assignments or
# AC_SUBSTs.
if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/)
{
# Macro not found, but AM_ prefix found.
# Make this just a warning, because we do not know whether
# the macro is actually used (it could be called conditionally).
msg ('unsupported', "$file:$line",
"macro '$2' not found in library");
}
}
add_macro ($_) foreach (@rlist);
scan_configure_dep ($_) foreach @ilist;
}
# add_file ($FILE)
# ----------------
# Add $FILE to output.
sub add_file ($)
{
my ($file) = @_;
# Only add a file once.
return if ($file_added{$file});
$file_added{$file} = 1;
scan_configure_dep $file;
}
# Point to the documentation for underquoted AC_DEFUN only once.
my $underquoted_manual_once = 0;
# scan_file ($TYPE, $FILE, $WHERE)
# --------------------------------
# Scan a single M4 file ($FILE), and all files it includes.
# Return the list of included files.
# $TYPE is one of FT_USER, FT_AUTOMAKE, or FT_SYSTEM, depending
# on where the file comes from.
# $WHERE is the location to use in the diagnostic if the file
# does not exist.
sub scan_file ($$$)
{
my ($type, $file, $where) = @_;
my $basename = basename $file;
# Do not scan the same file twice.
return @{$file_includes{$file}} if exists $file_includes{$file};
# Prevent potential infinite recursion (if two files include each other).
return () if exists $file_contents{$file};
unshift @file_order, $file;
$file_type{$file} = $type;
fatal "$where: file '$file' does not exist" if ! -e $file;
my $fh = new Automake::XFile $file;
my $contents = '';
my @inc_files = ();
my %inc_lines = ();
my $defun_seen = 0;
my $serial_seen = 0;
my $serial_older = 0;
while ($_ = $fh->getline)
{
# Ignore '##' lines.
next if /^##/;
$contents .= $_;
my $line = $_;
if ($line =~ /$serial_line_rx/go)
{
my $number = $1;
if ($number !~ /$serial_number_rx/go)
{
msg ('syntax', "$file:$.",
"ill-formed serial number '$number', "
. "expecting a version string with only digits and dots");
}
elsif ($defun_seen)
{
# aclocal removes all definitions from M4 file with the
# same basename if a greater serial number is found.
# Encountering a serial after some macros will undefine
# these macros...
msg ('syntax', "$file:$.",
'the serial number must appear before any macro definition');
}
# We really care about serials only for non-automake macros
# and when --install is used. But the above diagnostics are
# made regardless of this, because not using --install is
# not a reason not the fix macro files.
elsif ($install && $type != FT_AUTOMAKE)
{
$serial_seen = 1;
my @new = split (/\./, $number);
verb "$file:$.: serial $number";
if (!exists $serial{$basename}
|| list_compare (@new, @{$serial{$basename}}) > 0)
{
# Delete any definition we knew from the old macro.
foreach my $def (@{$invmap{$basename}})
{
verb "$file:$.: ignoring previous definition of $def";
delete $map{$def};
}
$invmap{$basename} = [];
$serial{$basename} = \@new;
}
else
{
$serial_older = 1;
}
}
}
# Remove comments from current line.
# Do not do it earlier, because the serial line is a comment.
$line =~ s/\bdnl\b.*$//;
$line =~ s/\#.*$//;
while ($line =~ /$ac_defun_rx/go)
{
$defun_seen = 1;
if (! defined $1)
{
msg ('syntax', "$file:$.", "underquoted definition of $2"
. "\n run info Automake 'Extending aclocal'\n"
. " or see http://www.gnu.org/software/automake/manual/"
. "automake.html#Extending-aclocal")
unless $underquoted_manual_once;
$underquoted_manual_once = 1;
}
# If this macro does not have a serial and we have already
# seen a macro with the same basename earlier, we should
# ignore the macro (don't exit immediately so we can still
# diagnose later #serial numbers and underquoted macros).
$serial_older ||= ($type != FT_AUTOMAKE
&& !$serial_seen && exists $serial{$basename});
my $macro = $1 || $2;
if (!$serial_older && !defined $map{$macro})
{
verb "found macro $macro in $file: $.";
$map{$macro} = $file;
push @{$invmap{$basename}}, $macro;
}
else
{
# Note: we used to give an error here if we saw a
# duplicated macro. However, this turns out to be
# extremely unpopular. It causes actual problems which
# are hard to work around, especially when you must
# mix-and-match tool versions.
verb "ignoring macro $macro in $file: $.";
}
}
while ($line =~ /$m4_include_rx/go)
{
my $ifile = $2 || $3;
# Skip missing 'sinclude'd files.
next if $1 ne 'm4_' && ! -f $ifile;
push (@inc_files, $ifile);
$inc_lines{$ifile} = $.;
}
}
# Ignore any file that has an old serial (or no serial if we know
# another one with a serial).
return ()
if ($serial_older ||
($type != FT_AUTOMAKE && !$serial_seen && exists $serial{$basename}));
$file_contents{$file} = $contents;
# For some reason I don't understand, it does not work
# to do "map { scan_file ($_, ...) } @inc_files" below.
# With Perl 5.8.2 it undefines @inc_files.
my @copy = @inc_files;
my @all_inc_files = (@inc_files,
map { scan_file ($type, $_,
"$file:$inc_lines{$_}") } @copy);
$file_includes{$file} = \@all_inc_files;
return @all_inc_files;
}
# strip_redundant_includes (%FILES)
# ---------------------------------
# Each key in %FILES is a file that must be present in the output.
# However some of these files might already include other files in %FILES,
# so there is no point in including them another time.
# This removes items of %FILES which are already included by another file.
sub strip_redundant_includes (%)
{
my %files = @_;
# Always include acinclude.m4, even if it does not appear to be used.
$files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
# File included by $configure_ac are redundant.
$files{$configure_ac} = 1;
# Files at the end of @file_order should override those at the beginning,
# so it is important to preserve these trailing files. We can remove
# a file A if it is going to be output before a file B that includes
# file A, not the converse.
foreach my $file (reverse @file_order)
{
next unless exists $files{$file};
foreach my $ifile (@{$file_includes{$file}})
{
next unless exists $files{$ifile};
delete $files{$ifile};
verb "$ifile is already included by $file";
}
}
# configure.ac is implicitly included.
delete $files{$configure_ac};
return %files;
}
sub trace_used_macros ()
{
my %files = map { $map{$_} => 1 } keys %macro_seen;
%files = strip_redundant_includes %files;
# When AC_CONFIG_MACRO_DIRS is used, avoid possible spurious warnings
# from autom4te about macros being "m4_require'd but not m4_defun'd";
# for more background, see:
# http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00004.html
# as well as autoconf commit 'v2.69-44-g1ed0548', "warn: allow aclocal
# to silence m4_require warnings".
my $early_m4_code .= "m4_define([m4_require_silent_probe], [-])";
my $traces = ($ENV{AUTOM4TE} || '/usr/local/bin/autom4te');
$traces .= " --language Autoconf-without-aclocal-m4 ";
$traces = "echo '$early_m4_code' | $traces - ";
# Support AC_CONFIG_MACRO_DIRS also with older autoconf.
# Note that we can't use '$ac_config_macro_dirs_fallback' here, because
# a bug in option parsing code of autom4te 2.68 and earlier will cause
# it to read standard input last, even if the "-" argument is specified
# early.
# FIXME: To be removed in Automake 2.0, once we can assume autoconf
# 2.70 or later.
$traces .= "$automake_includes[0]/internal/ac-config-macro-dirs.m4 ";
# All candidate files.
$traces .= join (' ',
(map { "'$_'" }
(grep { exists $files{$_} } @file_order))) . " ";
# All candidate macros.
$traces .= join (' ',
(map { "--trace='$_:\$f::\$n::\${::}%'" }
('AC_DEFUN',
'AC_DEFUN_ONCE',
'AU_DEFUN',
'_AM_AUTOCONF_VERSION',
'AC_CONFIG_MACRO_DIR_TRACE',
# FIXME: Tracing the next two macros is a hack for
# compatibility with older autoconf. Remove this in
# Automake 2.0, when we can assume Autoconf 2.70 or
# later.
'AC_CONFIG_MACRO_DIR',
'_AM_CONFIG_MACRO_DIRS')),
# Do not trace $1 for all other macros as we do
# not need it and it might contains harmful
# characters (like newlines).
(map { "--trace='$_:\$f::\$n'" } (keys %macro_seen)));
verb "running $traces $configure_ac";
my $tracefh = new Automake::XFile ("$traces $configure_ac |");
@ac_config_macro_dirs = ();
my %traced = ();
while ($_ = $tracefh->getline)
{
chomp;
my ($file, $macro, $arg1) = split (/::/);
$traced{$macro} = 1 if exists $macro_seen{$macro};
if ($macro eq 'AC_DEFUN' || $macro eq 'AC_DEFUN_ONCE'
|| $macro eq 'AU_DEFUN')
{
$map_traced_defs{$arg1} = $file;
}
elsif ($macro eq '_AM_AUTOCONF_VERSION')
{
$ac_version = $arg1;
}
elsif ($macro eq 'AC_CONFIG_MACRO_DIR_TRACE')
{
push @ac_config_macro_dirs, $arg1;
}
# FIXME: We still need to trace AC_CONFIG_MACRO_DIR
# for compatibility with older autoconf. Remove this
# once we can assume Autoconf 2.70 or later.
elsif ($macro eq 'AC_CONFIG_MACRO_DIR')
{
@ac_config_macro_dirs = ($arg1);
}
# FIXME:This is an hack for compatibility with older autoconf.
# Remove this once we can assume Autoconf 2.70 or later.
elsif ($macro eq '_AM_CONFIG_MACRO_DIRS')
{
# Empty leading/trailing fields might be produced by split,
# hence the grep is really needed.
push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
}
}
# FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls
# AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could
# leave unwanted duplicates in @ac_config_macro_dirs.
# Remove this in Automake 2.0, when we'll stop tracing
# AC_CONFIG_MACRO_DIR explicitly.
@ac_config_macro_dirs = uniq @ac_config_macro_dirs;
$tracefh->close;
return %traced;
}
sub scan_configure ()
{
# Make sure we include acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
add_file ('acinclude.m4');
}
scan_configure_dep ($configure_ac);
}
################################################################
# Write output.
# Return 0 iff some files were installed locally.
sub write_aclocal ($@)
{
my ($output_file, @macros) = @_;
my $output = '';
my %files = ();
# Get the list of files containing definitions for the macros used.
# (Filter out unused macro definitions with $map_traced_defs. This
# can happen when an Autoconf macro is conditionally defined:
# aclocal sees the potential definition, but this definition is
# actually never processed and the Autoconf implementation is used
# instead.)
for my $m (@macros)
{
$files{$map{$m}} = 1
if (exists $map_traced_defs{$m}
&& $map{$m} eq $map_traced_defs{$m});
}
# Do not explicitly include a file that is already indirectly included.
%files = strip_redundant_includes %files;
my $installed = 0;
for my $file (grep { exists $files{$_} } @file_order)
{
# Check the time stamp of this file, and of all files it includes.
for my $ifile ($file, @{$file_includes{$file}})
{
my $mtime = mtime $ifile;
$greatest_mtime = $mtime if $greatest_mtime < $mtime;
}
# If the file to add looks like outside the project, copy it
# to the output. The regex catches filenames starting with
# things like '/', '\', or 'c:\'.
if ($file_type{$file} != FT_USER
|| $file =~ m,^(?:\w:)?[\\/],)
{
if (!$install || $file_type{$file} != FT_SYSTEM)
{
# Copy the file into aclocal.m4.
$output .= $file_contents{$file} . "\n";
}
else
{
# Install the file (and any file it includes).
my $dest;
for my $ifile (@{$file_includes{$file}}, $file)
{
install_file ($ifile, $user_includes[0]);
}
$installed = 1;
}
}
else
{
# Otherwise, simply include the file.
$output .= "m4_include([$file])\n";
}
}
if ($installed)
{
verb "running aclocal anew, because some files were installed locally";
return 0;
}
# Nothing to output?!
# FIXME: Shouldn't we diagnose this?
return 1 if ! length ($output);
if ($ac_version)
{
# Do not use "$output_file" here for the same reason we do not
# use it in the header below. autom4te will output the name of
# the file in the diagnostic anyway.
$output = "m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [$ac_version],,
[m4_warning([this file was generated for autoconf $ac_version.
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'.])])
$output";
}
# We used to print "# $output_file generated automatically etc." But
# this creates spurious differences when using autoreconf. Autoreconf
# creates aclocal.m4t and then rename it to aclocal.m4, but the
# rebuild rules generated by Automake create aclocal.m4 directly --
# this would gives two ways to get the same file, with a different
# name in the header.
$output = "# generated automatically by aclocal $VERSION -*- Autoconf -*-
# Copyright (C) 1996-$RELEASE_YEAR 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.
$ac_config_macro_dirs_fallback
$output";
# We try not to update $output_file unless necessary, because
# doing so invalidate Autom4te's cache and therefore slows down
# tools called after aclocal.
#
# We need to overwrite $output_file in the following situations.
# * The --force option is in use.
# * One of the dependencies is younger.
# (Not updating $output_file in this situation would cause
# make to call aclocal in loop.)
# * The contents of the current file are different from what
# we have computed.
if (!$force_output
&& $greatest_mtime < mtime ($output_file)
&& $output eq contents ($output_file))
{
verb "$output_file unchanged";
return 1;
}
verb "writing $output_file";
if (!$dry_run)
{
if (-e $output_file && !unlink $output_file)
{
fatal "could not remove '$output_file': $!";
}
my $out = new Automake::XFile "> $output_file";
print $out $output;
}
return 1;
}
################################################################
# Print usage and exit.
sub usage ($)
{
my ($status) = @_;
print <<'EOF';
Usage: aclocal [OPTION]...
Generate 'aclocal.m4' by scanning 'configure.ac' or 'configure.in'
Options:
--automake-acdir=DIR directory holding automake-provided m4 files
--system-acdir=DIR directory holding third-party system-wide files
--diff[=COMMAND] run COMMAND [diff -u] on M4 files that would be
changed (implies --install and --dry-run)
--dry-run pretend to, but do not actually update any file
--force always update output file
--help print this help, then exit
-I DIR add directory to search list for .m4 files
--install copy third-party files to the first -I directory
--output=FILE put output in FILE (default aclocal.m4)
--print-ac-dir print name of directory holding system-wide
third-party m4 files, then exit
--verbose don't be silent
--version print version number, then exit
-W, --warnings=CATEGORY report the warnings falling in CATEGORY
Warning categories include:
syntax dubious syntactic constructs (default)
unsupported unknown macros (default)
all all the warnings (default)
no-CATEGORY turn off warnings in CATEGORY
none turn off all the warnings
error treat warnings as errors
Report bugs to .
GNU Automake home page: .
General help using GNU software: .
EOF
exit $status;
}
# Print version and exit.
sub version ()
{
print <
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Tom Tromey
and Alexandre Duret-Lutz .
EOF
exit 0;
}
# Parse command line.
sub parse_arguments ()
{
my $print_and_exit = 0;
my $diff_command;
my %cli_options =
(
'help' => sub { usage(0); },
'version' => \&version,
'system-acdir=s' => sub { shift; @system_includes = @_; },
'automake-acdir=s' => sub { shift; @automake_includes = @_; },
'diff:s' => \$diff_command,
'dry-run' => \$dry_run,
'force' => \$force_output,
'I=s' => \@user_includes,
'install' => \$install,
'output=s' => \$output_file,
'print-ac-dir' => \$print_and_exit,
'verbose' => sub { setup_channel 'verb', silent => 0; },
'W|warnings=s' => \&parse_warnings,
);
use Automake::Getopt ();
Automake::Getopt::parse_options %cli_options;
if (@ARGV > 0)
{
fatal ("non-option arguments are not accepted: '$ARGV[0]'.\n"
. "Try '$0 --help' for more information.");
}
if ($print_and_exit)
{
print "@system_includes\n";
exit 0;
}
if (defined $diff_command)
{
$diff_command = 'diff -u' if $diff_command eq '';
@diff_command = split (' ', $diff_command);
$install = 1;
$dry_run = 1;
}
# Finally, adds any directory listed in the 'dirlist' file.
if (open (DIRLIST, "$system_includes[0]/dirlist"))
{
while ()
{
# Ignore '#' lines.
next if /^#/;
# strip off newlines and end-of-line comments
s/\s*\#.*$//;
chomp;
foreach my $dir (glob)
{
push (@system_includes, $dir) if -d $dir;
}
}
close (DIRLIST);
}
}
# Add any directory listed in the 'ACLOCAL_PATH' environment variable
# to the list of system include directories.
sub parse_ACLOCAL_PATH ()
{
return if not defined $ENV{"ACLOCAL_PATH"};
# Directories in ACLOCAL_PATH should take precedence over system
# directories, so we use unshift. However, directories that
# come first in ACLOCAL_PATH take precedence over directories
# coming later, which is why the result of split is reversed.
foreach my $dir (reverse split /:/, $ENV{"ACLOCAL_PATH"})
{
unshift (@system_includes, $dir) if $dir ne '' && -d $dir;
}
}
################################################################
parse_WARNINGS; # Parse the WARNINGS environment variable.
parse_arguments;
parse_ACLOCAL_PATH;
$configure_ac = require_configure_ac;
# We may have to rerun aclocal if some file have been installed, but
# it should not happen more than once. The reason we must run again
# is that once the file has been moved from /usr/share/aclocal/ to the
# local m4/ directory it appears at a new place in the search path,
# hence it should be output at a different position in aclocal.m4. If
# we did not rerun aclocal, the next run of aclocal would produce a
# different aclocal.m4.
my $loop = 0;
my $rerun_due_to_macrodir = 0;
while (1)
{
++$loop;
prog_error "too many loops" if $loop > 2 + $rerun_due_to_macrodir;
reset_maps;
scan_m4_files;
scan_configure;
last if $exit_code;
my %macro_traced = trace_used_macros;
if (!$rerun_due_to_macrodir && @ac_config_macro_dirs)
{
# The directory specified in calls to the AC_CONFIG_MACRO_DIRS
# m4 macro (if any) must go after the user includes specified
# explicitly with the '-I' option.
push @user_includes, @ac_config_macro_dirs;
# We might have to scan some new directory of .m4 files.
$rerun_due_to_macrodir++;
next;
}
if ($install && !@user_includes)
{
fatal "installation of third-party macros impossible without " .
"-I options nor AC_CONFIG_MACRO_DIR{,S} m4 macro(s)";
}
last if write_aclocal ($output_file, keys %macro_traced);
last if $dry_run;
}
check_acinclude;
exit $exit_code;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:
07070100024f36000081ed00000000000000000000000153157aaa0003d953000001000001014cffffffffffffffff0000002100000000root/usr/local/bin/automake-1.13 #!/usr/local/bin/perl -w
# -*- perl -*-
# Generated from automake.in; do not edit by hand.
eval 'case $# in 0) exec /usr/local/bin/perl -S "$0";; *) exec /usr/local/bin/perl -S "$0" "$@";; esac'
if 0;
# automake - create Makefile.in from Makefile.am
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# 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, 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, see .
# Originally written by David Mackenzie .
# Perl reimplementation by Tom Tromey , and
# Alexandre Duret-Lutz .
package Language;
BEGIN
{
@Automake::perl_libdirs = ('/usr/local/share/automake-1.13')
unless @Automake::perl_libdirs;
unshift @INC, @Automake::perl_libdirs;
# Override SHELL. This is required on DJGPP so that system() uses
# bash, not COMMAND.COM which doesn't quote arguments properly.
# Other systems aren't expected to use $SHELL when Automake
# runs, but it should be safe to drop the "if DJGPP" guard if
# it turns up other systems need the same thing. After all,
# if SHELL is used, ./configure's SHELL is always better than
# the user's SHELL (which may be something like tcsh).
$ENV{'SHELL'} = '/usr/local/bin/bash' if exists $ENV{'DJDIR'};
}
use Class::Struct ();
Class::Struct::struct (
# Short name of the language (c, f77...).
'name' => "\$",
# Nice name of the language (C, Fortran 77...).
'Name' => "\$",
# List of configure variables which must be defined.
'config_vars' => '@',
# 'pure' is '1' or ''. A 'pure' language is one where, if
# all the files in a directory are of that language, then we
# do not require the C compiler or any code to call it.
'pure' => "\$",
'autodep' => "\$",
# Name of the compiling variable (COMPILE).
'compiler' => "\$",
# Content of the compiling variable.
'compile' => "\$",
# Flag to require compilation without linking (-c).
'compile_flag' => "\$",
'extensions' => '@',
# A subroutine to compute a list of possible extensions of
# the product given the input extensions.
# (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
'output_extensions' => "\$",
# A list of flag variables used in 'compile'.
# (defaults to [])
'flags' => "@",
# Any tag to pass to libtool while compiling.
'libtool_tag' => "\$",
# The file to use when generating rules for this language.
# The default is 'depend2'.
'rule_file' => "\$",
# Name of the linking variable (LINK).
'linker' => "\$",
# Content of the linking variable.
'link' => "\$",
# Name of the compiler variable (CC).
'ccer' => "\$",
# Name of the linker variable (LD).
'lder' => "\$",
# Content of the linker variable ($(CC)).
'ld' => "\$",
# Flag to specify the output file (-o).
'output_flag' => "\$",
'_finish' => "\$",
# This is a subroutine which is called whenever we finally
# determine the context in which a source file will be
# compiled.
'_target_hook' => "\$",
# If TRUE, nodist_ sources will be compiled using specific rules
# (i.e. not inference rules). The default is FALSE.
'nodist_specific' => "\$");
sub finish ($)
{
my ($self) = @_;
if (defined $self->_finish)
{
&{$self->_finish} (@_);
}
}
sub target_hook ($$$$%)
{
my ($self) = @_;
if (defined $self->_target_hook)
{
&{$self->_target_hook} (@_);
}
}
package Automake;
use strict;
use Automake::Config;
BEGIN
{
if ($perl_threads)
{
require threads;
import threads;
require Thread::Queue;
import Thread::Queue;
}
}
use Automake::General;
use Automake::XFile;
use Automake::Channels;
use Automake::ChannelDefs;
use Automake::Configure_ac;
use Automake::FileUtils;
use Automake::Location;
use Automake::Condition qw/TRUE FALSE/;
use Automake::DisjConditions;
use Automake::Options;
use Automake::Variable;
use Automake::VarDef;
use Automake::Rule;
use Automake::RuleDef;
use Automake::Wrap 'makefile_wrap';
use File::Basename;
use File::Spec;
use Carp;
## ----------- ##
## Constants. ##
## ----------- ##
# Some regular expressions. One reason to put them here is that it
# makes indentation work better in Emacs.
# Writing singled-quoted-$-terminated regexes is a pain because
# perl-mode thinks of $' as the ${'} variable (instead of a $ followed
# by a closing quote. Letting perl-mode think the quote is not closed
# leads to all sort of misindentations. On the other hand, defining
# regexes as double-quoted strings is far less readable. So usually
# we will write:
#
# $REGEX = '^regex_value' . "\$";
my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
my $WHITE_PATTERN = '^\s*' . "\$";
my $COMMENT_PATTERN = '^#';
my $TARGET_PATTERN='[$a-zA-Z0-9_.@%][-.a-zA-Z0-9_(){}/$+@%]*';
# A rule has three parts: a list of targets, a list of dependencies,
# and optionally actions.
my $RULE_PATTERN =
"^($TARGET_PATTERN(?:(?:\\\\\n|\\s)+$TARGET_PATTERN)*) *:([^=].*|)\$";
# Only recognize leading spaces, not leading tabs. If we recognize
# leading tabs here then we need to make the reader smarter, because
# otherwise it will think rules like 'foo=bar; \' are errors.
my $ASSIGNMENT_PATTERN = '^ *([^ \t=:+]*)\s*([:+]?)=\s*(.*)' . "\$";
# This pattern recognizes a Gnits version id and sets $1 if the
# release is an alpha release. We also allow a suffix which can be
# used to extend the version number with a "fork" identifier.
my $GNITS_VERSION_PATTERN = '\d+\.\d+([a-z]|\.\d+)?(-[A-Za-z0-9]+)?';
my $IF_PATTERN = '^if\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*)\s*(?:#.*)?' . "\$";
my $ELSE_PATTERN =
'^else(?:\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*))?\s*(?:#.*)?' . "\$";
my $ENDIF_PATTERN =
'^endif(?:\s+(!?)\s*([A-Za-z][A-Za-z0-9_]*))?\s*(?:#.*)?' . "\$";
my $PATH_PATTERN = '(\w|[+/.-])+';
# This will pass through anything not of the prescribed form.
my $INCLUDE_PATTERN = ('^include\s+'
. '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')'
. '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
. '|([^/\$]' . $PATH_PATTERN . '))\s*(#.*)?' . "\$");
# Directories installed during 'install-exec' phase.
my $EXEC_DIR_PATTERN =
'^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
# Values for AC_CANONICAL_*
use constant AC_CANONICAL_BUILD => 1;
use constant AC_CANONICAL_HOST => 2;
use constant AC_CANONICAL_TARGET => 3;
# Values indicating when something should be cleaned.
use constant MOSTLY_CLEAN => 0;
use constant CLEAN => 1;
use constant DIST_CLEAN => 2;
use constant MAINTAINER_CLEAN => 3;
# Libtool files.
my @libtool_files = qw(ltmain.sh config.guess config.sub);
# ltconfig appears here for compatibility with old versions of libtool.
my @libtool_sometimes = qw(ltconfig ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh);
# Commonly found files we look for and automatically include in
# DISTFILES.
my @common_files =
(qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
ar-lib compile config.guess config.rpath
config.sub depcomp install-sh libversion.in mdate-sh
missing mkinstalldirs py-compile texinfo.tex ylwrap),
@libtool_files, @libtool_sometimes);
# Commonly used files we auto-include, but only sometimes. This list
# is used for the --help output only.
my @common_sometimes =
qw(aclocal.m4 acconfig.h config.h.top config.h.bot configure
configure.ac configure.in stamp-vti);
# Standard directories from the GNU Coding Standards, and additional
# pkg* directories from Automake. Stored in a hash for fast member check.
my %standard_prefix =
map { $_ => 1 } (qw(bin data dataroot doc dvi exec html include info
lib libexec lisp locale localstate man man1 man2
man3 man4 man5 man6 man7 man8 man9 oldinclude pdf
pkgdata pkginclude pkglib pkglibexec ps sbin
sharedstate sysconf));
# Copyright on generated Makefile.ins.
my $gen_copyright = "\
# Copyright (C) 1994-$RELEASE_YEAR 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.
";
# These constants are returned by the lang_*_rewrite functions.
# LANG_SUBDIR means that the resulting object file should be in a
# subdir if the source file is. In this case the file name cannot
# have '..' components.
use constant LANG_IGNORE => 0;
use constant LANG_PROCESS => 1;
use constant LANG_SUBDIR => 2;
# These are used when keeping track of whether an object can be built
# by two different paths.
use constant COMPILE_LIBTOOL => 1;
use constant COMPILE_ORDINARY => 2;
# We can't always associate a location to a variable or a rule,
# when it's defined by Automake. We use INTERNAL in this case.
use constant INTERNAL => new Automake::Location;
# Serialization keys for message queues.
use constant QUEUE_MESSAGE => "msg";
use constant QUEUE_CONF_FILE => "conf file";
use constant QUEUE_LOCATION => "location";
use constant QUEUE_STRING => "string";
## ---------------------------------- ##
## Variables related to the options. ##
## ---------------------------------- ##
# TRUE if we should always generate Makefile.in.
my $force_generation = 1;
# From the Perl manual.
my $symlink_exists = (eval 'symlink ("", "");', $@ eq '');
# TRUE if missing standard files should be installed.
my $add_missing = 0;
# TRUE if we should copy missing files; otherwise symlink if possible.
my $copy_missing = 0;
# TRUE if we should always update files that we know about.
my $force_missing = 0;
## ---------------------------------------- ##
## Variables filled during files scanning. ##
## ---------------------------------------- ##
# Name of the configure.ac file.
my $configure_ac;
# Files found by scanning configure.ac for LIBOBJS.
my %libsources = ();
# Names used in AC_CONFIG_HEADERS call.
my @config_headers = ();
# Names used in AC_CONFIG_LINKS call.
my @config_links = ();
# List of Makefile.am's to process, and their corresponding outputs.
my @input_files = ();
my %output_files = ();
# Complete list of Makefile.am's that exist.
my @configure_input_files = ();
# List of files in AC_CONFIG_FILES/AC_OUTPUT without Makefile.am's,
# and their outputs.
my @other_input_files = ();
# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK/AC_CONFIG_HEADERS
# appears. The keys are the files created by these macros.
my %ac_config_files_location = ();
# The condition under which AC_CONFIG_FOOS appears.
my %ac_config_files_condition = ();
# Directory to search for configure-required files. This
# will be computed by &locate_aux_dir and can be set using
# AC_CONFIG_AUX_DIR in configure.ac.
# $CONFIG_AUX_DIR is the 'raw' directory, valid only in the source-tree.
my $config_aux_dir = '';
my $config_aux_dir_set_in_configure_ac = 0;
# $AM_CONFIG_AUX_DIR is prefixed with $(top_srcdir), so it can be used
# in Makefiles.
my $am_config_aux_dir = '';
# Directory to search for AC_LIBSOURCE files, as set by AC_CONFIG_LIBOBJ_DIR
# in configure.ac.
my $config_libobj_dir = '';
# Whether AM_GNU_GETTEXT has been seen in configure.ac.
my $seen_gettext = 0;
# Whether AM_GNU_GETTEXT([external]) is used.
my $seen_gettext_external = 0;
# Where AM_GNU_GETTEXT appears.
my $ac_gettext_location;
# Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen.
my $seen_gettext_intl = 0;
# The arguments of the AM_EXTRA_RECURSIVE_TARGETS call (if any).
my @extra_recursive_targets = ();
# Lists of tags supported by Libtool.
my %libtool_tags = ();
# 1 if Libtool uses LT_SUPPORTED_TAG. If it does, then it also
# uses AC_REQUIRE_AUX_FILE.
my $libtool_new_api = 0;
# Most important AC_CANONICAL_* macro seen so far.
my $seen_canonical = 0;
# Where AM_MAINTAINER_MODE appears.
my $seen_maint_mode;
# Actual version we've seen.
my $package_version = '';
# Where version is defined.
my $package_version_location;
# TRUE if we've seen AM_PROG_AR
my $seen_ar = 0;
# TRUE if we've seen AM_PROG_CC_C_O
my $seen_cc_c_o = 0;
# Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument.
my %required_aux_file = ();
# Where AM_INIT_AUTOMAKE is called;
my $seen_init_automake = 0;
# TRUE if we've seen AM_AUTOMAKE_VERSION.
my $seen_automake_version = 0;
# Hash table of discovered configure substitutions. Keys are names,
# values are 'FILE:LINE' strings which are used by error message
# generation.
my %configure_vars = ();
# Ignored configure substitutions (i.e., variables not to be output in
# Makefile.in)
my %ignored_configure_vars = ();
# Files included by $configure_ac.
my @configure_deps = ();
# Greatest timestamp of configure's dependencies.
my $configure_deps_greatest_timestamp = 0;
# Hash table of AM_CONDITIONAL variables seen in configure.
my %configure_cond = ();
# This maps extensions onto language names.
my %extension_map = ();
# List of the DIST_COMMON files we discovered while reading
# configure.ac.
my $configure_dist_common = '';
# This maps languages names onto objects.
my %languages = ();
# Maps each linker variable onto a language object.
my %link_languages = ();
# maps extensions to needed source flags.
my %sourceflags = ();
# List of targets we must always output.
# FIXME: Complete, and remove falsely required targets.
my %required_targets =
(
'all' => 1,
'dvi' => 1,
'pdf' => 1,
'ps' => 1,
'info' => 1,
'install-info' => 1,
'install' => 1,
'install-data' => 1,
'install-exec' => 1,
'uninstall' => 1,
# FIXME: Not required, temporary hacks.
# Well, actually they are sort of required: the -recursive
# targets will run them anyway...
'html-am' => 1,
'dvi-am' => 1,
'pdf-am' => 1,
'ps-am' => 1,
'info-am' => 1,
'install-data-am' => 1,
'install-exec-am' => 1,
'install-html-am' => 1,
'install-dvi-am' => 1,
'install-pdf-am' => 1,
'install-ps-am' => 1,
'install-info-am' => 1,
'installcheck-am' => 1,
'uninstall-am' => 1,
'tags-am' => 1,
'ctags-am' => 1,
'cscopelist-am' => 1,
'install-man' => 1,
);
# Queue to push require_conf_file requirements to.
my $required_conf_file_queue;
# The name of the Makefile currently being processed.
my $am_file = 'BUG';
################################################################
## ------------------------------------------ ##
## Variables reset by &initialize_per_input. ##
## ------------------------------------------ ##
# Relative dir of the output makefile.
my $relative_dir;
# Greatest timestamp of the output's dependencies (excluding
# configure's dependencies).
my $output_deps_greatest_timestamp;
# These variables are used when generating each Makefile.in.
# They hold the Makefile.in until it is ready to be printed.
my $output_vars;
my $output_all;
my $output_header;
my $output_rules;
my $output_trailer;
# This is the conditional stack, updated on if/else/endif, and
# used to build Condition objects.
my @cond_stack;
# This holds the set of included files.
my @include_stack;
# List of dependencies for the obvious targets.
my @all;
my @check;
my @check_tests;
# Keys in this hash table are files to delete. The associated
# value tells when this should happen (MOSTLY_CLEAN, DIST_CLEAN, etc.)
my %clean_files;
# Keys in this hash table are object files or other files in
# subdirectories which need to be removed. This only holds files
# which are created by compilations. The value in the hash indicates
# when the file should be removed.
my %compile_clean_files;
# Keys in this hash table are directories where we expect to build a
# libtool object. We use this information to decide what directories
# to delete.
my %libtool_clean_directories;
# Value of $(SOURCES), used by tags.am.
my @sources;
# Sources which go in the distribution.
my @dist_sources;
# This hash maps object file names onto their corresponding source
# file names. This is used to ensure that each object is created
# by a single source file.
my %object_map;
# This hash maps object file names onto an integer value representing
# whether this object has been built via ordinary compilation or
# libtool compilation (the COMPILE_* constants).
my %object_compilation_map;
# This keeps track of the directories for which we've already
# created dirstamp code. Keys are directories, values are stamp files.
# Several keys can share the same stamp files if they are equivalent
# (as are './/foo' and 'foo').
my %directory_map;
# All .P files.
my %dep_files;
# This is a list of all targets to run during "make dist".
my @dist_targets;
# Keep track of all programs declared in this Makefile, without
# $(EXEEXT). @substitutions@ are not listed.
my %known_programs;
my %known_libraries;
# This keeps track of which extensions we've seen (that we care
# about).
my %extension_seen;
# This is random scratch space for the language finish functions.
# Don't randomly overwrite it; examine other uses of keys first.
my %language_scratch;
# We keep track of which objects need special (per-executable)
# handling on a per-language basis.
my %lang_specific_files;
# This is set when 'handle_dist' has finished. Once this happens,
# we should no longer push on dist_common.
my $handle_dist_run;
# Used to store a set of linkers needed to generate the sources currently
# under consideration.
my %linkers_used;
# True if we need 'LINK' defined. This is a hack.
my $need_link;
# Does the generated Makefile have to build some compiled object
# (for binary programs, or plain or libtool libraries)?
my $must_handle_compiled_objects;
# Record each file processed by make_paragraphs.
my %transformed_files;
################################################################
## ---------------------------------------------- ##
## Variables not reset by &initialize_per_input. ##
## ---------------------------------------------- ##
# Cache each file processed by make_paragraphs.
# (This is different from %transformed_files because
# %transformed_files is reset for each file while %am_file_cache
# it global to the run.)
my %am_file_cache;
################################################################
# var_SUFFIXES_trigger ($TYPE, $VALUE)
# ------------------------------------
# This is called by Automake::Variable::define() when SUFFIXES
# is defined ($TYPE eq '') or appended ($TYPE eq '+').
# The work here needs to be performed as a side-effect of the
# macro_define() call because SUFFIXES definitions impact
# on $KNOWN_EXTENSIONS_PATTERN which is used used when parsing
# the input am file.
sub var_SUFFIXES_trigger ($$)
{
my ($type, $value) = @_;
accept_extensions (split (' ', $value));
}
Automake::Variable::hook ('SUFFIXES', \&var_SUFFIXES_trigger);
################################################################
## --------------------------------- ##
## Forward subroutine declarations. ##
## --------------------------------- ##
sub register_language (%);
sub file_contents_internal ($$$%);
sub define_files_variable ($\@$$);
# &initialize_per_input ()
# ------------------------
# (Re)-Initialize per-Makefile.am variables.
sub initialize_per_input ()
{
reset_local_duplicates ();
$relative_dir = undef;
$output_deps_greatest_timestamp = 0;
$output_vars = '';
$output_all = '';
$output_header = '';
$output_rules = '';
$output_trailer = '';
Automake::Options::reset;
Automake::Variable::reset;
Automake::Rule::reset;
@cond_stack = ();
@include_stack = ();
@all = ();
@check = ();
@check_tests = ();
%clean_files = ();
%compile_clean_files = ();
# We always include '.'. This isn't strictly correct.
%libtool_clean_directories = ('.' => 1);
@sources = ();
@dist_sources = ();
%object_map = ();
%object_compilation_map = ();
%directory_map = ();
%dep_files = ();
@dist_targets = ();
%known_programs = ();
%known_libraries= ();
%extension_seen = ();
%language_scratch = ();
%lang_specific_files = ();
$handle_dist_run = 0;
$need_link = 0;
$must_handle_compiled_objects = 0;
%transformed_files = ();
}
################################################################
# Initialize our list of languages that are internally supported.
# C.
register_language ('name' => 'c',
'Name' => 'C',
'config_vars' => ['CC'],
'autodep' => '',
'flags' => ['CFLAGS', 'CPPFLAGS'],
'ccer' => 'CC',
'compiler' => 'COMPILE',
'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
'lder' => 'CCLD',
'ld' => '$(CC)',
'linker' => 'LINK',
'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'compile_flag' => '-c',
'libtool_tag' => 'CC',
'extensions' => ['.c']);
# C++.
register_language ('name' => 'cxx',
'Name' => 'C++',
'config_vars' => ['CXX'],
'linker' => 'CXXLINK',
'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'CXX',
'flags' => ['CXXFLAGS', 'CPPFLAGS'],
'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
'ccer' => 'CXX',
'compiler' => 'CXXCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'CXX',
'lder' => 'CXXLD',
'ld' => '$(CXX)',
'pure' => 1,
'extensions' => ['.c++', '.cc', '.cpp', '.cxx', '.C']);
# Objective C.
register_language ('name' => 'objc',
'Name' => 'Objective C',
'config_vars' => ['OBJC'],
'linker' => 'OBJCLINK',
'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJC',
'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
'ccer' => 'OBJC',
'compiler' => 'OBJCCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'lder' => 'OBJCLD',
'ld' => '$(OBJC)',
'pure' => 1,
'extensions' => ['.m']);
# Objective C++.
register_language ('name' => 'objcxx',
'Name' => 'Objective C++',
'config_vars' => ['OBJCXX'],
'linker' => 'OBJCXXLINK',
'link' => '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'OBJCXX',
'flags' => ['OBJCXXFLAGS', 'CPPFLAGS'],
'compile' => '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
'ccer' => 'OBJCXX',
'compiler' => 'OBJCXXCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'lder' => 'OBJCXXLD',
'ld' => '$(OBJCXX)',
'pure' => 1,
'extensions' => ['.mm']);
# Unified Parallel C.
register_language ('name' => 'upc',
'Name' => 'Unified Parallel C',
'config_vars' => ['UPC'],
'linker' => 'UPCLINK',
'link' => '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'UPC',
'flags' => ['UPCFLAGS', 'CPPFLAGS'],
'compile' => '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
'ccer' => 'UPC',
'compiler' => 'UPCCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'lder' => 'UPCLD',
'ld' => '$(UPC)',
'pure' => 1,
'extensions' => ['.upc']);
# Headers.
register_language ('name' => 'header',
'Name' => 'Header',
'extensions' => ['.h', '.H', '.hxx', '.h++', '.hh',
'.hpp', '.inc'],
# No output.
'output_extensions' => sub { return () },
# Nothing to do.
'_finish' => sub { });
# Vala
register_language ('name' => 'vala',
'Name' => 'Vala',
'config_vars' => ['VALAC'],
'flags' => [],
'compile' => '$(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS)',
'ccer' => 'VALAC',
'compiler' => 'VALACOMPILE',
'extensions' => ['.vala'],
'output_extensions' => sub { (my $ext = $_[0]) =~ s/vala$/c/;
return ($ext,) },
'rule_file' => 'vala',
'_finish' => \&lang_vala_finish,
'_target_hook' => \&lang_vala_target_hook,
'nodist_specific' => 1);
# Yacc (C & C++).
register_language ('name' => 'yacc',
'Name' => 'Yacc',
'config_vars' => ['YACC'],
'flags' => ['YFLAGS'],
'compile' => '$(YACC) $(AM_YFLAGS) $(YFLAGS)',
'ccer' => 'YACC',
'compiler' => 'YACCCOMPILE',
'extensions' => ['.y'],
'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
return ($ext,) },
'rule_file' => 'yacc',
'_finish' => \&lang_yacc_finish,
'_target_hook' => \&lang_yacc_target_hook,
'nodist_specific' => 1);
register_language ('name' => 'yaccxx',
'Name' => 'Yacc (C++)',
'config_vars' => ['YACC'],
'rule_file' => 'yacc',
'flags' => ['YFLAGS'],
'ccer' => 'YACC',
'compiler' => 'YACCCOMPILE',
'compile' => '$(YACC) $(AM_YFLAGS) $(YFLAGS)',
'extensions' => ['.y++', '.yy', '.yxx', '.ypp'],
'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
return ($ext,) },
'_finish' => \&lang_yacc_finish,
'_target_hook' => \&lang_yacc_target_hook,
'nodist_specific' => 1);
# Lex (C & C++).
register_language ('name' => 'lex',
'Name' => 'Lex',
'config_vars' => ['LEX'],
'rule_file' => 'lex',
'flags' => ['LFLAGS'],
'compile' => '$(LEX) $(AM_LFLAGS) $(LFLAGS)',
'ccer' => 'LEX',
'compiler' => 'LEXCOMPILE',
'extensions' => ['.l'],
'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
return ($ext,) },
'_finish' => \&lang_lex_finish,
'_target_hook' => \&lang_lex_target_hook,
'nodist_specific' => 1);
register_language ('name' => 'lexxx',
'Name' => 'Lex (C++)',
'config_vars' => ['LEX'],
'rule_file' => 'lex',
'flags' => ['LFLAGS'],
'compile' => '$(LEX) $(AM_LFLAGS) $(LFLAGS)',
'ccer' => 'LEX',
'compiler' => 'LEXCOMPILE',
'extensions' => ['.l++', '.ll', '.lxx', '.lpp'],
'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
return ($ext,) },
'_finish' => \&lang_lex_finish,
'_target_hook' => \&lang_lex_target_hook,
'nodist_specific' => 1);
# Assembler.
register_language ('name' => 'asm',
'Name' => 'Assembler',
'config_vars' => ['CCAS', 'CCASFLAGS'],
'flags' => ['CCASFLAGS'],
# Users can set AM_CCASFLAGS to include DEFS, INCLUDES,
# or anything else required. They can also set CCAS.
# Or simply use Preprocessed Assembler.
'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'ccer' => 'CCAS',
'compiler' => 'CCASCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'extensions' => ['.s']);
# Preprocessed Assembler.
register_language ('name' => 'cppasm',
'Name' => 'Preprocessed Assembler',
'config_vars' => ['CCAS', 'CCASFLAGS'],
'autodep' => 'CCAS',
'flags' => ['CCASFLAGS', 'CPPFLAGS'],
'compile' => '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'ccer' => 'CPPAS',
'compiler' => 'CPPASCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'extensions' => ['.S', '.sx']);
# Fortran 77
register_language ('name' => 'f77',
'Name' => 'Fortran 77',
'config_vars' => ['F77'],
'linker' => 'F77LINK',
'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'flags' => ['FFLAGS'],
'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS)',
'ccer' => 'F77',
'compiler' => 'F77COMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'F77',
'lder' => 'F77LD',
'ld' => '$(F77)',
'pure' => 1,
'extensions' => ['.f', '.for']);
# Fortran
register_language ('name' => 'fc',
'Name' => 'Fortran',
'config_vars' => ['FC'],
'linker' => 'FCLINK',
'link' => '$(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'flags' => ['FCFLAGS'],
'compile' => '$(FC) $(AM_FCFLAGS) $(FCFLAGS)',
'ccer' => 'FC',
'compiler' => 'FCCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'FC',
'lder' => 'FCLD',
'ld' => '$(FC)',
'pure' => 1,
'extensions' => ['.f90', '.f95', '.f03', '.f08']);
# Preprocessed Fortran
register_language ('name' => 'ppfc',
'Name' => 'Preprocessed Fortran',
'config_vars' => ['FC'],
'linker' => 'FCLINK',
'link' => '$(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'lder' => 'FCLD',
'ld' => '$(FC)',
'flags' => ['FCFLAGS', 'CPPFLAGS'],
'ccer' => 'PPFC',
'compiler' => 'PPFCCOMPILE',
'compile' => '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'FC',
'pure' => 1,
'extensions' => ['.F90','.F95', '.F03', '.F08']);
# Preprocessed Fortran 77
#
# The current support for preprocessing Fortran 77 just involves
# passing "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
# $(CPPFLAGS)" as additional flags to the Fortran 77 compiler, since
# this is how GNU Make does it; see the "GNU Make Manual, Edition 0.51
# for 'make' Version 3.76 Beta" (specifically, from info file
# '(make)Catalogue of Rules').
#
# A better approach would be to write an Autoconf test
# (i.e. AC_PROG_FPP) for a Fortran 77 preprocessor, because not all
# Fortran 77 compilers know how to do preprocessing. The Autoconf
# macro AC_PROG_FPP should test the Fortran 77 compiler first for
# preprocessing capabilities, and then fall back on cpp (if cpp were
# available).
register_language ('name' => 'ppf77',
'Name' => 'Preprocessed Fortran 77',
'config_vars' => ['F77'],
'linker' => 'F77LINK',
'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'lder' => 'F77LD',
'ld' => '$(F77)',
'flags' => ['FFLAGS', 'CPPFLAGS'],
'ccer' => 'PPF77',
'compiler' => 'PPF77COMPILE',
'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'F77',
'pure' => 1,
'extensions' => ['.F']);
# Ratfor.
register_language ('name' => 'ratfor',
'Name' => 'Ratfor',
'config_vars' => ['F77'],
'linker' => 'F77LINK',
'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'lder' => 'F77LD',
'ld' => '$(F77)',
'flags' => ['RFLAGS', 'FFLAGS'],
# FIXME also FFLAGS.
'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)',
'ccer' => 'F77',
'compiler' => 'RCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'F77',
'pure' => 1,
'extensions' => ['.r']);
# Java via gcj.
register_language ('name' => 'java',
'Name' => 'Java',
'config_vars' => ['GCJ'],
'linker' => 'GCJLINK',
'link' => '$(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
'autodep' => 'GCJ',
'flags' => ['GCJFLAGS'],
'compile' => '$(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)',
'ccer' => 'GCJ',
'compiler' => 'GCJCOMPILE',
'compile_flag' => '-c',
'output_flag' => '-o',
'libtool_tag' => 'GCJ',
'lder' => 'GCJLD',
'ld' => '$(GCJ)',
'pure' => 1,
'extensions' => ['.java', '.class', '.zip', '.jar']);
################################################################
# Error reporting functions.
# err_am ($MESSAGE, [%OPTIONS])
# -----------------------------
# Uncategorized errors about the current Makefile.am.
sub err_am ($;%)
{
msg_am ('error', @_);
}
# err_ac ($MESSAGE, [%OPTIONS])
# -----------------------------
# Uncategorized errors about configure.ac.
sub err_ac ($;%)
{
msg_ac ('error', @_);
}
# msg_am ($CHANNEL, $MESSAGE, [%OPTIONS])
# ---------------------------------------
# Messages about about the current Makefile.am.
sub msg_am ($$;%)
{
my ($channel, $msg, %opts) = @_;
msg $channel, "${am_file}.am", $msg, %opts;
}
# msg_ac ($CHANNEL, $MESSAGE, [%OPTIONS])
# ---------------------------------------
# Messages about about configure.ac.
sub msg_ac ($$;%)
{
my ($channel, $msg, %opts) = @_;
msg $channel, $configure_ac, $msg, %opts;
}
################################################################
# subst ($TEXT)
# -------------
# Return a configure-style substitution using the indicated text.
# We do this to avoid having the substitutions directly in automake.in;
# when we do that they are sometimes removed and this causes confusion
# and bugs.
sub subst ($)
{
my ($text) = @_;
return '@' . $text . '@';
}
################################################################
# $BACKPATH
# &backname ($RELDIR)
# --------------------
# If I "cd $RELDIR", then to come back, I should "cd $BACKPATH".
# For instance 'src/foo' => '../..'.
# Works with non strictly increasing paths, i.e., 'src/../lib' => '..'.
sub backname ($)
{
my ($file) = @_;
my @res;
foreach (split (/\//, $file))
{
next if $_ eq '.' || $_ eq '';
if ($_ eq '..')
{
pop @res
or prog_error ("trying to reverse path '$file' pointing outside tree");
}
else
{
push (@res, '..');
}
}
return join ('/', @res) || '.';
}
################################################################
# Silent rules handling functions.
# verbose_var (NAME)
# ------------------
# The public variable stem used to implement silent rules.
sub verbose_var ($)
{
my ($name) = @_;
return 'AM_V_' . $name;
}
# verbose_private_var (NAME)
# --------------------------
# The naming policy for the private variables for silent rules.
sub verbose_private_var ($)
{
my ($name) = @_;
return 'am__v_' . $name;
}
# define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE])
# ----------------------------------------------------------
# For silent rules, setup VAR and dispatcher, to expand to
# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to
# empty) if not.
sub define_verbose_var ($$;$)
{
my ($name, $silent_val, $verbose_val) = @_;
$verbose_val = '' unless defined $verbose_val;
my $var = verbose_var ($name);
my $pvar = verbose_private_var ($name);
my $silent_var = $pvar . '_0';
my $verbose_var = $pvar . '_1';
# For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
# and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
# For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
# See AM_SILENT_RULES in m4/silent.m4.
define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)',
INTERNAL);
Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
$silent_val, '', INTERNAL, VAR_ASIS)
if (! vardef ($silent_var, TRUE));
Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
$verbose_val, '', INTERNAL, VAR_ASIS)
if (! vardef ($verbose_var, TRUE));
}
# Above should not be needed in the general automake code.
# verbose_flag (NAME)
# -------------------
# Contents of %VERBOSE%: variable to expand before rule command.
sub verbose_flag ($)
{
my ($name) = @_;
return '$(' . verbose_var ($name) . ')';
}
sub verbose_nodep_flag ($)
{
my ($name) = @_;
return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
}
# silent_flag
# -----------
# Contents of %SILENT%: variable to expand to '@' when silent.
sub silent_flag ()
{
return verbose_flag ('at');
}
# define_verbose_tagvar (NAME)
# ----------------------------
# Engage the needed silent rules machinery for tag NAME.
sub define_verbose_tagvar ($)
{
my ($name) = @_;
define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;');
}
# define_verbose_texinfo
# ----------------------
# Engage the needed silent rules machinery for assorted texinfo commands.
sub define_verbose_texinfo ()
{
my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
foreach my $tag (@tagvars)
{
define_verbose_tagvar($tag);
}
define_verbose_var('texinfo', '-q');
define_verbose_var('texidevnull', '> /dev/null');
}
# define_verbose_libtool
# ----------------------
# Engage the needed silent rules machinery for 'libtool --silent'.
sub define_verbose_libtool ()
{
define_verbose_var ('lt', '--silent');
return verbose_flag ('lt');
}
sub handle_silent ()
{
# Define "$(AM_V_P)", expanding to a shell conditional that can be
# used in make recipes to determine whether we are being run in
# silent mode or not. The choice of the name derives from the LISP
# convention of appending the letter 'P' to denote a predicate (see
# also "the '-P' convention" in the Jargon File); we do so for lack
# of a better convention.
define_verbose_var ('P', 'false', ':');
# *Always* provide the user with '$(AM_V_GEN)', unconditionally.
define_verbose_tagvar ('GEN');
define_verbose_var ('at', '@');
}
################################################################
# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise.
sub handle_options
{
my $var = var ('AUTOMAKE_OPTIONS');
if ($var)
{
if ($var->has_conditional_contents)
{
msg_var ('unsupported', $var,
"'AUTOMAKE_OPTIONS' cannot have conditional contents");
}
my @options = map { { option => $_->[1], where => $_->[0] } }
$var->value_as_list_recursive (cond_filter => TRUE,
location => 1);
return 1 if process_option_list (@options);
}
if ($strictness == GNITS)
{
set_option ('readme-alpha', INTERNAL);
set_option ('std-options', INTERNAL);
set_option ('check-news', INTERNAL);
}
return 0;
}
# shadow_unconditionally ($varname, $where)
# -----------------------------------------
# Return a $(variable) that contains all possible values
# $varname can take.
# If the VAR wasn't defined conditionally, return $(VAR).
# Otherwise we create an am__VAR_DIST variable which contains
# all possible values, and return $(am__VAR_DIST).
sub shadow_unconditionally ($$)
{
my ($varname, $where) = @_;
my $var = var $varname;
if ($var->has_conditional_contents)
{
$varname = "am__${varname}_DIST";
my @files = uniq ($var->value_as_list_recursive);
define_pretty_variable ($varname, TRUE, $where, @files);
}
return "\$($varname)"
}
# check_user_variables (@LIST)
# ----------------------------
# Make sure each variable VAR in @LIST does not exist, suggest using AM_VAR
# otherwise.
sub check_user_variables (@)
{
my @dont_override = @_;
foreach my $flag (@dont_override)
{
my $var = var $flag;
if ($var)
{
for my $cond ($var->conditions->conds)
{
if ($var->rdef ($cond)->owner == VAR_MAKEFILE)
{
msg_cond_var ('gnu', $cond, $flag,
"'$flag' is a user variable, "
. "you should not override it;\n"
. "use 'AM_$flag' instead");
}
}
}
}
}
# Call finish function for each language that was used.
sub handle_languages
{
if (! option 'no-dependencies')
{
# Include auto-dep code. Don't include it if DEP_FILES would
# be empty.
if (keys %extension_seen && keys %dep_files)
{
# Set location of depcomp.
&define_variable ('depcomp',
"\$(SHELL) $am_config_aux_dir/depcomp",
INTERNAL);
&define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
my @deplist = sort keys %dep_files;
# Generate each 'include' individually. Irix 6 make will
# not properly include several files resulting from a
# variable expansion; generating many separate includes
# seems safest.
$output_rules .= "\n";
foreach my $iter (@deplist)
{
$output_rules .= (subst ('AMDEP_TRUE')
. subst ('am__include')
. ' '
. subst ('am__quote')
. $iter
. subst ('am__quote')
. "\n");
}
# Compute the set of directories to remove in distclean-depend.
my @depdirs = uniq (map { dirname ($_) } @deplist);
$output_rules .= &file_contents ('depend',
new Automake::Location,
DEPDIRS => "@depdirs");
}
}
else
{
&define_variable ('depcomp', '', INTERNAL);
&define_variable ('am__depfiles_maybe', '', INTERNAL);
}
my %done;
# Is the C linker needed?
my $needs_c = 0;
foreach my $ext (sort keys %extension_seen)
{
next unless $extension_map{$ext};
my $lang = $languages{$extension_map{$ext}};
my $rule_file = $lang->rule_file || 'depend2';
# Get information on $LANG.
my $pfx = $lang->autodep;
my $fpfx = ($pfx eq '') ? 'CC' : $pfx;
my ($AMDEP, $FASTDEP) =
(option 'no-dependencies' || $lang->autodep eq 'no')
? ('FALSE', 'FALSE') : ('AMDEP', "am__fastdep$fpfx");
my $verbose = verbose_flag ($lang->ccer || 'GEN');
my $verbose_nodep = ($AMDEP eq 'FALSE')
? $verbose : verbose_nodep_flag ($lang->ccer || 'GEN');
my $silent = silent_flag ();
my %transform = ('EXT' => $ext,
'PFX' => $pfx,
'FPFX' => $fpfx,
'AMDEP' => $AMDEP,
'FASTDEP' => $FASTDEP,
'-c' => $lang->compile_flag || '',
# These are not used, but they need to be defined
# so &transform do not complain.
SUBDIROBJ => 0,
'DERIVED-EXT' => 'BUG',
DIST_SOURCE => 1,
VERBOSE => $verbose,
'VERBOSE-NODEP' => $verbose_nodep,
SILENT => $silent,
);
# Generate the appropriate rules for this extension.
if (((! option 'no-dependencies') && $lang->autodep ne 'no')
|| defined $lang->compile)
{
# Some C compilers don't support -c -o. Use it only if really
# needed.
my $output_flag = $lang->output_flag || '';
$output_flag = '-o'
if (! $output_flag
&& $lang->name eq 'c'
&& option 'subdir-objects');
# Compute a possible derived extension.
# This is not used by depend2.am.
my $der_ext = (&{$lang->output_extensions} ($ext))[0];
# When we output an inference rule like '.c.o:' we
# have two cases to consider: either subdir-objects
# is used, or it is not.
#
# In the latter case the rule is used to build objects
# in the current directory, and dependencies always
# go into './$(DEPDIR)/'. We can hard-code this value.
#
# In the former case the rule can be used to build
# objects in sub-directories too. Dependencies should
# go into the appropriate sub-directories, e.g.,
# 'sub/$(DEPDIR)/'. The value of this directory
# needs to be computed on-the-fly.
#
# DEPBASE holds the name of this directory, plus the
# basename part of the object file (extensions Po, TPo,
# Plo, TPlo will be added later as appropriate). It is
# either hardcoded, or a shell variable ('$depbase') that
# will be computed by the rule.
my $depbase =
option ('subdir-objects') ? '$$depbase' : '$(DEPDIR)/$*';
$output_rules .=
file_contents ($rule_file,
new Automake::Location,
%transform,
GENERIC => 1,
'DERIVED-EXT' => $der_ext,
DEPBASE => $depbase,
BASE => '$*',
SOURCE => '$<',
SOURCEFLAG => $sourceflags{$ext} || '',
OBJ => '$@',
OBJOBJ => '$@',
LTOBJ => '$@',
COMPILE => '$(' . $lang->compiler . ')',
LTCOMPILE => '$(LT' . $lang->compiler . ')',
-o => $output_flag,
SUBDIROBJ => !! option 'subdir-objects');
}
# Now include code for each specially handled object with this
# language.
my %seen_files = ();
foreach my $file (@{$lang_specific_files{$lang->name}})
{
my ($derived, $source, $obj, $myext, $srcext, %file_transform) = @$file;
# We might see a given object twice, for instance if it is
# used under different conditions.
next if defined $seen_files{$obj};
$seen_files{$obj} = 1;
prog_error ("found " . $lang->name .
" in handle_languages, but compiler not defined")
unless defined $lang->compile;
my $obj_compile = $lang->compile;
# Rewrite each occurrence of 'AM_$flag' in the compile
# rule into '${derived}_$flag' if it exists.
for my $flag (@{$lang->flags})
{
my $val = "${derived}_$flag";
$obj_compile =~ s/\(AM_$flag\)/\($val\)/
if set_seen ($val);
}
my $libtool_tag = '';
if ($lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag})
{
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
}
my $ptltflags = "${derived}_LIBTOOLFLAGS";
$ptltflags = 'AM_LIBTOOLFLAGS' unless set_seen $ptltflags;
my $ltverbose = define_verbose_libtool ();
my $obj_ltcompile =
"\$(LIBTOOL) $ltverbose $libtool_tag\$($ptltflags) \$(LIBTOOLFLAGS) "
. "--mode=compile $obj_compile";
# We _need_ '-o' for per object rules.
my $output_flag = $lang->output_flag || '-o';
my $depbase = dirname ($obj);
$depbase = ''
if $depbase eq '.';
$depbase .= '/'
unless $depbase eq '';
$depbase .= '$(DEPDIR)/' . basename ($obj);
$output_rules .=
file_contents ($rule_file,
new Automake::Location,
%transform,
GENERIC => 0,
DEPBASE => $depbase,
BASE => $obj,
SOURCE => $source,
SOURCEFLAG => $sourceflags{$srcext} || '',
# Use $myext and not '.o' here, in case
# we are actually building a new source
# file -- e.g. via yacc.
OBJ => "$obj$myext",
OBJOBJ => "$obj.obj",
LTOBJ => "$obj.lo",
VERBOSE => $verbose,
'VERBOSE-NODEP' => $verbose_nodep,
SILENT => $silent,
COMPILE => $obj_compile,
LTCOMPILE => $obj_ltcompile,
-o => $output_flag,
%file_transform);
}
# The rest of the loop is done once per language.
next if defined $done{$lang};
$done{$lang} = 1;
# Load the language dependent Makefile chunks.
my %lang = map { uc ($_) => 0 } keys %languages;
$lang{uc ($lang->name)} = 1;
$output_rules .= file_contents ('lang-compile',
new Automake::Location,
%transform, %lang);
# If the source to a program consists entirely of code from a
# 'pure' language, for instance C++ or Fortran 77, then we
# don't need the C compiler code. However if we run into
# something unusual then we do generate the C code. There are
# probably corner cases here that do not work properly.
# People linking Java code to Fortran code deserve pain.
$needs_c ||= ! $lang->pure;
define_compiler_variable ($lang)
if ($lang->compile);
define_linker_variable ($lang)
if ($lang->link);
require_variables ("$am_file.am", $lang->Name . " source seen",
TRUE, @{$lang->config_vars});
# Call the finisher.
$lang->finish;
# Flags listed in '->flags' are user variables (per GNU Standards),
# they should not be overridden in the Makefile...
my @dont_override = @{$lang->flags};
# ... and so is LDFLAGS.
push @dont_override, 'LDFLAGS' if $lang->link;
check_user_variables @dont_override;
}
# If the project is entirely C++ or entirely Fortran 77 (i.e., 1
# suffix rule was learned), don't bother with the C stuff. But if
# anything else creeps in, then use it.
$needs_c = 1
if $need_link || suffix_rules_count > 1;
if ($needs_c)
{
&define_compiler_variable ($languages{'c'})
unless defined $done{$languages{'c'}};
define_linker_variable ($languages{'c'});
}
}
# append_exeext { PREDICATE } $MACRO
# ----------------------------------
# Append $(EXEEXT) to each filename in $F appearing in the Makefile
# variable $MACRO if &PREDICATE($F) is true. @substitutions@ are
# ignored.
#
# This is typically used on all filenames of *_PROGRAMS, and filenames
# of TESTS that are programs.
sub append_exeext (&$)
{
my ($pred, $macro) = @_;
transform_variable_recursively
($macro, $macro, 'am__EXEEXT', 0, INTERNAL,
sub {
my ($subvar, $val, $cond, $full_cond) = @_;
# Append $(EXEEXT) unless the user did it already, or it's a
# @substitution@.
$val .= '$(EXEEXT)'
if $val !~ /(?:\$\(EXEEXT\)$|^[@]\w+[@]$)/ && &$pred ($val);
return $val;
});
}
# Check to make sure a source defined in LIBOBJS is not explicitly
# mentioned. This is a separate function (as opposed to being inlined
# in handle_source_transform) because it isn't always appropriate to
# do this check.
sub check_libobjs_sources
{
my ($one_file, $unxformed) = @_;
foreach my $prefix ('', 'EXTRA_', 'dist_', 'nodist_',
'dist_EXTRA_', 'nodist_EXTRA_')
{
my @files;
my $varname = $prefix . $one_file . '_SOURCES';
my $var = var ($varname);
if ($var)
{
@files = $var->value_as_list_recursive;
}
elsif ($prefix eq '')
{
@files = ($unxformed . '.c');
}
else
{
next;
}
foreach my $file (@files)
{
err_var ($prefix . $one_file . '_SOURCES',
"automatically discovered file '$file' should not" .
" be explicitly mentioned")
if defined $libsources{$file};
}
}
}
# @OBJECTS
# handle_single_transform ($VAR, $TOPPARENT, $DERIVED, $OBJ, $FILE, %TRANSFORM)
# -----------------------------------------------------------------------------
# Does much of the actual work for handle_source_transform.
# Arguments are:
# $VAR is the name of the variable that the source filenames come from
# $TOPPARENT is the name of the _SOURCES variable which is being processed
# $DERIVED is the name of resulting executable or library
# $OBJ is the object extension (e.g., '.lo')
# $FILE the source file to transform
# %TRANSFORM contains extras arguments to pass to file_contents
# when producing explicit rules
# Result is a list of the names of objects
# %linkers_used will be updated with any linkers needed
sub handle_single_transform ($$$$$%)
{
my ($var, $topparent, $derived, $obj, $_file, %transform) = @_;
my @files = ($_file);
my @result = ();
# Turn sources into objects. We use a while loop like this
# because we might add to @files in the loop.
while (scalar @files > 0)
{
$_ = shift @files;
# Configure substitutions in _SOURCES variables are errors.
if (/^\@.*\@$/)
{
my $parent_msg = '';
$parent_msg = "\nand is referred to from '$topparent'"
if $topparent ne $var->name;
err_var ($var,
"'" . $var->name . "' includes configure substitution '$_'"
. $parent_msg . ";\nconfigure " .
"substitutions are not allowed in _SOURCES variables");
next;
}
# If the source file is in a subdirectory then the '.o' is put
# into the current directory, unless the subdir-objects option
# is in effect.
# Split file name into base and extension.
next if ! /^(?:(.*)\/)?([^\/]*)($KNOWN_EXTENSIONS_PATTERN)$/;
my $full = $_;
my $directory = $1 || '';
my $base = $2;
my $extension = $3;
# We must generate a rule for the object if it requires its own flags.
my $renamed = 0;
my ($linker, $object);
# This records whether we've seen a derived source file (e.g.
# yacc output).
my $derived_source = 0;
# This holds the 'aggregate context' of the file we are
# currently examining. If the file is compiled with
# per-object flags, then it will be the name of the object.
# Otherwise it will be 'AM'. This is used by the target hook
# language function.
my $aggregate = 'AM';
$extension = &derive_suffix ($extension, $obj);
my $lang;
if ($extension_map{$extension} &&
($lang = $languages{$extension_map{$extension}}))
{
# Found the language, so see what it says.
&saw_extension ($extension);
# Do we have per-executable flags for this executable?
my $have_per_exec_flags = 0;
my @peflags = @{$lang->flags};
push @peflags, 'LIBTOOLFLAGS' if $obj eq '.lo';
foreach my $flag (@peflags)
{
if (set_seen ("${derived}_$flag"))
{
$have_per_exec_flags = 1;
last;
}
}
# Note: computed subr call. The language rewrite function
# should return one of the LANG_* constants. It could
# also return a list whose first value is such a constant
# and whose second value is a new source extension which
# should be applied. This means this particular language
# generates another source file which we must then process
# further.
my $subr = \&{'lang_' . $lang->name . '_rewrite'};
defined &$subr or $subr = \&lang_sub_obj;
my ($r, $source_extension)
= &$subr ($directory, $base, $extension,
$obj, $have_per_exec_flags, $var);
# Skip this entry if we were asked not to process it.
next if $r == LANG_IGNORE;
# Now extract linker and other info.
$linker = $lang->linker;
my $this_obj_ext;
if (defined $source_extension)
{
$this_obj_ext = $source_extension;
$derived_source = 1;
}
else
{
$this_obj_ext = $obj;
}
$object = $base . $this_obj_ext;
if ($have_per_exec_flags)
{
# We have a per-executable flag in effect for this
# object. In this case we rewrite the object's
# name to ensure it is unique.
# We choose the name 'DERIVED_OBJECT' to ensure
# (1) uniqueness, and (2) continuity between
# invocations. However, this will result in a
# name that is too long for losing systems, in
# some situations. So we provide _SHORTNAME to
# override.
my $dname = $derived;
my $var = var ($derived . '_SHORTNAME');
if ($var)
{
# FIXME: should use the same Condition as
# the _SOURCES variable. But this is really
# silly overkill -- nobody should have
# conditional shortnames.
$dname = $var->variable_value;
}
$object = $dname . '-' . $object;
prog_error ($lang->name . " flags defined without compiler")
if ! defined $lang->compile;
$renamed = 1;
}
# If rewrite said it was ok, put the object into a
# subdir.
if ($r == LANG_SUBDIR && $directory ne '')
{
$object = $directory . '/' . $object;
}
# If the object file has been renamed (because per-target
# flags are used) we cannot compile the file with an
# inference rule: we need an explicit rule.
#
# If the source is in a subdirectory and the object is in
# the current directory, we also need an explicit rule.
#
# If both source and object files are in a subdirectory
# (this happens when the subdir-objects option is used),
# then the inference will work.
#
# The latter case deserves a historical note. When the
# subdir-objects option was added on 1999-04-11 it was
# thought that inferences rules would work for
# subdirectory objects too. Later, on 1999-11-22,
# automake was changed to output explicit rules even for
# subdir-objects. Nobody remembers why, but this occurred
# soon after the merge of the user-dep-gen-branch so it
# might be related. In late 2003 people complained about
# the size of the generated Makefile.ins (libgcj, with
# 2200+ subdir objects was reported to have a 9MB
# Makefile), so we now rely on inference rules again.
# Maybe we'll run across the same issue as in the past,
# but at least this time we can document it. However since
# dependency tracking has evolved it is possible that
# our old problem no longer exists.
# Using inference rules for subdir-objects has been tested
# with GNU make, Solaris make, Ultrix make, BSD make,
# HP-UX make, and OSF1 make successfully.
if ($renamed
|| ($directory ne '' && ! option 'subdir-objects')
# We must also use specific rules for a nodist_ source
# if its language requests it.
|| ($lang->nodist_specific && ! $transform{'DIST_SOURCE'}))
{
my $obj_sans_ext = substr ($object, 0,
- length ($this_obj_ext));
my $full_ansi;
if ($directory ne '')
{
$full_ansi = $directory . '/' . $base . $extension;
}
else
{
$full_ansi = $base . $extension;
}
my @specifics = ($full_ansi, $obj_sans_ext,
# Only use $this_obj_ext in the derived
# source case because in the other case we
# *don't* want $(OBJEXT) to appear here.
($derived_source ? $this_obj_ext : '.o'),
$extension);
# If we renamed the object then we want to use the
# per-executable flag name. But if this is simply a
# subdir build then we still want to use the AM_ flag
# name.
if ($renamed)
{
unshift @specifics, $derived;
$aggregate = $derived;
}
else
{
unshift @specifics, 'AM';
}
# Each item on this list is a reference to a list consisting
# of four values followed by additional transform flags for
# file_contents. The four values are the derived flag prefix
# (e.g. for 'foo_CFLAGS', it is 'foo'), the name of the
# source file, the base name of the output file, and
# the extension for the object file.
push (@{$lang_specific_files{$lang->name}},
[@specifics, %transform]);
}
}
elsif ($extension eq $obj)
{
# This is probably the result of a direct suffix rule.
# In this case we just accept the rewrite.
$object = "$base$extension";
$object = "$directory/$object" if $directory ne '';
$linker = '';
}
else
{
# No error message here. Used to have one, but it was
# very unpopular.
# FIXME: we could potentially do more processing here,
# perhaps treating the new extension as though it were a
# new source extension (as above). This would require
# more restructuring than is appropriate right now.
next;
}
err_am "object '$object' created by '$full' and '$object_map{$object}'"
if (defined $object_map{$object}
&& $object_map{$object} ne $full);
my $comp_val = (($object =~ /\.lo$/)
? COMPILE_LIBTOOL : COMPILE_ORDINARY);
(my $comp_obj = $object) =~ s/\.lo$/.\$(OBJEXT)/;
if (defined $object_compilation_map{$comp_obj}
&& $object_compilation_map{$comp_obj} != 0
# Only see the error once.
&& ($object_compilation_map{$comp_obj}
!= (COMPILE_LIBTOOL | COMPILE_ORDINARY))
&& $object_compilation_map{$comp_obj} != $comp_val)
{
err_am "object '$comp_obj' created both with libtool and without";
}
$object_compilation_map{$comp_obj} |= $comp_val;
if (defined $lang)
{
# Let the language do some special magic if required.
$lang->target_hook ($aggregate, $object, $full, %transform);
}
if ($derived_source)
{
prog_error ($lang->name . " has automatic dependency tracking")
if $lang->autodep ne 'no';
# Make sure this new source file is handled next. That will
# make it appear to be at the right place in the list.
unshift (@files, $object);
# Distribute derived sources unless the source they are
# derived from is not.
&push_dist_common ($object)
unless ($topparent =~ /^(?:nobase_)?nodist_/);
next;
}
$linkers_used{$linker} = 1;
push (@result, $object);
if (! defined $object_map{$object})
{
my @dep_list = ();
$object_map{$object} = $full;
# If resulting object is in subdir, we need to make
# sure the subdir exists at build time.
if ($object =~ /\//)
{
# FIXME: check that $DIRECTORY is somewhere in the
# project
# For Java, the way we're handling it right now, a
# '..' component doesn't make sense.
if ($lang && $lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
{
err_am "'$full' should not contain a '..' component";
}
# Make sure *all* objects files in the subdirectory are
# removed by "make mostlyclean". Not only this is more
# efficient than listing the object files to be removed
# individually (which would cause an 'rm' invocation for
# each of them -- very inefficient, see bug#10697), it
# would also leave stale object files in the subdirectory
# whenever a source file there is removed or renamed.
$compile_clean_files{"$directory/*.\$(OBJEXT)"} = MOSTLY_CLEAN;
if ($object =~ /\.lo$/)
{
# If we have a libtool object, then we also must remove
# any '.lo' objects in its same subdirectory.
$compile_clean_files{"$directory/*.lo"} = MOSTLY_CLEAN;
# Remember to cleanup .libs/ in this directory.
$libtool_clean_directories{$directory} = 1;
}
push (@dep_list, require_build_directory ($directory));
# If we're generating dependencies, we also want
# to make sure that the appropriate subdir of the
# .deps directory is created.
push (@dep_list,
require_build_directory ($directory . '/$(DEPDIR)'))
unless option 'no-dependencies';
}
&pretty_print_rule ($object . ':', "\t", @dep_list)
if scalar @dep_list > 0;
}
# Transform .o or $o file into .P file (for automatic
# dependency code).
# Properly flatten multiple adjacent slashes, as Solaris 10 make
# might fail over them in an include statement.
# Leading double slashes may be special, as per Posix, so deal
# with them carefully.
if ($lang && $lang->autodep ne 'no')
{
my $depfile = $object;
$depfile =~ s/\.([^.]*)$/.P$1/;
$depfile =~ s/\$\(OBJEXT\)$/o/;
my $maybe_extra_leading_slash = '';
$maybe_extra_leading_slash = '/' if $depfile =~ m,^//[^/],;
$depfile =~ s,/+,/,g;
my $basename = basename ($depfile);
# This might make $dirname empty, but we account for that below.
(my $dirname = dirname ($depfile)) =~ s/\/*$//;
$dirname = $maybe_extra_leading_slash . $dirname;
$dep_files{$dirname . '/$(DEPDIR)/' . $basename} = 1;
}
}
return @result;
}
# $LINKER
# define_objects_from_sources ($VAR, $OBJVAR, $NODEFINE, $ONE_FILE,
# $OBJ, $PARENT, $TOPPARENT, $WHERE, %TRANSFORM)
# ---------------------------------------------------------------------------
# Define an _OBJECTS variable for a _SOURCES variable (or subvariable)
#
# Arguments are:
# $VAR is the name of the _SOURCES variable
# $OBJVAR is the name of the _OBJECTS variable if known (otherwise
# it will be generated and returned).
# $NODEFINE is a boolean: if true, $OBJVAR will not be defined (but
# work done to determine the linker will be).
# $ONE_FILE is the canonical (transformed) name of object to build
# $OBJ is the object extension (i.e. either '.o' or '.lo').
# $TOPPARENT is the _SOURCES variable being processed.
# $WHERE context into which this definition is done
# %TRANSFORM extra arguments to pass to file_contents when producing
# rules
#
# Result is a pair ($LINKER, $OBJVAR):
# $LINKER is a boolean, true if a linker is needed to deal with the objects
sub define_objects_from_sources ($$$$$$$%)
{
my ($var, $objvar, $nodefine, $one_file,
$obj, $topparent, $where, %transform) = @_;
my $needlinker = "";
transform_variable_recursively
($var, $objvar, 'am__objects', $nodefine, $where,
# The transform code to run on each filename.
sub {
my ($subvar, $val, $cond, $full_cond) = @_;
my @trans = handle_single_transform ($subvar, $topparent,
$one_file, $obj, $val,
%transform);
$needlinker = "true" if @trans;
return @trans;
});
return $needlinker;
}
# handle_source_transform ($CANON_TARGET, $TARGET, $OBJEXT, $WHERE, %TRANSFORM)
# -----------------------------------------------------------------------------
# Handle SOURCE->OBJECT transform for one program or library.
# Arguments are:
# canonical (transformed) name of target to build
# actual target of object to build
# object extension (i.e., either '.o' or '$o')
# location of the source variable
# extra arguments to pass to file_contents when producing rules
# Return the name of the linker variable that must be used.
# Empty return means just use 'LINK'.
sub handle_source_transform ($$$$%)
{
# one_file is canonical name. unxformed is given name. obj is
# object extension.
my ($one_file, $unxformed, $obj, $where, %transform) = @_;
my $linker = '';
# No point in continuing if _OBJECTS is defined.
return if reject_var ($one_file . '_OBJECTS',
$one_file . '_OBJECTS should not be defined');
my %used_pfx = ();
my $needlinker;
%linkers_used = ();
foreach my $prefix ('', 'EXTRA_', 'dist_', 'nodist_',
'dist_EXTRA_', 'nodist_EXTRA_')
{
my $varname = $prefix . $one_file . "_SOURCES";
my $var = var $varname;
next unless $var;
# We are going to define _OBJECTS variables using the prefix.
# Then we glom them all together. So we can't use the null
# prefix here as we need it later.
my $xpfx = ($prefix eq '') ? 'am_' : $prefix;
# Keep track of which prefixes we saw.
$used_pfx{$xpfx} = 1
unless $prefix =~ /EXTRA_/;
push @sources, "\$($varname)";
push @dist_sources, shadow_unconditionally ($varname, $where)
unless (option ('no-dist') || $prefix =~ /^nodist_/);
$needlinker |=
define_objects_from_sources ($varname,
$xpfx . $one_file . '_OBJECTS',
$prefix =~ /EXTRA_/,
$one_file, $obj, $varname, $where,
DIST_SOURCE => ($prefix !~ /^nodist_/),
%transform);
}
if ($needlinker)
{
$linker ||= &resolve_linker (%linkers_used);
}
my @keys = sort keys %used_pfx;
if (scalar @keys == 0)
{
# The default source for libfoo.la is libfoo.c, but for
# backward compatibility we first look at libfoo_la.c,
# if no default source suffix is given.
my $old_default_source = "$one_file.c";
my $ext_var = var ('AM_DEFAULT_SOURCE_EXT');
my $default_source_ext = $ext_var ? variable_value ($ext_var) : '.c';
msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most one value")
if $default_source_ext =~ /[\t ]/;
(my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,;
# TODO: Remove this backward-compatibility hack in Automake 2.0.
if ($old_default_source ne $default_source
&& !$ext_var
&& (rule $old_default_source
|| rule '$(srcdir)/' . $old_default_source
|| rule '${srcdir}/' . $old_default_source
|| -f $old_default_source))
{
my $loc = $where->clone;
$loc->pop_context;
msg ('obsolete', $loc,
"the default source for '$unxformed' has been changed "
. "to '$default_source'.\n(Using '$old_default_source' for "
. "backward compatibility.)");
$default_source = $old_default_source;
}
# If a rule exists to build this source with a $(srcdir)
# prefix, use that prefix in our variables too. This is for
# the sake of BSD Make.
if (rule '$(srcdir)/' . $default_source
|| rule '${srcdir}/' . $default_source)
{
$default_source = '$(srcdir)/' . $default_source;
}
&define_variable ($one_file . "_SOURCES", $default_source, $where);
push (@sources, $default_source);
push (@dist_sources, $default_source);
%linkers_used = ();
my (@result) =
handle_single_transform ($one_file . '_SOURCES',
$one_file . '_SOURCES',
$one_file, $obj,
$default_source, %transform);
$linker ||= &resolve_linker (%linkers_used);
define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @result);
}
else
{
@keys = map { '$(' . $_ . $one_file . '_OBJECTS)' } @keys;
define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @keys);
}
# If we want to use 'LINK' we must make sure it is defined.
if ($linker eq '')
{
$need_link = 1;
}
return $linker;
}
# handle_lib_objects ($XNAME, $VAR)
# ---------------------------------
# Special-case ALLOCA and LIBOBJS substitutions in _LDADD or _LIBADD variables.
# Also, generate _DEPENDENCIES variable if appropriate.
# Arguments are:
# transformed name of object being built, or empty string if no object
# name of _LDADD/_LIBADD-type variable to examine
# Returns 1 if LIBOBJS seen, 0 otherwise.
sub handle_lib_objects
{
my ($xname, $varname) = @_;
my $var = var ($varname);
prog_error "'$varname' undefined"
unless $var;
prog_error "unexpected variable name '$varname'"
unless $varname =~ /^(.*)(?:LIB|LD)ADD$/;
my $prefix = $1 || 'AM_';
my $seen_libobjs = 0;
my $flagvar = 0;
transform_variable_recursively
($varname, $xname . '_DEPENDENCIES', 'am__DEPENDENCIES',
! $xname, INTERNAL,
# Transformation function, run on each filename.
sub {
my ($subvar, $val, $cond, $full_cond) = @_;
if ($val =~ /^-/)
{
# Skip -lfoo and -Ldir silently; these are explicitly allowed.
if ($val !~ /^-[lL]/ &&
# Skip -dlopen and -dlpreopen; these are explicitly allowed
# for Libtool libraries or programs. (Actually we are a bit
# lax here since this code also applies to non-libtool
# libraries or programs, for which -dlopen and -dlopreopen
# are pure nonsense. Diagnosing this doesn't seem very
# important: the developer will quickly get complaints from
# the linker.)
$val !~ /^-dl(?:pre)?open$/ &&
# Only get this error once.
! $flagvar)
{
$flagvar = 1;
# FIXME: should display a stack of nested variables
# as context when $var != $subvar.
err_var ($var, "linker flags such as '$val' belong in "
. "'${prefix}LDFLAGS'");
}
return ();
}
elsif ($val !~ /^\@.*\@$/)
{
# Assume we have a file of some sort, and output it into the
# dependency variable. Autoconf substitutions are not output;
# rarely is a new dependency substituted into e.g. foo_LDADD
# -- but bad things (e.g. -lX11) are routinely substituted.
# Note that LIBOBJS and ALLOCA are exceptions to this rule,
# and handled specially below.
return $val;
}
elsif ($val =~ /^\@(LT)?LIBOBJS\@$/)
{
handle_LIBOBJS ($subvar, $cond, $1);
$seen_libobjs = 1;
return $val;
}
elsif ($val =~ /^\@(LT)?ALLOCA\@$/)
{
handle_ALLOCA ($subvar, $cond, $1);
return $val;
}
else
{
return ();
}
});
return $seen_libobjs;
}
# handle_LIBOBJS_or_ALLOCA ($VAR)
# -------------------------------
# Definitions common to LIBOBJS and ALLOCA.
# VAR should be one of LIBOBJS, LTLIBOBJS, ALLOCA, or LTALLOCA.
sub handle_LIBOBJS_or_ALLOCA ($)
{
my ($var) = @_;
my $dir = '';
# If LIBOBJS files must be built in another directory we have
# to define LIBOBJDIR and ensure the files get cleaned.
# Otherwise LIBOBJDIR can be left undefined, and the cleaning
# is achieved by 'rm -f *.$(OBJEXT)' in compile.am.
if ($config_libobj_dir
&& $relative_dir ne $config_libobj_dir)
{
if (option 'subdir-objects')
{
# In the top-level Makefile we do not use $(top_builddir), because
# we are already there, and since the targets are built without
# a $(top_builddir), it helps BSD Make to match them with
# dependencies.
$dir = "$config_libobj_dir/"
if $config_libobj_dir ne '.';
$dir = backname ($relative_dir) . "/$dir"
if $relative_dir ne '.';
define_variable ('LIBOBJDIR', "$dir", INTERNAL);
$clean_files{"\$($var)"} = MOSTLY_CLEAN;
# If LTLIBOBJS is used, we must also clear LIBOBJS (which might
# be created by libtool as a side-effect of creating LTLIBOBJS).
$clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
}
else
{
error ("'\$($var)' cannot be used outside '$config_libobj_dir' if"
. " 'subdir-objects' is not set");
}
}
return $dir;
}
sub handle_LIBOBJS ($$$)
{
my ($var, $cond, $lt) = @_;
my $myobjext = $lt ? 'lo' : 'o';
$lt ||= '';
$var->requires_variables ("\@${lt}LIBOBJS\@ used", $lt . 'LIBOBJS')
if ! keys %libsources;
my $dir = handle_LIBOBJS_or_ALLOCA "${lt}LIBOBJS";
foreach my $iter (keys %libsources)
{
if ($iter =~ /\.[cly]$/)
{
&saw_extension ($&);
&saw_extension ('.c');
}
if ($iter =~ /\.h$/)
{
require_libsource_with_macro ($cond, $var, FOREIGN, $iter);
}
elsif ($iter ne 'alloca.c')
{
my $rewrite = $iter;
$rewrite =~ s/\.c$/.P$myobjext/;
$dep_files{$dir . '$(DEPDIR)/' . $rewrite} = 1;
$rewrite = "^" . quotemeta ($iter) . "\$";
# Only require the file if it is not a built source.
my $bs = var ('BUILT_SOURCES');
if (! $bs || ! grep (/$rewrite/, $bs->value_as_list_recursive))
{
require_libsource_with_macro ($cond, $var, FOREIGN, $iter);
}
}
}
}
sub handle_ALLOCA ($$$)
{
my ($var, $cond, $lt) = @_;
my $myobjext = $lt ? 'lo' : 'o';
$lt ||= '';
my $dir = handle_LIBOBJS_or_ALLOCA "${lt}ALLOCA";
$var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA');
$dep_files{$dir . '$(DEPDIR)/alloca.P' . $myobjext} = 1;
require_libsource_with_macro ($cond, $var, FOREIGN, 'alloca.c');
&saw_extension ('.c');
}
# Canonicalize the input parameter
sub canonicalize
{
my ($string) = @_;
$string =~ tr/A-Za-z0-9_\@/_/c;
return $string;
}
# Canonicalize a name, and check to make sure the non-canonical name
# is never used. Returns canonical name. Arguments are name and a
# list of suffixes to check for.
sub check_canonical_spelling
{
my ($name, @suffixes) = @_;
my $xname = &canonicalize ($name);
if ($xname ne $name)
{
foreach my $xt (@suffixes)
{
reject_var ("$name$xt", "use '$xname$xt', not '$name$xt'");
}
}
return $xname;
}
# handle_compile ()
# -----------------
# Set up the compile suite.
sub handle_compile ()
{
return if ! $must_handle_compiled_objects;
# Boilerplate.
my $default_includes = '';
if (! option 'nostdinc')
{
my @incs = ('-I.', subst ('am__isrc'));
my $var = var 'CONFIG_HEADER';
if ($var)
{
foreach my $hdr (split (' ', $var->variable_value))
{
push @incs, '-I' . dirname ($hdr);
}
}
# We want '-I. -I$(srcdir)', but the latter -I is redundant
# and unaesthetic in non-VPATH builds. We use `-I.@am__isrc@`
# instead. It will be replaced by '-I.' or '-I. -I$(srcdir)'.
# Items in CONFIG_HEADER are never in $(srcdir) so it is safe
# to just put @am__isrc@ right after '-I.', without a space.
($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
}
my (@mostly_rms, @dist_rms);
foreach my $item (sort keys %compile_clean_files)
{
if ($compile_clean_files{$item} == MOSTLY_CLEAN)
{
push (@mostly_rms, "\t-rm -f $item");
}
elsif ($compile_clean_files{$item} == DIST_CLEAN)
{
push (@dist_rms, "\t-rm -f $item");
}
else
{
prog_error 'invalid entry in %compile_clean_files';
}
}
my ($coms, $vars, $rules) =
&file_contents_internal (1, "$libdir/am/compile.am",
new Automake::Location,
('DEFAULT_INCLUDES' => $default_includes,
'MOSTLYRMS' => join ("\n", @mostly_rms),
'DISTRMS' => join ("\n", @dist_rms)));
$output_vars .= $vars;
$output_rules .= "$coms$rules";
}
# handle_libtool ()
# -----------------
# Handle libtool rules.
sub handle_libtool
{
return unless var ('LIBTOOL');
# Libtool requires some files, but only at top level.
# (Starting with Libtool 2.0 we do not have to bother. These
# requirements are done with AC_REQUIRE_AUX_FILE.)
require_conf_file_with_macro (TRUE, 'LIBTOOL', FOREIGN, @libtool_files)
if $relative_dir eq '.' && ! $libtool_new_api;
my @libtool_rms;
foreach my $item (sort keys %libtool_clean_directories)
{
my $dir = ($item eq '.') ? '' : "$item/";
# .libs is for Unix, _libs for DOS.
push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
}
check_user_variables 'LIBTOOLFLAGS';
# Output the libtool compilation rules.
$output_rules .= &file_contents ('libtool',
new Automake::Location,
LTRMS => join ("\n", @libtool_rms));
}
# handle_programs ()
# ------------------
# Handle C programs.
sub handle_programs
{
my @proglist = &am_install_var ('progs', 'PROGRAMS',
'bin', 'sbin', 'libexec', 'pkglibexec',
'noinst', 'check');
return if ! @proglist;
$must_handle_compiled_objects = 1;
my $seen_global_libobjs =
var ('LDADD') && &handle_lib_objects ('', 'LDADD');
foreach my $pair (@proglist)
{
my ($where, $one_file) = @$pair;
my $seen_libobjs = 0;
my $obj = '.$(OBJEXT)';
$known_programs{$one_file} = $where;
# Canonicalize names and check for misspellings.
my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS',
'_SOURCES', '_OBJECTS',
'_DEPENDENCIES');
$where->push_context ("while processing program '$one_file'");
$where->set (INTERNAL->get);
my $linker = &handle_source_transform ($xname, $one_file, $obj, $where,
NONLIBTOOL => 1, LIBTOOL => 0);
if (var ($xname . "_LDADD"))
{
$seen_libobjs = &handle_lib_objects ($xname, $xname . '_LDADD');
}
else
{
# User didn't define prog_LDADD override. So do it.
&define_variable ($xname . '_LDADD', '$(LDADD)', $where);
# This does a bit too much work. But we need it to
# generate _DEPENDENCIES when appropriate.
if (var ('LDADD'))
{
$seen_libobjs = &handle_lib_objects ($xname, 'LDADD');
}
}
reject_var ($xname . '_LIBADD',
"use '${xname}_LDADD', not '${xname}_LIBADD'");
set_seen ($xname . '_DEPENDENCIES');
set_seen ('EXTRA_' . $xname . '_DEPENDENCIES');
set_seen ($xname . '_LDFLAGS');
# Determine program to use for link.
my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname);
$vlink = verbose_flag ($vlink || 'GEN');
# If the resulting program lies in a subdirectory,
# ensure that the directory exists before we need it.
my $dirstamp = require_build_directory_maybe ($one_file);
$libtool_clean_directories{dirname ($one_file)} = 1;
$output_rules .= &file_contents ('program',
$where,
PROGRAM => $one_file,
XPROGRAM => $xname,
XLINK => $xlink,
VERBOSE => $vlink,
DIRSTAMP => $dirstamp,
EXEEXT => '$(EXEEXT)');
if ($seen_libobjs || $seen_global_libobjs)
{
if (var ($xname . '_LDADD'))
{
&check_libobjs_sources ($xname, $xname . '_LDADD');
}
elsif (var ('LDADD'))
{
&check_libobjs_sources ($xname, 'LDADD');
}
}
}
}
# handle_libraries ()
# -------------------
# Handle libraries.
sub handle_libraries
{
my @liblist = &am_install_var ('libs', 'LIBRARIES',
'lib', 'pkglib', 'noinst', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
my @prefix = am_primary_prefixes ('LIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
if (@prefix)
{
my $var = rvar ($prefix[0] . '_LIBRARIES');
$var->requires_variables ('library used', 'RANLIB');
}
&define_variable ('AR', 'ar', INTERNAL);
&define_variable ('ARFLAGS', 'cru', INTERNAL);
&define_verbose_tagvar ('AR');
foreach my $pair (@liblist)
{
my ($where, $onelib) = @$pair;
my $seen_libobjs = 0;
# Check that the library fits the standard naming convention.
my $bn = basename ($onelib);
if ($bn !~ /^lib.*\.a$/)
{
$bn =~ s/^(?:lib)?(.*?)(?:\.[^.]*)?$/lib$1.a/;
my $suggestion = dirname ($onelib) . "/$bn";
$suggestion =~ s|^\./||g;
msg ('error-gnu/warn', $where,
"'$onelib' is not a standard library name\n"
. "did you mean '$suggestion'?")
}
($known_libraries{$onelib} = $bn) =~ s/\.a$//;
$where->push_context ("while processing library '$onelib'");
$where->set (INTERNAL->get);
my $obj = '.$(OBJEXT)';
# Canonicalize names and check for misspellings.
my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
'_OBJECTS', '_DEPENDENCIES',
'_AR');
if (! var ($xlib . '_AR'))
{
&define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
}
# Generate support for conditional object inclusion in
# libraries.
if (var ($xlib . '_LIBADD'))
{
if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
&define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ($xlib . '_LDADD',
"use '${xlib}_LIBADD', not '${xlib}_LDADD'");
# Make sure we at look at this.
set_seen ($xlib . '_DEPENDENCIES');
set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
&handle_source_transform ($xlib, $onelib, $obj, $where,
NONLIBTOOL => 1, LIBTOOL => 0);
# If the resulting library lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($onelib);
my $verbose = verbose_flag ('AR');
my $silent = silent_flag ();
$output_rules .= &file_contents ('library',
$where,
VERBOSE => $verbose,
SILENT => $silent,
LIBRARY => $onelib,
XLIBRARY => $xlib,
DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
&check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
if (! $seen_ar)
{
msg ('extra-portability', $where,
"'$onelib': linking libraries using a non-POSIX\n"
. "archiver requires 'AM_PROG_AR' in '$configure_ac'")
}
}
}
# handle_ltlibraries ()
# ---------------------
# Handle shared libraries.
sub handle_ltlibraries
{
my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES',
'noinst', 'lib', 'pkglib', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
my @prefix = am_primary_prefixes ('LTLIBRARIES', 0, 'lib', 'pkglib',
'noinst', 'check');
if (@prefix)
{
my $var = rvar ($prefix[0] . '_LTLIBRARIES');
$var->requires_variables ('Libtool library used', 'LIBTOOL');
}
my %instdirs = ();
my %instsubdirs = ();
my %instconds = ();
my %liblocations = (); # Location (in Makefile.am) of each library.
foreach my $key (@prefix)
{
# Get the installation directory of each library.
my $dir = $key;
my $strip_subdir = 1;
if ($dir =~ /^nobase_/)
{
$dir =~ s/^nobase_//;
$strip_subdir = 0;
}
my $var = rvar ($key . '_LTLIBRARIES');
# We reject libraries which are installed in several places
# in the same condition, because we can only specify one
# '-rpath' option.
$var->traverse_recursively
(sub
{
my ($var, $val, $cond, $full_cond) = @_;
my $hcond = $full_cond->human;
my $where = $var->rdef ($cond)->location;
my $ldir = '';
$ldir = '/' . dirname ($val)
if (!$strip_subdir);
# A library cannot be installed in different directories
# in overlapping conditions.
if (exists $instconds{$val})
{
my ($msg, $acond) =
$instconds{$val}->ambiguous_p ($val, $full_cond);
if ($msg)
{
error ($where, $msg, partial => 1);
my $dirtxt = "installed " . ($strip_subdir ? "in" : "below") . " '$dir'";
$dirtxt = "built for '$dir'"
if $dir eq 'EXTRA' || $dir eq 'noinst' || $dir eq 'check';
my $dircond =
$full_cond->true ? "" : " in condition $hcond";
error ($where, "'$val' should be $dirtxt$dircond ...",
partial => 1);
my $hacond = $acond->human;
my $adir = $instdirs{$val}{$acond};
my $adirtxt = "installed in '$adir'";
$adirtxt = "built for '$adir'"
if ($adir eq 'EXTRA' || $adir eq 'noinst'
|| $adir eq 'check');
my $adircond = $acond->true ? "" : " in condition $hacond";
my $onlyone = ($dir ne $adir) ?
("\nLibtool libraries can be built for only one "
. "destination") : "";
error ($liblocations{$val}{$acond},
"... and should also be $adirtxt$adircond.$onlyone");
return;
}
}
else
{
$instconds{$val} = new Automake::DisjConditions;
}
$instdirs{$val}{$full_cond} = $dir;
$instsubdirs{$val}{$full_cond} = $ldir;
$liblocations{$val}{$full_cond} = $where;
$instconds{$val} = $instconds{$val}->merge ($full_cond);
},
sub
{
return ();
},
skip_ac_subst => 1);
}
foreach my $pair (@liblist)
{
my ($where, $onelib) = @$pair;
my $seen_libobjs = 0;
my $obj = '.lo';
# Canonicalize names and check for misspellings.
my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
'_SOURCES', '_OBJECTS',
'_DEPENDENCIES');
# Check that the library fits the standard naming convention.
my $libname_rx = '^lib.*\.la';
my $ldvar = var ("${xlib}_LDFLAGS") || var ('AM_LDFLAGS');
my $ldvar2 = var ('LDFLAGS');
if (($ldvar && grep (/-module/, $ldvar->value_as_list_recursive))
|| ($ldvar2 && grep (/-module/, $ldvar2->value_as_list_recursive)))
{
# Relax name checking for libtool modules.
$libname_rx = '\.la';
}
my $bn = basename ($onelib);
if ($bn !~ /$libname_rx$/)
{
my $type = 'library';
if ($libname_rx eq '\.la')
{
$bn =~ s/^(lib|)(.*?)(?:\.[^.]*)?$/$1$2.la/;
$type = 'module';
}
else
{
$bn =~ s/^(?:lib)?(.*?)(?:\.[^.]*)?$/lib$1.la/;
}
my $suggestion = dirname ($onelib) . "/$bn";
$suggestion =~ s|^\./||g;
msg ('error-gnu/warn', $where,
"'$onelib' is not a standard libtool $type name\n"
. "did you mean '$suggestion'?")
}
($known_libraries{$onelib} = $bn) =~ s/\.la$//;
$where->push_context ("while processing Libtool library '$onelib'");
$where->set (INTERNAL->get);
# Make sure we look at these.
set_seen ($xlib . '_LDFLAGS');
set_seen ($xlib . '_DEPENDENCIES');
set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
# Generate support for conditional object inclusion in
# libraries.
if (var ($xlib . '_LIBADD'))
{
if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
&define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ("${xlib}_LDADD",
"use '${xlib}_LIBADD', not '${xlib}_LDADD'");
my $linker = &handle_source_transform ($xlib, $onelib, $obj, $where,
NONLIBTOOL => 0, LIBTOOL => 1);
# Determine program to use for link.
my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xlib);
$vlink = verbose_flag ($vlink || 'GEN');
my $rpathvar = "am_${xlib}_rpath";
my $rpath = "\$($rpathvar)";
foreach my $rcond ($instconds{$onelib}->conds)
{
my $val;
if ($instdirs{$onelib}{$rcond} eq 'EXTRA'
|| $instdirs{$onelib}{$rcond} eq 'noinst'
|| $instdirs{$onelib}{$rcond} eq 'check')
{
# It's an EXTRA_ library, so we can't specify -rpath,
# because we don't know where the library will end up.
# The user probably knows, but generally speaking automake
# doesn't -- and in fact configure could decide
# dynamically between two different locations.
$val = '';
}
else
{
$val = ('-rpath $(' . $instdirs{$onelib}{$rcond} . 'dir)');
$val .= $instsubdirs{$onelib}{$rcond}
if defined $instsubdirs{$onelib}{$rcond};
}
if ($rcond->true)
{
# If $rcond is true there is only one condition and
# there is no point defining an helper variable.
$rpath = $val;
}
else
{
define_pretty_variable ($rpathvar, $rcond, INTERNAL, $val);
}
}
# If the resulting library lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($onelib);
# Remember to cleanup .libs/ in this directory.
my $dirname = dirname $onelib;
$libtool_clean_directories{$dirname} = 1;
$output_rules .= &file_contents ('ltlibrary',
$where,
LTLIBRARY => $onelib,
XLTLIBRARY => $xlib,
RPATH => $rpath,
XLINK => $xlink,
VERBOSE => $vlink,
DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
&check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
if (! $seen_ar)
{
msg ('extra-portability', $where,
"'$onelib': linking libtool libraries using a non-POSIX\n"
. "archiver requires 'AM_PROG_AR' in '$configure_ac'")
}
}
}
# See if any _SOURCES variable were misspelled.
sub check_typos ()
{
# It is ok if the user sets this particular variable.
set_seen 'AM_LDFLAGS';
foreach my $primary ('SOURCES', 'LIBADD', 'LDADD', 'LDFLAGS', 'DEPENDENCIES')
{
foreach my $var (variables $primary)
{
my $varname = $var->name;
# A configure variable is always legitimate.
next if exists $configure_vars{$varname};
for my $cond ($var->conditions->conds)
{
$varname =~ /^(?:EXTRA_)?(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
msg_var ('syntax', $var, "variable '$varname' is defined but no"
. " program or\nlibrary has '$1' as canonical name"
. " (possible typo)")
unless $var->rdef ($cond)->seen;
}
}
}
}
# Handle scripts.
sub handle_scripts
{
# NOTE we no longer automatically clean SCRIPTS, because it is
# useful to sometimes distribute scripts verbatim. This happens
# e.g. in Automake itself.
&am_install_var ('-candist', 'scripts', 'SCRIPTS',
'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata',
'noinst', 'check');
}
## ------------------------ ##
## Handling Texinfo files. ##
## ------------------------ ##
# ($OUTFILE, $VFILE)
# &scan_texinfo_file ($FILENAME)
# ------------------------------
# $OUTFILE - name of the info file produced by $FILENAME.
# $VFILE - name of the version.texi file used (undef if none).
sub scan_texinfo_file ($)
{
my ($filename) = @_;
my $texi = new Automake::XFile "< $filename";
verb "reading $filename";
my ($outfile, $vfile);
while ($_ = $texi->getline)
{
if (/^\@setfilename +(\S+)/)
{
# Honor only the first @setfilename. (It's possible to have
# more occurrences later if the manual shows examples of how
# to use @setfilename...)
next if $outfile;
$outfile = $1;
if (index ($outfile, '.') < 0)
{
msg 'obsolete', "$filename:$.",
"use of suffix-less info files is discouraged"
}
elsif ($outfile !~ /\.info$/)
{
error ("$filename:$.",
"output '$outfile' has unrecognized extension");
return;
}
}
# A "version.texi" file is actually any file whose name matches
# "vers*.texi".
elsif (/^\@include\s+(vers[^.]*\.texi)\s*$/)
{
$vfile = $1;
}
}
if (! $outfile)
{
err_am "'$filename' missing \@setfilename";
return;
}
return ($outfile, $vfile);
}
# ($DIRSTAMP, @CLEAN_FILES)
# output_texinfo_build_rules ($SOURCE, $DEST, $INSRC, @DEPENDENCIES)
# ------------------------------------------------------------------
# SOURCE - the source Texinfo file
# DEST - the destination Info file
# INSRC - whether DEST should be built in the source tree
# DEPENDENCIES - known dependencies
sub output_texinfo_build_rules ($$$@)
{
my ($source, $dest, $insrc, @deps) = @_;
# Split 'a.texi' into 'a' and '.texi'.
my ($spfx, $ssfx) = ($source =~ /^(.*?)(\.[^.]*)?$/);
my ($dpfx, $dsfx) = ($dest =~ /^(.*?)(\.[^.]*)?$/);
$ssfx ||= "";
$dsfx ||= "";
# We can output two kinds of rules: the "generic" rules use Make
# suffix rules and are appropriate when $source and $dest do not lie
# in a sub-directory; the "specific" rules are needed in the other
# case.
#
# The former are output only once (this is not really apparent here,
# but just remember that some logic deeper in Automake will not
# output the same rule twice); while the later need to be output for
# each Texinfo source.
my $generic;
my $makeinfoflags;
my $sdir = dirname $source;
if ($sdir eq '.' && dirname ($dest) eq '.')
{
$generic = 1;
$makeinfoflags = '-I $(srcdir)';
}
else
{
$generic = 0;
$makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
}
# A directory can contain two kinds of info files: some built in the
# source tree, and some built in the build tree. The rules are
# different in each case. However we cannot output two different
# set of generic rules. Because in-source builds are more usual, we
# use generic rules in this case and fall back to "specific" rules
# for build-dir builds. (It should not be a problem to invert this
# if needed.)
$generic = 0 unless $insrc;
# We cannot use a suffix rule to build info files with an empty
# extension. Otherwise we would output a single suffix inference
# rule, with separate dependencies, as in
#
# .texi:
# $(MAKEINFO) ...
# foo.info: foo.texi
#
# which confuse Solaris make. (See the Autoconf manual for
# details.) Therefore we use a specific rule in this case. This
# applies to info files only (dvi and pdf files always have an
# extension).
my $generic_info = ($generic && $dsfx) ? 1 : 0;
# If the resulting file lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($dest);
my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx;
$output_rules .= file_contents ('texibuild',
new Automake::Location,
AM_V_MAKEINFO => verbose_flag('MAKEINFO'),
AM_V_TEXI2DVI => verbose_flag('TEXI2DVI'),
AM_V_TEXI2PDF => verbose_flag('TEXI2PDF'),
DEPS => "@deps",
DEST_PREFIX => $dpfx,
DEST_INFO_PREFIX => $dipfx,
DEST_SUFFIX => $dsfx,
DIRSTAMP => $dirstamp,
GENERIC => $generic,
GENERIC_INFO => $generic_info,
INSRC => $insrc,
MAKEINFOFLAGS => $makeinfoflags,
SILENT => silent_flag(),
SOURCE => ($generic
? '$<' : $source),
SOURCE_INFO => ($generic_info
? '$<' : $source),
SOURCE_REAL => $source,
SOURCE_SUFFIX => $ssfx,
TEXIQUIET => verbose_flag('texinfo'),
TEXIDEVNULL => verbose_flag('texidevnull'),
);
return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
}
# ($MOSTLYCLEAN, $TEXICLEAN, $MAINTCLEAN)
# handle_texinfo_helper ($info_texinfos)
# --------------------------------------
# Handle all Texinfo source; helper for handle_texinfo.
sub handle_texinfo_helper ($)
{
my ($info_texinfos) = @_;
my (@infobase, @info_deps_list, @texi_deps);
my %versions;
my $done = 0;
my (@mostly_cleans, @texi_cleans, @maint_cleans) = ('', '', '');
# Build a regex matching user-cleaned files.
my $d = var 'DISTCLEANFILES';
my $c = var 'CLEANFILES';
my @f = ();
push @f, $d->value_as_list_recursive (inner_expand => 1) if $d;
push @f, $c->value_as_list_recursive (inner_expand => 1) if $c;
@f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
foreach my $texi
($info_texinfos->value_as_list_recursive (inner_expand => 1))
{
my $infobase = $texi;
if ($infobase =~ s/\.texi$//)
{
1; # Nothing more to do.
}
elsif ($infobase =~ s/\.(txi|texinfo)$//)
{
msg_var 'obsolete', $info_texinfos,
"suffix '.$1' for Texinfo files is discouraged;" .
" use '.texi' instead";
}
else
{
# FIXME: report line number.
err_am "texinfo file '$texi' has unrecognized extension";
next;
}
push @infobase, $infobase;
# If 'version.texi' is referenced by input file, then include
# automatic versioning capability.
my ($out_file, $vtexi) =
scan_texinfo_file ("$relative_dir/$texi")
or next;
# Directory of auxiliary files and build by-products used by texi2dvi
# and texi2pdf.
push @mostly_cleans, "$infobase.t2d";
push @mostly_cleans, "$infobase.t2p";
# If the Texinfo source is in a subdirectory, create the
# resulting info in this subdirectory. If it is in the current
# directory, try hard to not prefix "./" because it breaks the
# generic rules.
my $outdir = dirname ($texi) . '/';
$outdir = "" if $outdir eq './';
$out_file = $outdir . $out_file;
# Until Automake 1.6.3, .info files were built in the
# source tree. This was an obstacle to the support of
# non-distributed .info files, and non-distributed .texi
# files.
#
# * Non-distributed .texi files is important in some packages
# where .texi files are built at make time, probably using
# other binaries built in the package itself, maybe using
# tools or information found on the build host. Because
# these files are not distributed they are always rebuilt
# at make time; they should therefore not lie in the source
# directory. One plan was to support this using
# nodist_info_TEXINFOS or something similar. (Doing this
# requires some sanity checks. For instance Automake should
# not allow:
# dist_info_TEXINFOS = foo.texi
# nodist_foo_TEXINFOS = included.texi
# because a distributed file should never depend on a
# non-distributed file.)
#
# * If .texi files are not distributed, then .info files should
# not be distributed either. There are also cases where one
# wants to distribute .texi files, but does not want to
# distribute the .info files. For instance the Texinfo package
# distributes the tool used to build these files; it would
# be a waste of space to distribute them. It's not clear
# which syntax we should use to indicate that .info files should
# not be distributed. Akim Demaille suggested that eventually
# we switch to a new syntax:
# | Maybe we should take some inspiration from what's already
# | done in the rest of Automake. Maybe there is too much
# | syntactic sugar here, and you want
# | nodist_INFO = bar.info
# | dist_bar_info_SOURCES = bar.texi
# | bar_texi_DEPENDENCIES = foo.texi
# | with a bit of magic to have bar.info represent the whole
# | bar*info set. That's a lot more verbose that the current
# | situation, but it is # not new, hence the user has less
# | to learn.
# |
# | But there is still too much room for meaningless specs:
# | nodist_INFO = bar.info
# | dist_bar_info_SOURCES = bar.texi
# | dist_PS = bar.ps something-written-by-hand.ps
# | nodist_bar_ps_SOURCES = bar.texi
# | bar_texi_DEPENDENCIES = foo.texi
# | here bar.texi is dist_ in line 2, and nodist_ in 4.
#
# Back to the point, it should be clear that in order to support
# non-distributed .info files, we need to build them in the
# build tree, not in the source tree (non-distributed .texi
# files are less of a problem, because we do not output build
# rules for them). In Automake 1.7 .info build rules have been
# largely cleaned up so that .info files get always build in the
# build tree, even when distributed. The idea was that
# (1) if during a VPATH build the .info file was found to be
# absent or out-of-date (in the source tree or in the
# build tree), Make would rebuild it in the build tree.
# If an up-to-date source-tree of the .info file existed,
# make would not rebuild it in the build tree.
# (2) having two copies of .info files, one in the source tree
# and one (newer) in the build tree is not a problem
# because 'make dist' always pick files in the build tree
# first.
# However it turned out the be a bad idea for several reasons:
# * Tru64, OpenBSD, and FreeBSD (not NetBSD) Make do not behave
# like GNU Make on point (1) above. These implementations
# of Make would always rebuild .info files in the build
# tree, even if such files were up to date in the source
# tree. Consequently, it was impossible to perform a VPATH
# build of a package containing Texinfo files using these
# Make implementations.
# (Refer to the Autoconf Manual, section "Limitation of
# Make", paragraph "VPATH", item "target lookup", for
# an account of the differences between these
# implementations.)
# * The GNU Coding Standards require these files to be built
# in the source-tree (when they are distributed, that is).
# * Keeping a fresher copy of distributed files in the
# build tree can be annoying during development because
# - if the files is kept under CVS, you really want it
# to be updated in the source tree
# - it is confusing that 'make distclean' does not erase
# all files in the build tree.
#
# Consequently, starting with Automake 1.8, .info files are
# built in the source tree again. Because we still plan to
# support non-distributed .info files at some point, we
# have a single variable ($INSRC) that controls whether
# the current .info file must be built in the source tree
# or in the build tree. Actually this variable is switched
# off for .info files that appear to be cleaned; this is
# for backward compatibility with package such as Texinfo,
# which do things like
# info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
# DISTCLEANFILES = texinfo texinfo-* info*.info*
# # Do not create info files for distribution.
# dist-info:
# in order not to distribute .info files.
my $insrc = ($out_file =~ $user_cleaned_files) ? 0 : 1;
my $soutdir = '$(srcdir)/' . $outdir;
$outdir = $soutdir if $insrc;
# If user specified file_TEXINFOS, then use that as explicit
# dependency list.
@texi_deps = ();
push (@texi_deps, "$soutdir$vtexi") if $vtexi;
my $canonical = canonicalize ($infobase);
if (var ($canonical . "_TEXINFOS"))
{
push (@texi_deps, '$(' . $canonical . '_TEXINFOS)');
push_dist_common ('$(' . $canonical . '_TEXINFOS)');
}
my ($dirstamp, @cfiles) =
output_texinfo_build_rules ($texi, $out_file, $insrc, @texi_deps);
push (@texi_cleans, @cfiles);
push (@info_deps_list, $out_file);
# If a vers*.texi file is needed, emit the rule.
if ($vtexi)
{
err_am ("'$vtexi', included in '$texi', "
. "also included in '$versions{$vtexi}'")
if defined $versions{$vtexi};
$versions{$vtexi} = $texi;
# We number the stamp-vti files. This is doable since the
# actual names don't matter much. We only number starting
# with the second one, so that the common case looks nice.
my $vti = ($done ? $done : 'vti');
++$done;
# This is ugly, but it is our historical practice.
if ($config_aux_dir_set_in_configure_ac)
{
require_conf_file_with_macro (TRUE, 'info_TEXINFOS', FOREIGN,
'mdate-sh');
}
else
{
require_file_with_macro (TRUE, 'info_TEXINFOS',
FOREIGN, 'mdate-sh');
}
my $conf_dir;
if ($config_aux_dir_set_in_configure_ac)
{
$conf_dir = "$am_config_aux_dir/";
}
else
{
$conf_dir = '$(srcdir)/';
}
$output_rules .= file_contents ('texi-vers',
new Automake::Location,
TEXI => $texi,
VTI => $vti,
STAMPVTI => "${soutdir}stamp-$vti",
VTEXI => "$soutdir$vtexi",
MDDIR => $conf_dir,
DIRSTAMP => $dirstamp);
}
}
# Handle location of texinfo.tex.
my $need_texi_file = 0;
my $texinfodir;
if (var ('TEXINFO_TEX'))
{
# The user defined TEXINFO_TEX so assume he knows what he is
# doing.
$texinfodir = ('$(srcdir)/'
. dirname (variable_value ('TEXINFO_TEX')));
}
elsif ($config_aux_dir_set_in_configure_ac)
{
$texinfodir = $am_config_aux_dir;
define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex", INTERNAL);
$need_texi_file = 2; # so that we require_conf_file later
}
else
{
$texinfodir = '$(srcdir)';
$need_texi_file = 1;
}
define_variable ('am__TEXINFO_TEX_DIR', $texinfodir, INTERNAL);
push (@dist_targets, 'dist-info');
if (! option 'no-installinfo')
{
# Make sure documentation is made and installed first. Use
# $(INFO_DEPS), not 'info', because otherwise recursive makes
# get run twice during "make all".
unshift (@all, '$(INFO_DEPS)');
}
define_files_variable ("DVIS", @infobase, 'dvi', INTERNAL);
define_files_variable ("PDFS", @infobase, 'pdf', INTERNAL);
define_files_variable ("PSS", @infobase, 'ps', INTERNAL);
define_files_variable ("HTMLS", @infobase, 'html', INTERNAL);
# This next isn't strictly needed now -- the places that look here
# could easily be changed to look in info_TEXINFOS. But this is
# probably better, in case noinst_TEXINFOS is ever supported.
define_variable ("TEXINFOS", variable_value ('info_TEXINFOS'), INTERNAL);
# Do some error checking. Note that this file is not required
# when in Cygnus mode; instead we defined TEXINFO_TEX explicitly
# up above.
if ($need_texi_file && ! option 'no-texinfo.tex')
{
if ($need_texi_file > 1)
{
require_conf_file_with_macro (TRUE, 'info_TEXINFOS', FOREIGN,
'texinfo.tex');
}
else
{
require_file_with_macro (TRUE, 'info_TEXINFOS', FOREIGN,
'texinfo.tex');
}
}
return (makefile_wrap ("", "\t ", @mostly_cleans),
makefile_wrap ("", "\t ", @texi_cleans),
makefile_wrap ("", "\t ", @maint_cleans));
}
# handle_texinfo ()
# -----------------
# Handle all Texinfo source.
sub handle_texinfo ()
{
reject_var 'TEXINFOS', "'TEXINFOS' is an anachronism; use 'info_TEXINFOS'";
# FIXME: I think this is an obsolete future feature name.
reject_var 'html_TEXINFOS', "HTML generation not yet supported";
my $info_texinfos = var ('info_TEXINFOS');
my ($mostlyclean, $clean, $maintclean) = ('', '', '');
if ($info_texinfos)
{
define_verbose_texinfo;
($mostlyclean, $clean, $maintclean) = handle_texinfo_helper ($info_texinfos);
chomp $mostlyclean;
chomp $clean;
chomp $maintclean;
}
$output_rules .= file_contents ('texinfos',
new Automake::Location,
AM_V_DVIPS => verbose_flag('DVIPS'),
MOSTLYCLEAN => $mostlyclean,
TEXICLEAN => $clean,
MAINTCLEAN => $maintclean,
'LOCAL-TEXIS' => !!$info_texinfos,
TEXIQUIET => verbose_flag('texinfo'));
}
# Handle any man pages.
sub handle_man_pages
{
reject_var 'MANS', "'MANS' is an anachronism; use 'man_MANS'";
# Find all the sections in use. We do this by first looking for
# "standard" sections, and then looking for any additional
# sections used in man_MANS.
my (%sections, %notrans_sections, %trans_sections,
%notrans_vars, %trans_vars, %notrans_sect_vars, %trans_sect_vars);
# We handle nodist_ for uniformity. man pages aren't distributed
# by default so it isn't actually very important.
foreach my $npfx ('', 'notrans_')
{
foreach my $pfx ('', 'dist_', 'nodist_')
{
# Add more sections as needed.
foreach my $section ('0'..'9', 'n', 'l')
{
my $varname = $npfx . $pfx . 'man' . $section . '_MANS';
if (var ($varname))
{
$sections{$section} = 1;
$varname = '$(' . $varname . ')';
if ($npfx eq 'notrans_')
{
$notrans_sections{$section} = 1;
$notrans_sect_vars{$varname} = 1;
}
else
{
$trans_sections{$section} = 1;
$trans_sect_vars{$varname} = 1;
}
&push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
my $varname = $npfx . $pfx . 'man_MANS';
my $var = var ($varname);
if ($var)
{
foreach ($var->value_as_list_recursive)
{
# A page like 'foo.1c' goes into man1dir.
if (/\.([0-9a-z])([a-z]*)$/)
{
$sections{$1} = 1;
if ($npfx eq 'notrans_')
{
$notrans_sections{$1} = 1;
}
else
{
$trans_sections{$1} = 1;
}
}
}
$varname = '$(' . $varname . ')';
if ($npfx eq 'notrans_')
{
$notrans_vars{$varname} = 1;
}
else
{
$trans_vars{$varname} = 1;
}
&push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
}
return unless %sections;
my @unsorted_deps;
# Build section independent variables.
my $have_notrans = %notrans_vars;
my @notrans_list = sort keys %notrans_vars;
my $have_trans = %trans_vars;
my @trans_list = sort keys %trans_vars;
# Now for each section, generate an install and uninstall rule.
# Sort sections so output is deterministic.
foreach my $section (sort keys %sections)
{
# Build section dependent variables.
my $notrans_mans = $have_notrans || exists $notrans_sections{$section};
my $trans_mans = $have_trans || exists $trans_sections{$section};
my (%notrans_this_sect, %trans_this_sect);
my $expr = 'man' . $section . '_MANS';
foreach my $varname (keys %notrans_sect_vars)
{
if ($varname =~ /$expr/)
{
$notrans_this_sect{$varname} = 1;
}
}
foreach my $varname (keys %trans_sect_vars)
{
if ($varname =~ /$expr/)
{
$trans_this_sect{$varname} = 1;
}
}
my @notrans_sect_list = sort keys %notrans_this_sect;
my @trans_sect_list = sort keys %trans_this_sect;
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
keys %notrans_this_sect, keys %trans_this_sect);
my @deps = sort @unsorted_deps;
$output_rules .= &file_contents ('mans',
new Automake::Location,
SECTION => $section,
DEPS => "@deps",
NOTRANS_MANS => $notrans_mans,
NOTRANS_SECT_LIST => "@notrans_sect_list",
HAVE_NOTRANS => $have_notrans,
NOTRANS_LIST => "@notrans_list",
TRANS_MANS => $trans_mans,
TRANS_SECT_LIST => "@trans_sect_list",
HAVE_TRANS => $have_trans,
TRANS_LIST => "@trans_list");
}
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
keys %notrans_sect_vars, keys %trans_sect_vars);
my @mans = sort @unsorted_deps;
$output_vars .= file_contents ('mans-vars',
new Automake::Location,
MANS => "@mans");
push (@all, '$(MANS)')
unless option 'no-installman';
}
# Handle DATA variables.
sub handle_data
{
&am_install_var ('-noextra', '-candist', 'data', 'DATA',
'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
'ps', 'sysconf', 'sharedstate', 'localstate',
'pkgdata', 'lisp', 'noinst', 'check');
}
# Handle TAGS.
sub handle_tags
{
my @config;
foreach my $spec (@config_headers)
{
my ($out, @ins) = split_config_file_spec ($spec);
foreach my $in (@ins)
{
# If the config header source is in this directory,
# require it.
push @config, basename ($in)
if $relative_dir eq dirname ($in);
}
}
define_variable ('am__tagged_files',
'$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
. "@config", INTERNAL);
if (rvar('am__tagged_files')->value_as_list_recursive
|| var ('ETAGS_ARGS') || var ('SUBDIRS'))
{
$output_rules .= &file_contents ('tags', new Automake::Location);
set_seen 'TAGS_DEPENDENCIES';
}
else
{
reject_var ('TAGS_DEPENDENCIES',
"it doesn't make sense to define 'TAGS_DEPENDENCIES'"
. " without\nsources or 'ETAGS_ARGS'");
# Every Makefile must define some sort of TAGS rule.
# Otherwise, it would be possible for a top-level "make TAGS"
# to fail because some subdirectory failed. Ditto ctags and
# cscope.
$output_rules .=
"tags TAGS:\n\n" .
"ctags CTAGS:\n\n" .
"cscope cscopelist:\n\n";
}
}
# user_phony_rule ($NAME)
# -----------------------
# Return false if rule $NAME does not exist. Otherwise,
# declare it as phony, complete its definition (in case it is
# conditional), and return its Automake::Rule instance.
sub user_phony_rule ($)
{
my ($name) = @_;
my $rule = rule $name;
if ($rule)
{
depend ('.PHONY', $name);
# Define $NAME in all condition where it is not already defined,
# so that it is always OK to depend on $NAME.
for my $c ($rule->not_always_defined_in_cond (TRUE)->conds)
{
Automake::Rule::define ($name, 'internal', RULE_AUTOMAKE,
$c, INTERNAL);
$output_rules .= $c->subst_string . "$name:\n";
}
}
return $rule;
}
# handle_dist
# -----------
# Handle 'dist' target.
sub handle_dist ()
{
# Substitutions for distdir.am
my %transform;
# Define DIST_SUBDIRS. This must always be done, regardless of the
# no-dist setting: target like 'distclean' or 'maintainer-clean' use it.
my $subdirs = var ('SUBDIRS');
if ($subdirs)
{
# If SUBDIRS is conditionally defined, then set DIST_SUBDIRS
# to all possible directories, and use it. If DIST_SUBDIRS is
# defined, just use it.
# Note that we check DIST_SUBDIRS first on purpose, so that
# we don't call has_conditional_contents for now reason.
# (In the past one project used so many conditional subdirectories
# that calling has_conditional_contents on SUBDIRS caused
# automake to grow to 150Mb -- this should not happen with
# the current implementation of has_conditional_contents,
# but it's more efficient to avoid the call anyway.)
if (var ('DIST_SUBDIRS'))
{
}
elsif ($subdirs->has_conditional_contents)
{
define_pretty_variable
('DIST_SUBDIRS', TRUE, INTERNAL,
uniq ($subdirs->value_as_list_recursive));
}
else
{
# We always define this because that is what 'distclean'
# wants.
define_pretty_variable ('DIST_SUBDIRS', TRUE, INTERNAL,
'$(SUBDIRS)');
}
}
# The remaining definitions are only required when a dist target is used.
return if option 'no-dist';
# At least one of the archive formats must be enabled.
if ($relative_dir eq '.')
{
my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
$archive_defined ||=
grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz);
error (option 'no-dist-gzip',
"no-dist-gzip specified but no dist-* specified,\n"
. "at least one archive format must be enabled")
unless $archive_defined;
}
# Look for common files that should be included in distribution.
# If the aux dir is set, and it does not have a Makefile.am, then
# we check for these files there as well.
my $check_aux = 0;
if ($relative_dir eq '.'
&& $config_aux_dir_set_in_configure_ac)
{
if (! &is_make_dir ($config_aux_dir))
{
$check_aux = 1;
}
}
foreach my $cfile (@common_files)
{
if (dir_has_case_matching_file ($relative_dir, $cfile)
# The file might be absent, but if it can be built it's ok.
|| rule $cfile)
{
&push_dist_common ($cfile);
}
# Don't use 'elsif' here because a file might meaningfully
# appear in both directories.
if ($check_aux && dir_has_case_matching_file ($config_aux_dir, $cfile))
{
&push_dist_common ("$config_aux_dir/$cfile")
}
}
# We might copy elements from $configure_dist_common to
# %dist_common if we think we need to. If the file appears in our
# directory, we would have discovered it already, so we don't
# check that. But if the file is in a subdir without a Makefile,
# we want to distribute it here if we are doing '.'. Ugly!
# Also, in some corner cases, it's possible that the following code
# will cause the same file to appear in the $(DIST_COMMON) variables
# of two distinct Makefiles; but this is not a problem, since the
# 'distdir' target in 'lib/am/distdir.am' can deal with the same
# file being distributed multiple times.
# See also automake bug#9651.
if ($relative_dir eq '.')
{
foreach my $file (split (' ' , $configure_dist_common))
{
my $dir = dirname ($file);
push_dist_common ($file)
if ($dir eq '.' || ! is_make_dir ($dir));
}
}
# Files to distributed. Don't use ->value_as_list_recursive
# as it recursively expands '$(dist_pkgdata_DATA)' etc.
my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value);
@dist_common = uniq @dist_common;
variable_delete 'DIST_COMMON';
define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
# Now that we've processed DIST_COMMON, disallow further attempts
# to set it.
$handle_dist_run = 1;
$transform{'DISTCHECK-HOOK'} = !! rule 'distcheck-hook';
$transform{'GETTEXT'} = $seen_gettext && !$seen_gettext_external;
# If the target 'dist-hook' exists, make sure it is run. This
# allows users to do random weird things to the distribution
# before it is packaged up.
push (@dist_targets, 'dist-hook')
if user_phony_rule 'dist-hook';
$transform{'DIST-TARGETS'} = join (' ', @dist_targets);
my $flm = option ('filename-length-max');
my $filename_filter = $flm ? '.' x $flm->[1] : '';
$output_rules .= &file_contents ('distdir',
new Automake::Location,
%transform,
FILENAME_FILTER => $filename_filter);
}
# check_directory ($NAME, $WHERE [, $RELATIVE_DIR = "."])
# -------------------------------------------------------
# Ensure $NAME is a directory (in $RELATIVE_DIR), and that it uses a sane
# name. Use $WHERE as a location in the diagnostic, if any.
sub check_directory ($$;$)
{
my ($dir, $where, $reldir) = @_;
$reldir = '.' unless defined $reldir;
error $where, "required directory $reldir/$dir does not exist"
unless -d "$reldir/$dir";
# If an 'obj/' directory exists, BSD make will enter it before
# reading 'Makefile'. Hence the 'Makefile' in the current directory
# will not be read.
#
# % cat Makefile
# all:
# echo Hello
# % cat obj/Makefile
# all:
# echo World
# % make # GNU make
# echo Hello
# Hello
# % pmake # BSD make
# echo World
# World
msg ('portability', $where,
"naming a subdirectory 'obj' causes troubles with BSD make")
if $dir eq 'obj';
# 'aux' is probably the most important of the following forbidden name,
# since it's tempting to use it as an AC_CONFIG_AUX_DIR.
msg ('portability', $where,
"name '$dir' is reserved on W32 and DOS platforms")
if grep (/^\Q$dir\E$/i, qw/aux lpt1 lpt2 lpt3 com1 com2 com3 com4 con prn/);
}
# check_directories_in_var ($VARIABLE)
# ------------------------------------
# Recursively check all items in variables $VARIABLE as directories
sub check_directories_in_var ($)
{
my ($var) = @_;
$var->traverse_recursively
(sub
{
my ($var, $val, $cond, $full_cond) = @_;
check_directory ($val, $var->rdef ($cond)->location, $relative_dir);
return ();
},
undef,
skip_ac_subst => 1);
}
# &handle_subdirs ()
# ------------------
# Handle subdirectories.
sub handle_subdirs ()
{
my $subdirs = var ('SUBDIRS');
return
unless $subdirs;
check_directories_in_var $subdirs;
my $dsubdirs = var ('DIST_SUBDIRS');
check_directories_in_var $dsubdirs
if $dsubdirs;
$output_rules .= &file_contents ('subdirs', new Automake::Location);
rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross!
}
# ($REGEN, @DEPENDENCIES)
# &scan_aclocal_m4
# ----------------
# If aclocal.m4 creation is automated, return the list of its dependencies.
sub scan_aclocal_m4 ()
{
my $regen_aclocal = 0;
set_seen 'CONFIG_STATUS_DEPENDENCIES';
set_seen 'CONFIGURE_DEPENDENCIES';
if (-f 'aclocal.m4')
{
&define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
my $aclocal = new Automake::XFile "< aclocal.m4";
my $line = $aclocal->getline;
$regen_aclocal = $line =~ 'generated automatically by aclocal';
}
my @ac_deps = ();
if (set_seen ('ACLOCAL_M4_SOURCES'))
{
push (@ac_deps, '$(ACLOCAL_M4_SOURCES)');
msg_var ('obsolete', 'ACLOCAL_M4_SOURCES',
"'ACLOCAL_M4_SOURCES' is obsolete.\n"
. "It should be safe to simply remove it");
}
# Note that it might be possible that aclocal.m4 doesn't exist but
# should be auto-generated. This case probably isn't very
# important.
return ($regen_aclocal, @ac_deps);
}
# Helper function for substitute_ac_subst_variables.
sub substitute_ac_subst_variables_worker($)
{
my ($token) = @_;
return "\@$token\@" if var $token;
return "\${$token\}";
}
# substitute_ac_subst_variables ($TEXT)
# -------------------------------------
# Replace any occurrence of ${FOO} in $TEXT by @FOO@ if FOO is an AC_SUBST
# variable.
sub substitute_ac_subst_variables ($)
{
my ($text) = @_;
$text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}
# @DEPENDENCIES
# &prepend_srcdir (@INPUTS)
# -------------------------
# Prepend $(srcdir) or $(top_srcdir) to all @INPUTS. The idea is that
# if an input file has a directory part the same as the current
# directory, then the directory part is simply replaced by $(srcdir).
# But if the directory part is different, then $(top_srcdir) is
# prepended.
sub prepend_srcdir (@)
{
my (@inputs) = @_;
my @newinputs;
foreach my $single (@inputs)
{
if (dirname ($single) eq $relative_dir)
{
push (@newinputs, '$(srcdir)/' . basename ($single));
}
else
{
push (@newinputs, '$(top_srcdir)/' . $single);
}
}
return @newinputs;
}
# @DEPENDENCIES
# rewrite_inputs_into_dependencies ($OUTPUT, @INPUTS)
# ---------------------------------------------------
# Compute a list of dependencies appropriate for the rebuild
# rule of
# AC_CONFIG_FILES($OUTPUT:$INPUT[0]:$INPUTS[1]:...)
# Also distribute $INPUTs which are not built by another AC_CONFIG_FOOs.
sub rewrite_inputs_into_dependencies ($@)
{
my ($file, @inputs) = @_;
my @res = ();
for my $i (@inputs)
{
# We cannot create dependencies on shell variables.
next if (substitute_ac_subst_variables $i) =~ /\$/;
if (exists $ac_config_files_location{$i} && $i ne $file)
{
my $di = dirname $i;
if ($di eq $relative_dir)
{
$i = basename $i;
}
# In the top-level Makefile we do not use $(top_builddir), because
# we are already there, and since the targets are built without
# a $(top_builddir), it helps BSD Make to match them with
# dependencies.
elsif ($relative_dir ne '.')
{
$i = '$(top_builddir)/' . $i;
}
}
else
{
msg ('error', $ac_config_files_location{$file},
"required file '$i' not found")
unless $i =~ /\$/ || exists $output_files{$i} || -f $i;
($i) = prepend_srcdir ($i);
push_dist_common ($i);
}
push @res, $i;
}
return @res;
}
# &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
# ------------------------------------------------------------------
# Handle remaking and configure stuff.
# We need the name of the input file, to do proper remaking rules.
sub handle_configure ($$$@)
{
my ($makefile_am, $makefile_in, $makefile, @inputs) = @_;
prog_error 'empty @inputs'
unless @inputs;
my ($rel_makefile_am, $rel_makefile_in) = prepend_srcdir ($makefile_am,
$makefile_in);
my $rel_makefile = basename $makefile;
my $colon_infile = ':' . join (':', @inputs);
$colon_infile = '' if $colon_infile eq ":$makefile.in";
my @rewritten = rewrite_inputs_into_dependencies ($makefile, @inputs);
my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4;
define_pretty_variable ('am__aclocal_m4_deps', TRUE, INTERNAL,
@configure_deps, @aclocal_m4_deps,
'$(top_srcdir)/' . $configure_ac);
my @configuredeps = ('$(am__aclocal_m4_deps)', '$(CONFIGURE_DEPENDENCIES)');
push @configuredeps, '$(ACLOCAL_M4)' if -f 'aclocal.m4';
define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
@configuredeps);
my $automake_options = '--' . $strictness_name .
(global_option 'no-dependencies' ? ' --ignore-deps' : '');
$output_rules .= file_contents
('configure',
new Automake::Location,
MAKEFILE => $rel_makefile,
'MAKEFILE-DEPS' => "@rewritten",
'CONFIG-MAKEFILE' => ($relative_dir eq '.') ? '$@' : '$(subdir)/$@',
'MAKEFILE-IN' => $rel_makefile_in,
'HAVE-MAKEFILE-IN-DEPS' => (@include_stack > 0),
'MAKEFILE-IN-DEPS' => "@include_stack",
'MAKEFILE-AM' => $rel_makefile_am,
'AUTOMAKE-OPTIONS' => $automake_options,
'MAKEFILE-AM-SOURCES' => "$makefile$colon_infile",
'REGEN-ACLOCAL-M4' => $regen_aclocal_m4,
VERBOSE => verbose_flag ('GEN'));
if ($relative_dir eq '.')
{
&push_dist_common ('acconfig.h')
if -f 'acconfig.h';
}
# If we have a configure header, require it.
my $hdr_index = 0;
my @distclean_config;
foreach my $spec (@config_headers)
{
$hdr_index += 1;
# $CONFIG_H_PATH: config.h from top level.
my ($config_h_path, @ins) = split_config_file_spec ($spec);
my $config_h_dir = dirname ($config_h_path);
# If the header is in the current directory we want to build
# the header here. Otherwise, if we're at the topmost
# directory and the header's directory doesn't have a
# Makefile, then we also want to build the header.
if ($relative_dir eq $config_h_dir
|| ($relative_dir eq '.' && ! &is_make_dir ($config_h_dir)))
{
my ($cn_sans_dir, $stamp_dir);
if ($relative_dir eq $config_h_dir)
{
$cn_sans_dir = basename ($config_h_path);
$stamp_dir = '';
}
else
{
$cn_sans_dir = $config_h_path;
if ($config_h_dir eq '.')
{
$stamp_dir = '';
}
else
{
$stamp_dir = $config_h_dir . '/';
}
}
# This will also distribute all inputs.
@ins = rewrite_inputs_into_dependencies ($config_h_path, @ins);
# Cannot define rebuild rules for filenames with shell variables.
next if (substitute_ac_subst_variables $config_h_path) =~ /\$/;
# Header defined in this directory.
my @files;
if (-f $config_h_path . '.top')
{
push (@files, "$cn_sans_dir.top");
}
if (-f $config_h_path . '.bot')
{
push (@files, "$cn_sans_dir.bot");
}
push_dist_common (@files);
# For now, acconfig.h can only appear in the top srcdir.
if (-f 'acconfig.h')
{
push (@files, '$(top_srcdir)/acconfig.h');
}
my $stamp = "${stamp_dir}stamp-h${hdr_index}";
$output_rules .=
file_contents ('remake-hdr',
new Automake::Location,
FILES => "@files",
'FIRST-HDR' => ($hdr_index == 1),
CONFIG_H => $cn_sans_dir,
CONFIG_HIN => $ins[0],
CONFIG_H_DEPS => "@ins",
CONFIG_H_PATH => $config_h_path,
STAMP => "$stamp");
push @distclean_config, $cn_sans_dir, $stamp;
}
}
$output_rules .= file_contents ('clean-hdr',
new Automake::Location,
FILES => "@distclean_config")
if @distclean_config;
# Distribute and define mkinstalldirs only if it is already present
# in the package, for backward compatibility (some people may still
# use $(mkinstalldirs)).
# TODO: start warning about this in Automake 1.14, and have
# TODO: Automake 2.0 drop it (and the mkinstalldirs script
# TODO: as well).
my $mkidpath = "$config_aux_dir/mkinstalldirs";
if (-f $mkidpath)
{
# Use require_file so that any existing script gets updated
# by --force-missing.
require_conf_file ($mkidpath, FOREIGN, 'mkinstalldirs');
define_variable ('mkinstalldirs',
"\$(SHELL) $am_config_aux_dir/mkinstalldirs", INTERNAL);
}
else
{
# Use $(install_sh), not $(MKDIR_P) because the latter requires
# at least one argument, and $(mkinstalldirs) used to work
# even without arguments (e.g. $(mkinstalldirs) $(conditional_dir)).
define_variable ('mkinstalldirs', '$(install_sh) -d', INTERNAL);
}
reject_var ('CONFIG_HEADER',
"'CONFIG_HEADER' is an anachronism; now determined "
. "automatically\nfrom '$configure_ac'");
my @config_h;
foreach my $spec (@config_headers)
{
my ($out, @ins) = split_config_file_spec ($spec);
# Generate CONFIG_HEADER define.
if ($relative_dir eq dirname ($out))
{
push @config_h, basename ($out);
}
else
{
push @config_h, "\$(top_builddir)/$out";
}
}
define_variable ("CONFIG_HEADER", "@config_h", INTERNAL)
if @config_h;
# Now look for other files in this directory which must be remade
# by config.status, and generate rules for them.
my @actual_other_files = ();
# These get cleaned only in a VPATH build.
my @actual_other_vpath_files = ();
foreach my $lfile (@other_input_files)
{
my $file;
my @inputs;
if ($lfile =~ /^([^:]*):(.*)$/)
{
# This is the ":" syntax of AC_OUTPUT.
$file = $1;
@inputs = split (':', $2);
}
else
{
# Normal usage.
$file = $lfile;
@inputs = $file . '.in';
}
# Automake files should not be stored in here, but in %MAKE_LIST.
prog_error ("$lfile in \@other_input_files\n"
. "\@other_input_files = (@other_input_files)")
if -f $file . '.am';
my $local = basename ($file);
# We skip files that aren't in this directory. However, if
# the file's directory does not have a Makefile, and we are
# currently doing '.', then we create a rule to rebuild the
# file in the subdir.
my $fd = dirname ($file);
if ($fd ne $relative_dir)
{
if ($relative_dir eq '.' && ! &is_make_dir ($fd))
{
$local = $file;
}
else
{
next;
}
}
my @rewritten_inputs = rewrite_inputs_into_dependencies ($file, @inputs);
# Cannot output rules for shell variables.
next if (substitute_ac_subst_variables $local) =~ /\$/;
my $condstr = '';
my $cond = $ac_config_files_condition{$lfile};
if (defined $cond)
{
$condstr = $cond->subst_string;
Automake::Rule::define ($local, $configure_ac, RULE_AUTOMAKE, $cond,
$ac_config_files_location{$file});
}
$output_rules .= ($condstr . $local . ': '
. '$(top_builddir)/config.status '
. "@rewritten_inputs\n"
. $condstr . "\t"
. 'cd $(top_builddir) && '
. '$(SHELL) ./config.status '
. ($relative_dir eq '.' ? '' : '$(subdir)/')
. '$@'
. "\n");
push (@actual_other_files, $local);
}
# For links we should clean destinations and distribute sources.
foreach my $spec (@config_links)
{
my ($link, $file) = split /:/, $spec;
# Some people do AC_CONFIG_LINKS($computed). We only handle
# the DEST:SRC form.
next unless $file;
my $where = $ac_config_files_location{$link};
# Skip destinations that contain shell variables.
if ((substitute_ac_subst_variables $link) !~ /\$/)
{
# We skip links that aren't in this directory. However, if
# the link's directory does not have a Makefile, and we are
# currently doing '.', then we add the link to CONFIG_CLEAN_FILES
# in '.'s Makefile.in.
my $local = basename ($link);
my $fd = dirname ($link);
if ($fd ne $relative_dir)
{
if ($relative_dir eq '.' && ! &is_make_dir ($fd))
{
$local = $link;
}
else
{
$local = undef;
}
}
if ($file ne $link)
{
push @actual_other_files, $local if $local;
}
else
{
push @actual_other_vpath_files, $local if $local;
}
}
# Do not process sources that contain shell variables.
if ((substitute_ac_subst_variables $file) !~ /\$/)
{
my $fd = dirname ($file);
# We distribute files that are in this directory.
# At the top-level ('.') we also distribute files whose
# directory does not have a Makefile.
if (($fd eq $relative_dir)
|| ($relative_dir eq '.' && ! &is_make_dir ($fd)))
{
# The following will distribute $file as a side-effect when
# it is appropriate (i.e., when $file is not already an output).
# We do not need the result, just the side-effect.
rewrite_inputs_into_dependencies ($link, $file);
}
}
}
# These files get removed by "make distclean".
define_pretty_variable ('CONFIG_CLEAN_FILES', TRUE, INTERNAL,
@actual_other_files);
define_pretty_variable ('CONFIG_CLEAN_VPATH_FILES', TRUE, INTERNAL,
@actual_other_vpath_files);
}
# Handle C headers.
sub handle_headers
{
my @r = &am_install_var ('-defaultdist', 'header', 'HEADERS', 'include',
'oldinclude', 'pkginclude',
'noinst', 'check');
foreach (@r)
{
next unless $_->[1] =~ /\..*$/;
&saw_extension ($&);
}
}
sub handle_gettext
{
return if ! $seen_gettext || $relative_dir ne '.';
my $subdirs = var 'SUBDIRS';
if (! $subdirs)
{
err_ac "AM_GNU_GETTEXT used but SUBDIRS not defined";
return;
}
# Perform some sanity checks to help users get the right setup.
# We disable these tests when po/ doesn't exist in order not to disallow
# unusual gettext setups.
#
# Bruno Haible:
# | The idea is:
# |
# | 1) If a package doesn't have a directory po/ at top level, it
# | will likely have multiple po/ directories in subpackages.
# |
# | 2) It is useful to warn for the absence of intl/ if AM_GNU_GETTEXT
# | is used without 'external'. It is also useful to warn for the
# | presence of intl/ if AM_GNU_GETTEXT([external]) is used. Both
# | warnings apply only to the usual layout of packages, therefore
# | they should both be disabled if no po/ directory is found at
# | top level.
if (-d 'po')
{
my @subdirs = $subdirs->value_as_list_recursive;
msg_var ('syntax', $subdirs,
"AM_GNU_GETTEXT used but 'po' not in SUBDIRS")
if ! grep ($_ eq 'po', @subdirs);
# intl/ is not required when AM_GNU_GETTEXT is called with the
# 'external' option and AM_GNU_GETTEXT_INTL_SUBDIR is not called.
msg_var ('syntax', $subdirs,
"AM_GNU_GETTEXT used but 'intl' not in SUBDIRS")
if (! ($seen_gettext_external && ! $seen_gettext_intl)
&& ! grep ($_ eq 'intl', @subdirs));
# intl/ should not be used with AM_GNU_GETTEXT([external]), except
# if AM_GNU_GETTEXT_INTL_SUBDIR is called.
msg_var ('syntax', $subdirs,
"'intl' should not be in SUBDIRS when "
. "AM_GNU_GETTEXT([external]) is used")
if ($seen_gettext_external && ! $seen_gettext_intl
&& grep ($_ eq 'intl', @subdirs));
}
require_file ($ac_gettext_location, GNU, 'ABOUT-NLS');
}
# Handle footer elements.
sub handle_footer
{
reject_rule ('.SUFFIXES',
"use variable 'SUFFIXES', not target '.SUFFIXES'");
# Note: AIX 4.1 /bin/make will fail if any suffix rule appears
# before .SUFFIXES. So we make sure that .SUFFIXES appears before
# anything else, by sticking it right after the default: target.
$output_header .= ".SUFFIXES:\n";
my $suffixes = var 'SUFFIXES';
my @suffixes = Automake::Rule::suffixes;
if (@suffixes || $suffixes)
{
# Make sure SUFFIXES has unique elements. Sort them to ensure
# the output remains consistent. However, $(SUFFIXES) is
# always at the start of the list, unsorted. This is done
# because make will choose rules depending on the ordering of
# suffixes, and this lets the user have some control. Push
# actual suffixes, and not $(SUFFIXES). Some versions of make
# do not like variable substitutions on the .SUFFIXES line.
my @user_suffixes = ($suffixes
? $suffixes->value_as_list_recursive : ());
my %suffixes = map { $_ => 1 } @suffixes;
delete @suffixes{@user_suffixes};
$output_header .= (".SUFFIXES: "
. join (' ', @user_suffixes, sort keys %suffixes)
. "\n");
}
$output_trailer .= file_contents ('footer', new Automake::Location);
}
# Generate 'make install' rules.
sub handle_install ()
{
$output_rules .= &file_contents
('install',
new Automake::Location,
maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES')
? (" \$(BUILT_SOURCES)\n"
. "\t\$(MAKE) \$(AM_MAKEFLAGS)")
: ''),
'installdirs-local' => (user_phony_rule 'installdirs-local'
? ' installdirs-local' : ''),
am__installdirs => variable_value ('am__installdirs') || '');
}
# Deal with all and all-am.
sub handle_all ($)
{
my ($makefile) = @_;
# Output 'all-am'.
# Put this at the beginning for the sake of non-GNU makes. This
# is still wrong if these makes can run parallel jobs. But it is
# right enough.
unshift (@all, basename ($makefile));
foreach my $spec (@config_headers)
{
my ($out, @ins) = split_config_file_spec ($spec);
push (@all, basename ($out))
if dirname ($out) eq $relative_dir;
}
# Install 'all' hooks.
push (@all, "all-local")
if user_phony_rule "all-local";
&pretty_print_rule ("all-am:", "\t\t", @all);
&depend ('.PHONY', 'all-am', 'all');
# Output 'all'.
my @local_headers = ();
push @local_headers, '$(BUILT_SOURCES)'
if var ('BUILT_SOURCES');
foreach my $spec (@config_headers)
{
my ($out, @ins) = split_config_file_spec ($spec);
push @local_headers, basename ($out)
if dirname ($out) eq $relative_dir;
}
if (@local_headers)
{
# We need to make sure config.h is built before we recurse.
# We also want to make sure that built sources are built
# before any ordinary 'all' targets are run. We can't do this
# by changing the order of dependencies to the "all" because
# that breaks when using parallel makes. Instead we handle
# things explicitly.
$output_all .= ("all: @local_headers"
. "\n\t"
. '$(MAKE) $(AM_MAKEFLAGS) '
. (var ('SUBDIRS') ? 'all-recursive' : 'all-am')
. "\n\n");
depend ('.MAKE', 'all');
}
else
{
$output_all .= "all: " . (var ('SUBDIRS')
? 'all-recursive' : 'all-am') . "\n\n";
}
}
# Generate helper targets for user recursion, where needed.
sub handle_user_recursion ()
{
return unless @extra_recursive_targets;
define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL,
map { "$_-recursive" } @extra_recursive_targets);
my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
foreach my $target (@extra_recursive_targets)
{
# This allows the default target's rules to be overridden in
# Makefile.am.
user_phony_rule ($target);
depend ("$target", "$target-$aux");
depend ("$target-am", "$target-local");
# Every user-defined recursive target 'foo' *must* have a valid
# associated 'foo-local' rule; we define it as an empty rule by
# default, so that the user can transparently extend it in his
# own Makefile.am.
pretty_print_rule ("$target-local:");
# $target-recursive might as well be undefined, so do not add
# it here; it's taken care of in subdirs.am anyway.
depend (".PHONY", "$target-am", "$target-local");
}
}
# &do_check_merge_target ()
# -------------------------
# Handle check merge target specially.
sub do_check_merge_target ()
{
# Include user-defined local form of target.
push @check_tests, 'check-local'
if user_phony_rule 'check-local';
# The check target must depend on the local equivalent of
# 'all', to ensure all the primary targets are built. Then it
# must build the local check rules.
$output_rules .= "check-am: all-am\n";
if (@check)
{
pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @check);
depend ('.MAKE', 'check-am');
}
if (@check_tests)
{
pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
@check_tests);
depend ('.MAKE', 'check-am');
}
depend '.PHONY', 'check', 'check-am';
# Handle recursion. We have to honor BUILT_SOURCES like for 'all:'.
$output_rules .= ("check: "
. (var ('BUILT_SOURCES')
? "\$(BUILT_SOURCES)\n\t\$(MAKE) \$(AM_MAKEFLAGS) "
: '')
. (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
. "\n");
depend ('.MAKE', 'check')
if var ('BUILT_SOURCES');
}
# handle_clean ($MAKEFILE)
# ------------------------
# Handle all 'clean' targets.
sub handle_clean ($)
{
my ($makefile) = @_;
# Clean the files listed in user variables if they exist.
$clean_files{'$(MOSTLYCLEANFILES)'} = MOSTLY_CLEAN
if var ('MOSTLYCLEANFILES');
$clean_files{'$(CLEANFILES)'} = CLEAN
if var ('CLEANFILES');
$clean_files{'$(DISTCLEANFILES)'} = DIST_CLEAN
if var ('DISTCLEANFILES');
$clean_files{'$(MAINTAINERCLEANFILES)'} = MAINTAINER_CLEAN
if var ('MAINTAINERCLEANFILES');
# Built sources are automatically removed by maintainer-clean.
$clean_files{'$(BUILT_SOURCES)'} = MAINTAINER_CLEAN
if var ('BUILT_SOURCES');
# Compute a list of "rm"s to run for each target.
my %rms = (MOSTLY_CLEAN, [],
CLEAN, [],
DIST_CLEAN, [],
MAINTAINER_CLEAN, []);
foreach my $file (keys %clean_files)
{
my $when = $clean_files{$file};
prog_error 'invalid entry in %clean_files'
unless exists $rms{$when};
my $rm = "rm -f $file";
# If file is a variable, make sure when don't call 'rm -f' without args.
$rm ="test -z \"$file\" || $rm"
if ($file =~ /^\s*\$(\(.*\)|\{.*\})\s*$/);
push @{$rms{$when}}, "\t-$rm\n";
}
$output_rules .= &file_contents
('clean',
new Automake::Location,
MOSTLYCLEAN_RMS => join ('', sort @{$rms{&MOSTLY_CLEAN}}),
CLEAN_RMS => join ('', sort @{$rms{&CLEAN}}),
DISTCLEAN_RMS => join ('', sort @{$rms{&DIST_CLEAN}}),
MAINTAINER_CLEAN_RMS => join ('', sort @{$rms{&MAINTAINER_CLEAN}}),
MAKEFILE => basename $makefile,
);
}
# &target_cmp ($A, $B)
# --------------------
# Subroutine for &handle_factored_dependencies to let '.PHONY' and
# other '.TARGETS' be last.
sub target_cmp
{
return 0 if $a eq $b;
my $a1 = substr ($a, 0, 1);
my $b1 = substr ($b, 0, 1);
if ($a1 ne $b1)
{
return -1 if $b1 eq '.';
return 1 if $a1 eq '.';
}
return $a cmp $b;
}
# &handle_factored_dependencies ()
# --------------------------------
# Handle everything related to gathered targets.
sub handle_factored_dependencies
{
# Reject bad hooks.
foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook',
'uninstall-exec-local', 'uninstall-exec-hook',
'uninstall-dvi-local',
'uninstall-html-local',
'uninstall-info-local',
'uninstall-pdf-local',
'uninstall-ps-local')
{
my $x = $utarg;
$x =~ s/-.*-/-/;
reject_rule ($utarg, "use '$x', not '$utarg'");
}
reject_rule ('install-local',
"use 'install-data-local' or 'install-exec-local', "
. "not 'install-local'");
reject_rule ('install-hook',
"use 'install-data-hook' or 'install-exec-hook', "
. "not 'install-hook'");
# Install the -local hooks.
foreach (keys %dependencies)
{
# Hooks are installed on the -am targets.
s/-am$// or next;
depend ("$_-am", "$_-local")
if user_phony_rule "$_-local";
}
# Install the -hook hooks.
# FIXME: Why not be as liberal as we are with -local hooks?
foreach ('install-exec', 'install-data', 'uninstall')
{
if (user_phony_rule "$_-hook")
{
depend ('.MAKE', "$_-am");
register_action("$_-am",
("\t\@\$(NORMAL_INSTALL)\n"
. "\t\$(MAKE) \$(AM_MAKEFLAGS) $_-hook"));
}
}
# All the required targets are phony.
depend ('.PHONY', keys %required_targets);
# Actually output gathered targets.
foreach (sort target_cmp keys %dependencies)
{
# If there is nothing about this guy, skip it.
next
unless (@{$dependencies{$_}}
|| $actions{$_}
|| $required_targets{$_});
# Define gathered targets in undefined conditions.
# FIXME: Right now we must handle .PHONY as an exception,
# because people write things like
# .PHONY: myphonytarget
# to append dependencies. This would not work if Automake
# refrained from defining its own .PHONY target as it does
# with other overridden targets.
# Likewise for '.MAKE'.
my @undefined_conds = (TRUE,);
if ($_ ne '.PHONY' && $_ ne '.MAKE')
{
@undefined_conds =
Automake::Rule::define ($_, 'internal',
RULE_AUTOMAKE, TRUE, INTERNAL);
}
my @uniq_deps = uniq (sort @{$dependencies{$_}});
foreach my $cond (@undefined_conds)
{
my $condstr = $cond->subst_string;
&pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps);
$output_rules .= $actions{$_} if defined $actions{$_};
$output_rules .= "\n";
}
}
}
# &handle_tests_dejagnu ()
# ------------------------
sub handle_tests_dejagnu
{
push (@check_tests, 'check-DEJAGNU');
$output_rules .= file_contents ('dejagnu', new Automake::Location);
}
sub handle_per_suffix_test
{
my ($test_suffix, %transform) = @_;
my ($pfx, $generic, $am_exeext);
if ($test_suffix eq '')
{
$pfx = '';
$generic = 0;
$am_exeext = 'FALSE';
}
else
{
prog_error ("test suffix '$test_suffix' lacks leading dot")
unless $test_suffix =~ m/^\.(.*)/;
$pfx = uc ($1) . '_';
$generic = 1;
$am_exeext = exists $configure_vars{'EXEEXT'} ? 'am__EXEEXT'
: 'FALSE';
}
# The "test driver" program, deputed to handle tests protocol used by
# test scripts. By default, it's assumed that no protocol is used, so
# we fall back to the old behaviour, implemented by the 'test-driver'
# auxiliary script.
if (! var "${pfx}LOG_DRIVER")
{
require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
define_variable ("${pfx}LOG_DRIVER",
"\$(SHELL) $am_config_aux_dir/test-driver",
INTERNAL);
}
my $driver = '$(' . $pfx . 'LOG_DRIVER)';
my $driver_flags = '$(AM_' . $pfx . 'LOG_DRIVER_FLAGS)'
. ' $(' . $pfx . 'LOG_DRIVER_FLAGS)';
my $compile = "${pfx}LOG_COMPILE";
define_variable ($compile,
'$(' . $pfx . 'LOG_COMPILER)'
. ' $(AM_' . $pfx . 'LOG_FLAGS)'
. ' $(' . $pfx . 'LOG_FLAGS)',
INTERNAL);
$output_rules .= file_contents ('check2', new Automake::Location,
GENERIC => $generic,
DRIVER => $driver,
DRIVER_FLAGS => $driver_flags,
COMPILE => '$(' . $compile . ')',
EXT => $test_suffix,
am__EXEEXT => $am_exeext,
%transform);
}
# is_valid_test_extension ($EXT)
# ------------------------------
# Return true if $EXT can appear in $(TEST_EXTENSIONS), return false
# otherwise.
sub is_valid_test_extension ($)
{
my $ext = shift;
return 1
if ($ext =~ /^\.[a-zA-Z_][a-zA-Z0-9_]*$/);
return 1
if (exists $configure_vars{'EXEEXT'} && $ext eq subst ('EXEEXT'));
return 0;
}
# Handle TESTS variable and other checks.
sub handle_tests
{
if (option 'dejagnu')
{
&handle_tests_dejagnu;
}
else
{
foreach my $c ('DEJATOOL', 'RUNTEST', 'RUNTESTFLAGS')
{
reject_var ($c, "'$c' defined but 'dejagnu' not in "
. "'AUTOMAKE_OPTIONS'");
}
}
if (var ('TESTS'))
{
push (@check_tests, 'check-TESTS');
my $check_deps = "@check";
$output_rules .= &file_contents ('check', new Automake::Location,
SERIAL_TESTS => !! option 'serial-tests',
CHECK_DEPS => $check_deps);
# Tests that are known programs should have $(EXEEXT) appended.
# For matching purposes, we need to adjust XFAIL_TESTS as well.
append_exeext { exists $known_programs{$_[0]} } 'TESTS';
append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
if (var ('XFAIL_TESTS'));
if (! option 'serial-tests')
{
define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL);
my $suff = '.test';
my $at_exeext = '';
my $handle_exeext = exists $configure_vars{'EXEEXT'};
if ($handle_exeext)
{
$at_exeext = subst ('EXEEXT');
$suff = $at_exeext . ' ' . $suff;
}
if (! var 'TEST_EXTENSIONS')
{
define_variable ('TEST_EXTENSIONS', $suff, INTERNAL);
}
my $var = var 'TEST_EXTENSIONS';
# Currently, we are not able to deal with conditional contents
# in TEST_EXTENSIONS.
if ($var->has_conditional_contents)
{
msg_var 'unsupported', $var,
"'TEST_EXTENSIONS' cannot have conditional contents";
}
my @test_suffixes = $var->value_as_list_recursive;
if ((my @invalid_test_suffixes =
grep { !is_valid_test_extension $_ } @test_suffixes) > 0)
{
error $var->rdef (TRUE)->location,
"invalid test extensions: @invalid_test_suffixes";
}
@test_suffixes = grep { is_valid_test_extension $_ } @test_suffixes;
if ($handle_exeext)
{
unshift (@test_suffixes, $at_exeext)
unless $test_suffixes[0] eq $at_exeext;
}
unshift (@test_suffixes, '');
transform_variable_recursively
('TESTS', 'TEST_LOGS', 'am__testlogs', 1, INTERNAL,
sub {
my ($subvar, $val, $cond, $full_cond) = @_;
my $obj = $val;
return $obj
if $val =~ /^\@.*\@$/;
$obj =~ s/\$\(EXEEXT\)$//o;
if ($val =~ /(\$\((top_)?srcdir\))\//o)
{
msg ('error', $subvar->rdef ($cond)->location,
"using '$1' in TESTS is currently broken: '$val'");
}
foreach my $test_suffix (@test_suffixes)
{
next
if $test_suffix eq $at_exeext || $test_suffix eq '';
return substr ($obj, 0, length ($obj) - length ($test_suffix)) . '.log'
if substr ($obj, - length ($test_suffix)) eq $test_suffix;
}
my $base = $obj;
$obj .= '.log';
handle_per_suffix_test ('',
OBJ => $obj,
BASE => $base,
SOURCE => $val);
return $obj;
});
my $nhelper=1;
my $prev = 'TESTS';
my $post = '';
my $last_suffix = $test_suffixes[$#test_suffixes];
my $cur = '';
foreach my $test_suffix (@test_suffixes)
{
if ($test_suffix eq $last_suffix)
{
$cur = 'TEST_LOGS';
}
else
{
$cur = 'am__test_logs' . $nhelper;
}
define_variable ($cur,
'$(' . $prev . ':' . $test_suffix . $post . '=.log)', INTERNAL);
$post = '.log';
$prev = $cur;
$nhelper++;
if ($test_suffix ne $at_exeext && $test_suffix ne '')
{
handle_per_suffix_test ($test_suffix,
OBJ => '',
BASE => '$*',
SOURCE => '$<');
}
}
$clean_files{'$(TEST_LOGS)'} = MOSTLY_CLEAN;
$clean_files{'$(TEST_LOGS:.log=.trs)'} = MOSTLY_CLEAN;
$clean_files{'$(TEST_SUITE_LOG)'} = MOSTLY_CLEAN;
}
}
}
# Handle Emacs Lisp.
sub handle_emacs_lisp
{
my @elfiles = &am_install_var ('-candist', 'lisp', 'LISP',
'lisp', 'noinst');
return if ! @elfiles;
define_pretty_variable ('am__ELFILES', TRUE, INTERNAL,
map { $_->[1] } @elfiles);
define_pretty_variable ('am__ELCFILES', TRUE, INTERNAL,
'$(am__ELFILES:.el=.elc)');
# This one can be overridden by users.
define_pretty_variable ('ELCFILES', TRUE, INTERNAL, '$(LISP:.el=.elc)');
push @all, '$(ELCFILES)';
require_variables ($elfiles[0][0], "Emacs Lisp sources seen", TRUE,
'EMACS', 'lispdir');
}
# Handle Python
sub handle_python
{
my @pyfiles = &am_install_var ('-defaultdist', 'python', 'PYTHON',
'noinst');
return if ! @pyfiles;
require_variables ($pyfiles[0][0], "Python sources seen", TRUE, 'PYTHON');
require_conf_file ($pyfiles[0][0], FOREIGN, 'py-compile');
&define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
}
# Handle Java.
sub handle_java
{
my @sourcelist = &am_install_var ('-candist',
'java', 'JAVA',
'noinst', 'check');
return if ! @sourcelist;
my @prefixes = am_primary_prefixes ('JAVA', 1,
'noinst', 'check');
my $dir;
my @java_sources = ();
foreach my $prefix (@prefixes)
{
(my $curs = $prefix) =~ s/^(?:nobase_)?(?:dist_|nodist_)?//;
next
if $curs eq 'EXTRA';
push @java_sources, '$(' . $prefix . '_JAVA' . ')';
if (defined $dir)
{
err_var "${curs}_JAVA", "multiple _JAVA primaries in use"
unless $curs eq $dir;
}
$dir = $curs;
}
define_pretty_variable ('am__java_sources', TRUE, INTERNAL,
"@java_sources");
if ($dir eq 'check')
{
push (@check, "class$dir.stamp");
}
else
{
push (@all, "class$dir.stamp");
}
}
# Handle some of the minor options.
sub handle_minor_options
{
if (option 'readme-alpha')
{
if ($relative_dir eq '.')
{
if ($package_version !~ /^$GNITS_VERSION_PATTERN$/)
{
msg ('error-gnits', $package_version_location,
"version '$package_version' doesn't follow " .
"Gnits standards");
}
if (defined $1 && -f 'README-alpha')
{
# This means we have an alpha release. See
# GNITS_VERSION_PATTERN for details.
push_dist_common ('README-alpha');
}
}
}
}
################################################################
# ($OUTPUT, @INPUTS)
# &split_config_file_spec ($SPEC)
# -------------------------------
# Decode the Autoconf syntax for config files (files, headers, links
# etc.).
sub split_config_file_spec ($)
{
my ($spec) = @_;
my ($output, @inputs) = split (/:/, $spec);
push @inputs, "$output.in"
unless @inputs;
return ($output, @inputs);
}
# $input
# locate_am (@POSSIBLE_SOURCES)
# -----------------------------
# AC_CONFIG_FILES allow specifications such as Makefile:top.in:mid.in:bot.in
# This functions returns the first *.in file for which a *.am exists.
# It returns undef otherwise.
sub locate_am (@)
{
my (@rest) = @_;
my $input;
foreach my $file (@rest)
{
if (($file =~ /^(.*)\.in$/) && -f "$1.am")
{
$input = $file;
last;
}
}
return $input;
}
my %make_list;
# &scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
# ---------------------------------------------------
# Study $CONFIG-FILES which is the first argument to AC_CONFIG_FILES
# (or AC_OUTPUT).
sub scan_autoconf_config_files ($$)
{
my ($where, $config_files) = @_;
# Look at potential Makefile.am's.
foreach (split ' ', $config_files)
{
# Must skip empty string for Perl 4.
next if $_ eq "\\" || $_ eq '';
# Handle $local:$input syntax.
my ($local, @rest) = split (/:/);
@rest = ("$local.in",) unless @rest;
# Keep in sync with test 'conffile-leading-dot.sh'.
msg ('unsupported', $where,
"omit leading './' from config file names such as '$local';"
. "\nremake rules might be subtly broken otherwise")
if ($local =~ /^\.\//);
my $input = locate_am @rest;
if ($input)
{
# We have a file that automake should generate.
$make_list{$input} = join (':', ($local, @rest));
}
else
{
# We have a file that automake should cause to be
# rebuilt, but shouldn't generate itself.
push (@other_input_files, $_);
}
$ac_config_files_location{$local} = $where;
$ac_config_files_condition{$local} =
new Automake::Condition (@cond_stack)
if (@cond_stack);
}
}
# &scan_autoconf_traces ($FILENAME)
# ---------------------------------
sub scan_autoconf_traces ($)
{
my ($filename) = @_;
# Macros to trace, with their minimal number of arguments.
#
# IMPORTANT: If you add a macro here, you should also add this macro
# ========= to Automake-preselection in autoconf/lib/autom4te.in.
my %traced = (
AC_CANONICAL_BUILD => 0,
AC_CANONICAL_HOST => 0,
AC_CANONICAL_TARGET => 0,
AC_CONFIG_AUX_DIR => 1,
AC_CONFIG_FILES => 1,
AC_CONFIG_HEADERS => 1,
AC_CONFIG_LIBOBJ_DIR => 1,
AC_CONFIG_LINKS => 1,
AC_FC_SRCEXT => 1,
AC_INIT => 0,
AC_LIBSOURCE => 1,
AC_REQUIRE_AUX_FILE => 1,
AC_SUBST_TRACE => 1,
AM_AUTOMAKE_VERSION => 1,
AM_PROG_MKDIR_P => 0,
AM_CONDITIONAL => 2,
AM_EXTRA_RECURSIVE_TARGETS => 1,
AM_GNU_GETTEXT => 0,
AM_GNU_GETTEXT_INTL_SUBDIR => 0,
AM_INIT_AUTOMAKE => 0,
AM_MAINTAINER_MODE => 0,
AM_PROG_AR => 0,
AM_PROG_CC_C_O => 0,
_AM_SUBST_NOTMAKE => 1,
_AM_COND_IF => 1,
_AM_COND_ELSE => 1,
_AM_COND_ENDIF => 1,
LT_SUPPORTED_TAG => 1,
_LT_AC_TAGCONFIG => 0,
m4_include => 1,
m4_sinclude => 1,
sinclude => 1,
);
my $traces = ($ENV{AUTOCONF} || '/usr/local/bin/autoconf') . " ";
# Use a separator unlikely to be used, not ':', the default, which
# has a precise meaning for AC_CONFIG_FILES and so on.
$traces .= join (' ',
map { "--trace=$_" . ':\$f:\$l::\$d::\$n::\${::}%' }
(keys %traced));
my $tracefh = new Automake::XFile ("$traces $filename |");
verb "reading $traces";
@cond_stack = ();
my $where;
while ($_ = $tracefh->getline)
{
chomp;
my ($here, $depth, @args) = split (/::/);
$where = new Automake::Location $here;
my $macro = $args[0];
prog_error ("unrequested trace '$macro'")
unless exists $traced{$macro};
# Skip and diagnose malformed calls.
if ($#args < $traced{$macro})
{
msg ('syntax', $where, "not enough arguments for $macro");
next;
}
# Alphabetical ordering please.
if ($macro eq 'AC_CANONICAL_BUILD')
{
if ($seen_canonical <= AC_CANONICAL_BUILD)
{
$seen_canonical = AC_CANONICAL_BUILD;
}
}
elsif ($macro eq 'AC_CANONICAL_HOST')
{
if ($seen_canonical <= AC_CANONICAL_HOST)
{
$seen_canonical = AC_CANONICAL_HOST;
}
}
elsif ($macro eq 'AC_CANONICAL_TARGET')
{
$seen_canonical = AC_CANONICAL_TARGET;
}
elsif ($macro eq 'AC_CONFIG_AUX_DIR')
{
if ($seen_init_automake)
{
error ($where, "AC_CONFIG_AUX_DIR must be called before "
. "AM_INIT_AUTOMAKE ...", partial => 1);
error ($seen_init_automake, "... AM_INIT_AUTOMAKE called here");
}
$config_aux_dir = $args[1];
$config_aux_dir_set_in_configure_ac = 1;
check_directory ($config_aux_dir, $where);
}
elsif ($macro eq 'AC_CONFIG_FILES')
{
# Look at potential Makefile.am's.
scan_autoconf_config_files ($where, $args[1]);
}
elsif ($macro eq 'AC_CONFIG_HEADERS')
{
foreach my $spec (split (' ', $args[1]))
{
my ($dest, @src) = split (':', $spec);
$ac_config_files_location{$dest} = $where;
push @config_headers, $spec;
}
}
elsif ($macro eq 'AC_CONFIG_LIBOBJ_DIR')
{
$config_libobj_dir = $args[1];
check_directory ($config_libobj_dir, $where);
}
elsif ($macro eq 'AC_CONFIG_LINKS')
{
foreach my $spec (split (' ', $args[1]))
{
my ($dest, $src) = split (':', $spec);
$ac_config_files_location{$dest} = $where;
push @config_links, $spec;
}
}
elsif ($macro eq 'AC_FC_SRCEXT')
{
my $suffix = $args[1];
# These flags are used as %SOURCEFLAG% in depend2.am,
# where the trailing space is important.
$sourceflags{'.' . $suffix} = '$(FCFLAGS_' . $suffix . ') '
if ($suffix eq 'f90' || $suffix eq 'f95' || $suffix eq 'f03' || $suffix eq 'f08');
}
elsif ($macro eq 'AC_INIT')
{
if (defined $args[2])
{
$package_version = $args[2];
$package_version_location = $where;
}
}
elsif ($macro eq 'AC_LIBSOURCE')
{
$libsources{$args[1]} = $here;
}
elsif ($macro eq 'AC_REQUIRE_AUX_FILE')
{
# Only remember the first time a file is required.
$required_aux_file{$args[1]} = $where
unless exists $required_aux_file{$args[1]};
}
elsif ($macro eq 'AC_SUBST_TRACE')
{
# Just check for alphanumeric in AC_SUBST_TRACE. If you do
# AC_SUBST(5), then too bad.
$configure_vars{$args[1]} = $where
if $args[1] =~ /^\w+$/;
}
elsif ($macro eq 'AM_AUTOMAKE_VERSION')
{
error ($where,
"version mismatch. This is Automake $VERSION,\n" .
"but the definition used by this AM_INIT_AUTOMAKE\n" .
"comes from Automake $args[1]. You should recreate\n" .
"aclocal.m4 with aclocal and run automake again.\n",
# $? = 63 is used to indicate version mismatch to missing.
exit_code => 63)
if $VERSION ne $args[1];
$seen_automake_version = 1;
}
elsif ($macro eq 'AM_PROG_MKDIR_P')
{
msg 'obsolete', $where, <<'EOF';
The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
EOF
}
elsif ($macro eq 'AM_CONDITIONAL')
{
$configure_cond{$args[1]} = $where;
}
elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
{
# Empty leading/trailing fields might be produced by split,
# hence the grep is really needed.
push @extra_recursive_targets,
grep (/./, (split /\s+/, $args[1]));
}
elsif ($macro eq 'AM_GNU_GETTEXT')
{
$seen_gettext = $where;
$ac_gettext_location = $where;
$seen_gettext_external = grep ($_ eq 'external', @args);
}
elsif ($macro eq 'AM_GNU_GETTEXT_INTL_SUBDIR')
{
$seen_gettext_intl = $where;
}
elsif ($macro eq 'AM_INIT_AUTOMAKE')
{
$seen_init_automake = $where;
if (defined $args[2])
{
msg 'obsolete', $where, <<'EOF';
AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
EOF
$package_version = $args[2];
$package_version_location = $where;
}
elsif (defined $args[1])
{
my @opts = split (' ', $args[1]);
@opts = map { { option => $_, where => $where } } @opts;
exit $exit_code if process_global_option_list (@opts);
}
}
elsif ($macro eq 'AM_MAINTAINER_MODE')
{
$seen_maint_mode = $where;
}
elsif ($macro eq 'AM_PROG_AR')
{
$seen_ar = $where;
}
elsif ($macro eq 'AM_PROG_CC_C_O')
{
$seen_cc_c_o = $where;
}
elsif ($macro eq '_AM_COND_IF')
{
cond_stack_if ('', $args[1], $where);
error ($where, "missing m4 quoting, macro depth $depth")
if ($depth != 1);
}
elsif ($macro eq '_AM_COND_ELSE')
{
cond_stack_else ('!', $args[1], $where);
error ($where, "missing m4 quoting, macro depth $depth")
if ($depth != 1);
}
elsif ($macro eq '_AM_COND_ENDIF')
{
cond_stack_endif (undef, undef, $where);
error ($where, "missing m4 quoting, macro depth $depth")
if ($depth != 1);
}
elsif ($macro eq '_AM_SUBST_NOTMAKE')
{
$ignored_configure_vars{$args[1]} = $where;
}
elsif ($macro eq 'm4_include'
|| $macro eq 'm4_sinclude'
|| $macro eq 'sinclude')
{
# Skip missing 'sinclude'd files.
next if $macro ne 'm4_include' && ! -f $args[1];
# Some modified versions of Autoconf don't use
# frozen files. Consequently it's possible that we see all
# m4_include's performed during Autoconf's startup.
# Obviously we don't want to distribute Autoconf's files
# so we skip absolute filenames here.
push @configure_deps, '$(top_srcdir)/' . $args[1]
unless $here =~ m,^(?:\w:)?[\\/],;
# Keep track of the greatest timestamp.
if (-e $args[1])
{
my $mtime = mtime $args[1];
$configure_deps_greatest_timestamp = $mtime
if $mtime > $configure_deps_greatest_timestamp;
}
}
elsif ($macro eq 'LT_SUPPORTED_TAG')
{
$libtool_tags{$args[1]} = 1;
$libtool_new_api = 1;
}
elsif ($macro eq '_LT_AC_TAGCONFIG')
{
# _LT_AC_TAGCONFIG is an old macro present in Libtool 1.5.
# We use it to detect whether tags are supported. Our
# preferred interface is LT_SUPPORTED_TAG, but it was
# introduced in Libtool 1.6.
if (0 == keys %libtool_tags)
{
# Hardcode the tags supported by Libtool 1.5.
%libtool_tags = (CC => 1, CXX => 1, GCJ => 1, F77 => 1);
}
}
}
error ($where, "condition stack not properly closed")
if (@cond_stack);
$tracefh->close;
}
# &scan_autoconf_files ()
# -----------------------
# Check whether we use 'configure.ac' or 'configure.in'.
# Scan it (and possibly 'aclocal.m4') for interesting things.
# We must scan aclocal.m4 because there might be AC_SUBSTs and such there.
sub scan_autoconf_files ()
{
# Reinitialize libsources here. This isn't really necessary,
# since we currently assume there is only one configure.ac. But
# that won't always be the case.
%libsources = ();
# Keep track of the youngest configure dependency.
$configure_deps_greatest_timestamp = mtime $configure_ac;
if (-e 'aclocal.m4')
{
my $mtime = mtime 'aclocal.m4';
$configure_deps_greatest_timestamp = $mtime
if $mtime > $configure_deps_greatest_timestamp;
}
scan_autoconf_traces ($configure_ac);
@configure_input_files = sort keys %make_list;
# Set input and output files if not specified by user.
if (! @input_files)
{
@input_files = @configure_input_files;
%output_files = %make_list;
}
if (! $seen_init_automake)
{
err_ac ("no proper invocation of AM_INIT_AUTOMAKE was found.\nYou "
. "should verify that $configure_ac invokes AM_INIT_AUTOMAKE,"
. "\nthat aclocal.m4 is present in the top-level directory,\n"
. "and that aclocal.m4 was recently regenerated "
. "(using aclocal)");
}
else
{
if (! $seen_automake_version)
{
if (-f 'aclocal.m4')
{
error ($seen_init_automake,
"your implementation of AM_INIT_AUTOMAKE comes from " .
"an\nold Automake version. You should recreate " .
"aclocal.m4\nwith aclocal and run automake again",
# $? = 63 is used to indicate version mismatch to missing.
exit_code => 63);
}
else
{
error ($seen_init_automake,
"no proper implementation of AM_INIT_AUTOMAKE was " .
"found,\nprobably because aclocal.m4 is missing.\n" .
"You should run aclocal to create this file, then\n" .
"run automake again");
}
}
}
locate_aux_dir ();
# Look for some files we need. Always check for these. This
# check must be done for every run, even those where we are only
# looking at a subdir Makefile. We must set relative_dir for
# push_required_file to work.
# Sort the files for stable verbose output.
$relative_dir = '.';
foreach my $file (sort keys %required_aux_file)
{
require_conf_file ($required_aux_file{$file}->get, FOREIGN, $file)
}
err_am "'install.sh' is an anachronism; use 'install-sh' instead"
if -f $config_aux_dir . '/install.sh';
# Preserve dist_common for later.
$configure_dist_common = variable_value ('DIST_COMMON') || '';
}
################################################################
# Do any extra checking for GNU standards.
sub check_gnu_standards
{
if ($relative_dir eq '.')
{
# In top level (or only) directory.
require_file ("$am_file.am", GNU,
qw/INSTALL NEWS README AUTHORS ChangeLog/);
# Accept one of these three licenses; default to COPYING.
# Make sure we do not overwrite an existing license.
my $license;
foreach (qw /COPYING COPYING.LIB COPYING.LESSER/)
{
if (-f $_)
{
$license = $_;
last;
}
}
require_file ("$am_file.am", GNU, 'COPYING')
unless $license;
}
for my $opt ('no-installman', 'no-installinfo')
{
msg ('error-gnu', option $opt,
"option '$opt' disallowed by GNU standards")
if option $opt;
}
}
# Do any extra checking for GNITS standards.
sub check_gnits_standards
{
if ($relative_dir eq '.')
{
# In top level (or only) directory.
require_file ("$am_file.am", GNITS, 'THANKS');
}
}
################################################################
#
# Functions to handle files of each language.
# Each 'lang_X_rewrite($DIRECTORY, $BASE, $EXT)' function follows a
# simple formula: Return value is LANG_SUBDIR if the resulting object
# file should be in a subdir if the source file is, LANG_PROCESS if
# file is to be dealt with, LANG_IGNORE otherwise.
# Much of the actual processing is handled in
# handle_single_transform. These functions exist so that
# auxiliary information can be recorded for a later cleanup pass.
# Note that the calls to these functions are computed, so don't bother
# searching for their precise names in the source.
# This is just a convenience function that can be used to determine
# when a subdir object should be used.
sub lang_sub_obj
{
return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
}
# Rewrite a single C source file.
sub lang_c_rewrite
{
my ($directory, $base, $ext, $obj, $have_per_exec_flags, $var) = @_;
my $r = LANG_PROCESS;
if (option 'subdir-objects')
{
$r = LANG_SUBDIR;
if ($directory && $directory ne '.')
{
$base = $directory . '/' . $base;
# libtool is always able to put the object at the proper place,
# so we do not have to require AM_PROG_CC_C_O when building .lo files.
msg_var ('portability', $var,
"compiling '$base.c' in subdir requires "
. "'AM_PROG_CC_C_O' in '$configure_ac'",
uniq_scope => US_GLOBAL,
uniq_part => 'AM_PROG_CC_C_O subdir')
unless $seen_cc_c_o || $obj eq '.lo';
}
}
if (! $seen_cc_c_o
&& $have_per_exec_flags
&& ! option 'subdir-objects'
&& $obj ne '.lo')
{
msg_var ('portability',
$var, "compiling '$base.c' with per-target flags requires "
. "'AM_PROG_CC_C_O' in '$configure_ac'",
uniq_scope => US_GLOBAL,
uniq_part => 'AM_PROG_CC_C_O per-target')
}
return $r;
}
# Rewrite a single header file.
sub lang_header_rewrite
{
# Header files are simply ignored.
return LANG_IGNORE;
}
# Rewrite a single Vala source file.
sub lang_vala_rewrite
{
my ($directory, $base, $ext) = @_;
(my $newext = $ext) =~ s/vala$/c/;
return (LANG_SUBDIR, $newext);
}
# Rewrite a single yacc/yacc++ file.
sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
my $r = &lang_sub_obj;
(my $newext = $ext) =~ tr/y/c/;
return ($r, $newext);
}
sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
# Rewrite a single lex/lex++ file.
sub lang_lex_rewrite
{
my ($directory, $base, $ext) = @_;
my $r = &lang_sub_obj;
(my $newext = $ext) =~ tr/l/c/;
return ($r, $newext);
}
sub lang_lexxx_rewrite { lang_lex_rewrite (@_); };
# Rewrite a single Java file.
sub lang_java_rewrite
{
return LANG_SUBDIR;
}
# The lang_X_finish functions are called after all source file
# processing is done. Each should handle defining rules for the
# language, etc. A finish function is only called if a source file of
# the appropriate type has been seen.
sub lang_vala_finish_target ($$)
{
my ($self, $name) = @_;
my $derived = canonicalize ($name);
my $var = var "${derived}_SOURCES";
return unless $var;
my @vala_sources = grep { /\.(vala|vapi)$/ } ($var->value_as_list_recursive);
# For automake bug#11229.
return unless @vala_sources;
foreach my $vala_file (@vala_sources)
{
my $c_file = $vala_file;
if ($c_file =~ s/(.*)\.vala$/$1.c/)
{
$c_file = "\$(srcdir)/$c_file";
$output_rules .= "$c_file: \$(srcdir)/${derived}_vala.stamp\n"
. "\t\@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n"
. "\t\@if test -f \$@; then :; else \\\n"
. "\t \$(MAKE) \$(AM_MAKEFLAGS) \$(srcdir)/${derived}_vala.stamp; \\\n"
. "\tfi\n";
$clean_files{$c_file} = MAINTAINER_CLEAN;
}
}
# Add rebuild rules for generated header and vapi files
my $flags = var ($derived . '_VALAFLAGS');
if ($flags)
{
my $lastflag = '';
foreach my $flag ($flags->value_as_list_recursive)
{
if (grep (/$lastflag/, ('-H', '-h', '--header', '--internal-header',
'--vapi', '--internal-vapi', '--gir')))
{
my $headerfile = "\$(srcdir)/$flag";
$output_rules .= "$headerfile: \$(srcdir)/${derived}_vala.stamp\n"
. "\t\@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n"
. "\t\@if test -f \$@; then :; else \\\n"
. "\t \$(MAKE) \$(AM_MAKEFLAGS) \$(srcdir)/${derived}_vala.stamp; \\\n"
. "\tfi\n";
# valac is not used when building from dist tarballs
# distribute the generated files
push_dist_common ($headerfile);
$clean_files{$headerfile} = MAINTAINER_CLEAN;
}
$lastflag = $flag;
}
}
my $compile = $self->compile;
# Rewrite each occurrence of 'AM_VALAFLAGS' in the compile
# rule into '${derived}_VALAFLAGS' if it exists.
my $val = "${derived}_VALAFLAGS";
$compile =~ s/\(AM_VALAFLAGS\)/\($val\)/
if set_seen ($val);
# VALAFLAGS is a user variable (per GNU Standards),
# it should not be overridden in the Makefile...
check_user_variables 'VALAFLAGS';
my $dirname = dirname ($name);
# Only generate C code, do not run C compiler
$compile .= " -C";
my $verbose = verbose_flag ('VALAC');
my $silent = silent_flag ();
my $stampfile = "\$(srcdir)/${derived}_vala.stamp";
$output_rules .=
"\$(srcdir)/${derived}_vala.stamp: @vala_sources\n".
# Since the C files generated from the vala sources depend on the
# ${derived}_vala.stamp file, we must ensure its timestamp is older than
# those of the C files generated by the valac invocation below (this is
# especially important on systems with sub-second timestamp resolution).
# Thus we need to create the stamp file *before* invoking valac, and to
# move it to its final location only after valac has been invoked.
"\t${silent}rm -f \$\@ && echo stamp > \$\@-t\n".
"\t${verbose}\$(am__cd) \$(srcdir) && $compile @vala_sources\n".
"\t${silent}mv -f \$\@-t \$\@\n";
push_dist_common ($stampfile);
$clean_files{$stampfile} = MAINTAINER_CLEAN;
}
# Add output rules to invoke valac and create stamp file as a witness
# to handle multiple outputs. This function is called after all source
# file processing is done.
sub lang_vala_finish
{
my ($self) = @_;
foreach my $prog (keys %known_programs)
{
lang_vala_finish_target ($self, $prog);
}
while (my ($name) = each %known_libraries)
{
lang_vala_finish_target ($self, $name);
}
}
# The built .c files should be cleaned only on maintainer-clean
# as the .c files are distributed. This function is called for each
# .vala source file.
sub lang_vala_target_hook
{
my ($self, $aggregate, $output, $input, %transform) = @_;
$clean_files{$output} = MAINTAINER_CLEAN;
}
# This is a yacc helper which is called whenever we have decided to
# compile a yacc file.
sub lang_yacc_target_hook
{
my ($self, $aggregate, $output, $input, %transform) = @_;
# If some relevant *YFLAGS variable contains the '-d' flag, we'll
# have to to generate special code.
my $yflags_contains_minus_d = 0;
foreach my $pfx ("", "${aggregate}_")
{
my $yflagsvar = var ("${pfx}YFLAGS");
next unless $yflagsvar;
# We cannot work reliably with conditionally-defined YFLAGS.
if ($yflagsvar->has_conditional_contents)
{
msg_var ('unsupported', $yflagsvar,
"'${pfx}YFLAGS' cannot have conditional contents");
}
else
{
$yflags_contains_minus_d = 1
if grep (/^-d$/, $yflagsvar->value_as_list_recursive);
}
}
if ($yflags_contains_minus_d)
{
# Found a '-d' that applies to the compilation of this file.
# Add a dependency for the generated header file, and arrange
# for that file to be included in the distribution.
# The extension of the output file (e.g., '.c' or '.cxx').
# We'll need it to compute the name of the generated header file.
(my $output_ext = basename ($output)) =~ s/.*(\.[^.]+)$/$1/;
# We know that a yacc input should be turned into either a C or
# C++ output file. We depend on this fact (here and in yacc.am),
# so check that it really holds.
my $lang = $languages{$extension_map{$output_ext}};
prog_error "invalid output name '$output' for yacc file '$input'"
if (!$lang || ($lang->name ne 'c' && $lang->name ne 'cxx'));
(my $header_ext = $output_ext) =~ s/c/h/g;
# Quote $output_ext in the regexp, so that dots in it are taken
# as literal dots, not as metacharacters.
(my $header = $output) =~ s/\Q$output_ext\E$/$header_ext/;
foreach my $cond (Automake::Rule::define (${header}, 'internal',
RULE_AUTOMAKE, TRUE,
INTERNAL))
{
my $condstr = $cond->subst_string;
$output_rules .=
"$condstr${header}: $output\n"
# Recover from removal of $header
. "$condstr\t\@if test ! -f \$@; then rm -f $output; else :; fi\n"
. "$condstr\t\@if test ! -f \$@; then \$(MAKE) \$(AM_MAKEFLAGS) $output; else :; fi\n";
}
# Distribute the generated file, unless its .y source was
# listed in a nodist_ variable. (&handle_source_transform
# will set DIST_SOURCE.)
&push_dist_common ($header)
if $transform{'DIST_SOURCE'};
# The GNU rules say that yacc/lex output files should be removed
# by maintainer-clean. However, if the files are not distributed,
# then we want to remove them with "make clean"; otherwise,
# "make distcheck" will fail.
$clean_files{$header} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : CLEAN;
}
# See the comment above for $HEADER.
$clean_files{$output} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : CLEAN;
}
# This is a lex helper which is called whenever we have decided to
# compile a lex file.
sub lang_lex_target_hook
{
my ($self, $aggregate, $output, $input, %transform) = @_;
# The GNU rules say that yacc/lex output files should be removed
# by maintainer-clean. However, if the files are not distributed,
# then we want to remove them with "make clean"; otherwise,
# "make distcheck" will fail.
$clean_files{$output} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : CLEAN;
}
# This is a helper for both lex and yacc.
sub yacc_lex_finish_helper
{
return if defined $language_scratch{'lex-yacc-done'};
$language_scratch{'lex-yacc-done'} = 1;
# FIXME: for now, no line number.
require_conf_file ($configure_ac, FOREIGN, 'ylwrap');
&define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
}
sub lang_yacc_finish
{
return if defined $language_scratch{'yacc-done'};
$language_scratch{'yacc-done'} = 1;
reject_var 'YACCFLAGS', "'YACCFLAGS' obsolete; use 'YFLAGS' instead";
yacc_lex_finish_helper;
}
sub lang_lex_finish
{
return if defined $language_scratch{'lex-done'};
$language_scratch{'lex-done'} = 1;
yacc_lex_finish_helper;
}
# Given a hash table of linker names, pick the name that has the most
# precedence. This is lame, but something has to have global
# knowledge in order to eliminate the conflict. Add more linkers as
# required.
sub resolve_linker
{
my (%linkers) = @_;
foreach my $l (qw(GCJLINK OBJCXXLINK CXXLINK F77LINK FCLINK OBJCLINK UPCLINK))
{
return $l if defined $linkers{$l};
}
return 'LINK';
}
# Called to indicate that an extension was used.
sub saw_extension
{
my ($ext) = @_;
$extension_seen{$ext} = 1;
}
# register_language (%ATTRIBUTE)
# ------------------------------
# Register a single language.
# Each %ATTRIBUTE is of the form ATTRIBUTE => VALUE.
sub register_language (%)
{
my (%option) = @_;
# Set the defaults.
$option{'autodep'} = 'no'
unless defined $option{'autodep'};
$option{'linker'} = ''
unless defined $option{'linker'};
$option{'flags'} = []
unless defined $option{'flags'};
$option{'output_extensions'} = sub { return ( '.$(OBJEXT)', '.lo' ) }
unless defined $option{'output_extensions'};
$option{'nodist_specific'} = 0
unless defined $option{'nodist_specific'};
my $lang = new Language (%option);
# Fill indexes.
$extension_map{$_} = $lang->name foreach @{$lang->extensions};
$languages{$lang->name} = $lang;
my $link = $lang->linker;
if ($link)
{
if (exists $link_languages{$link})
{
prog_error ("'$link' has different definitions in "
. $lang->name . " and " . $link_languages{$link}->name)
if $lang->link ne $link_languages{$link}->link;
}
else
{
$link_languages{$link} = $lang;
}
}
# Update the pattern of known extensions.
accept_extensions (@{$lang->extensions});
# Update the $suffix_rule map.
foreach my $suffix (@{$lang->extensions})
{
foreach my $dest (&{$lang->output_extensions} ($suffix))
{
register_suffix_rule (INTERNAL, $suffix, $dest);
}
}
}
# derive_suffix ($EXT, $OBJ)
# --------------------------
# This function is used to find a path from a user-specified suffix $EXT
# to $OBJ or to some other suffix we recognize internally, e.g. 'cc'.
sub derive_suffix ($$)
{
my ($source_ext, $obj) = @_;
while (! $extension_map{$source_ext}
&& $source_ext ne $obj
&& exists $suffix_rules->{$source_ext}
&& exists $suffix_rules->{$source_ext}{$obj})
{
$source_ext = $suffix_rules->{$source_ext}{$obj}[0];
}
return $source_ext;
}
################################################################
# Pretty-print something and append to output_rules.
sub pretty_print_rule
{
$output_rules .= &makefile_wrap (@_);
}
################################################################
## -------------------------------- ##
## Handling the conditional stack. ##
## -------------------------------- ##
# $STRING
# make_conditional_string ($NEGATE, $COND)
# ----------------------------------------
sub make_conditional_string ($$)
{
my ($negate, $cond) = @_;
$cond = "${cond}_TRUE"
unless $cond =~ /^TRUE|FALSE$/;
$cond = Automake::Condition::conditional_negate ($cond)
if $negate;
return $cond;
}
my %_am_macro_for_cond =
(
AMDEP => "one of the compiler tests\n"
. " AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,\n"
. " AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC",
am__fastdepCC => 'AC_PROG_CC',
am__fastdepCCAS => 'AM_PROG_AS',
am__fastdepCXX => 'AC_PROG_CXX',
am__fastdepGCJ => 'AM_PROG_GCJ',
am__fastdepOBJC => 'AC_PROG_OBJC',
am__fastdepOBJCXX => 'AC_PROG_OBJCXX',
am__fastdepUPC => 'AM_PROG_UPC'
);
# $COND
# cond_stack_if ($NEGATE, $COND, $WHERE)
# --------------------------------------
sub cond_stack_if ($$$)
{
my ($negate, $cond, $where) = @_;
if (! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/)
{
my $text = "$cond does not appear in AM_CONDITIONAL";
my $scope = US_LOCAL;
if (exists $_am_macro_for_cond{$cond})
{
my $mac = $_am_macro_for_cond{$cond};
$text .= "\n The usual way to define '$cond' is to add ";
$text .= ($mac =~ / /) ? $mac : "'$mac'";
$text .= "\n to '$configure_ac' and run 'aclocal' and 'autoconf' again";
# These warnings appear in Automake files (depend2.am),
# so there is no need to display them more than once:
$scope = US_GLOBAL;
}
error $where, $text, uniq_scope => $scope;
}
push (@cond_stack, make_conditional_string ($negate, $cond));
return new Automake::Condition (@cond_stack);
}
# $COND
# cond_stack_else ($NEGATE, $COND, $WHERE)
# ----------------------------------------
sub cond_stack_else ($$$)
{
my ($negate, $cond, $where) = @_;
if (! @cond_stack)
{
error $where, "else without if";
return FALSE;
}
$cond_stack[$#cond_stack] =
Automake::Condition::conditional_negate ($cond_stack[$#cond_stack]);
# If $COND is given, check against it.
if (defined $cond)
{
$cond = make_conditional_string ($negate, $cond);
error ($where, "else reminder ($negate$cond) incompatible with "
. "current conditional: $cond_stack[$#cond_stack]")
if $cond_stack[$#cond_stack] ne $cond;
}
return new Automake::Condition (@cond_stack);
}
# $COND
# cond_stack_endif ($NEGATE, $COND, $WHERE)
# -----------------------------------------
sub cond_stack_endif ($$$)
{
my ($negate, $cond, $where) = @_;
my $old_cond;
if (! @cond_stack)
{
error $where, "endif without if";
return TRUE;
}
# If $COND is given, check against it.
if (defined $cond)
{
$cond = make_conditional_string ($negate, $cond);
error ($where, "endif reminder ($negate$cond) incompatible with "
. "current conditional: $cond_stack[$#cond_stack]")
if $cond_stack[$#cond_stack] ne $cond;
}
pop @cond_stack;
return new Automake::Condition (@cond_stack);
}
## ------------------------ ##
## Handling the variables. ##
## ------------------------ ##
# &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
# -----------------------------------------------------
# Like define_variable, but the value is a list, and the variable may
# be defined conditionally. The second argument is the condition
# under which the value should be defined; this should be the empty
# string to define the variable unconditionally. The third argument
# is a list holding the values to use for the variable. The value is
# pretty printed in the output file.
sub define_pretty_variable ($$$@)
{
my ($var, $cond, $where, @value) = @_;
if (! vardef ($var, $cond))
{
Automake::Variable::define ($var, VAR_AUTOMAKE, '', $cond, "@value",
'', $where, VAR_PRETTY);
rvar ($var)->rdef ($cond)->set_seen;
}
}
# define_variable ($VAR, $VALUE, $WHERE)
# --------------------------------------
# Define a new Automake Makefile variable VAR to VALUE, but only if
# not already defined.
sub define_variable ($$$)
{
my ($var, $value, $where) = @_;
define_pretty_variable ($var, TRUE, $where, $value);
}
# define_files_variable ($VAR, \@BASENAME, $EXTENSION, $WHERE)
# ------------------------------------------------------------
# Define the $VAR which content is the list of file names composed of
# a @BASENAME and the $EXTENSION.
sub define_files_variable ($\@$$)
{
my ($var, $basename, $extension, $where) = @_;
define_variable ($var,
join (' ', map { "$_.$extension" } @$basename),
$where);
}
# Like define_variable, but define a variable to be the configure
# substitution by the same name.
sub define_configure_variable ($)
{
my ($var) = @_;
# Some variables we do not want to output. For instance it
# would be a bad idea to output `U = @U@` when `@U@` can be
# substituted as `\`.
my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS;
Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var,
'', $configure_vars{$var}, $pretty);
}
# define_compiler_variable ($LANG)
# --------------------------------
# Define a compiler variable. We also handle defining the 'LT'
# version of the command when using libtool.
sub define_compiler_variable ($)
{
my ($lang) = @_;
my ($var, $value) = ($lang->compiler, $lang->compile);
my $libtool_tag = '';
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
&define_variable ($var, $value, INTERNAL);
if (var ('LIBTOOL'))
{
my $verbose = define_verbose_libtool ();
&define_variable ("LT$var",
"\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
. "\$(LIBTOOLFLAGS) --mode=compile $value",
INTERNAL);
}
define_verbose_tagvar ($lang->ccer || 'GEN');
}
# define_linker_variable ($LANG)
# ------------------------------
# Define linker variables.
sub define_linker_variable ($)
{
my ($lang) = @_;
my $libtool_tag = '';
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
# CCLD = $(CC).
&define_variable ($lang->lder, $lang->ld, INTERNAL);
# CCLINK = $(CCLD) blah blah...
my $link = '';
if (var ('LIBTOOL'))
{
my $verbose = define_verbose_libtool ();
$link = "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
. "\$(LIBTOOLFLAGS) --mode=link ";
}
&define_variable ($lang->linker, $link . $lang->link, INTERNAL);
&define_variable ($lang->compiler, $lang);
&define_verbose_tagvar ($lang->lder || 'GEN');
}
sub define_per_target_linker_variable ($$)
{
my ($linker, $target) = @_;
# If the user wrote a custom link command, we don't define ours.
return "${target}_LINK"
if set_seen "${target}_LINK";
my $xlink = $linker ? $linker : 'LINK';
my $lang = $link_languages{$xlink};
prog_error "Unknown language for linker variable '$xlink'"
unless $lang;
my $link_command = $lang->link;
if (var 'LIBTOOL')
{
my $libtool_tag = '';
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
my $verbose = define_verbose_libtool ();
$link_command =
"\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) \$(LIBTOOLFLAGS) "
. "--mode=link " . $link_command;
}
# Rewrite each occurrence of 'AM_$flag' in the link
# command into '${derived}_$flag' if it exists.
my $orig_command = $link_command;
my @flags = (@{$lang->flags}, 'LDFLAGS');
push @flags, 'LIBTOOLFLAGS' if var 'LIBTOOL';
for my $flag (@flags)
{
my $val = "${target}_$flag";
$link_command =~ s/\(AM_$flag\)/\($val\)/
if set_seen ($val);
}
# If the computed command is the same as the generic command, use
# the command linker variable.
return ($lang->linker, $lang->lder)
if $link_command eq $orig_command;
&define_variable ("${target}_LINK", $link_command, INTERNAL);
return ("${target}_LINK", $lang->lder);
}
################################################################
# &check_trailing_slash ($WHERE, $LINE)
# -------------------------------------
# Return 1 iff $LINE ends with a slash.
# Might modify $LINE.
sub check_trailing_slash ($\$)
{
my ($where, $line) = @_;
# Ignore '##' lines.
return 0 if $$line =~ /$IGNORE_PATTERN/o;
# Catch and fix a common error.
msg "syntax", $where, "whitespace following trailing backslash"
if $$line =~ s/\\\s+\n$/\\\n/;
return $$line =~ /\\$/;
}
# &read_am_file ($AMFILE, $WHERE)
# -------------------------------
# Read Makefile.am and set up %contents. Simultaneously copy lines
# from Makefile.am into $output_trailer, or define variables as
# appropriate. NOTE we put rules in the trailer section. We want
# user rules to come after our generated stuff.
sub read_am_file ($$)
{
my ($amfile, $where) = @_;
my $am_file = new Automake::XFile ("< $amfile");
verb "reading $amfile";
# Keep track of the youngest output dependency.
my $mtime = mtime $amfile;
$output_deps_greatest_timestamp = $mtime
if $mtime > $output_deps_greatest_timestamp;
my $spacing = '';
my $comment = '';
my $blank = 0;
my $saw_bk = 0;
my $var_look = VAR_ASIS;
use constant IN_VAR_DEF => 0;
use constant IN_RULE_DEF => 1;
use constant IN_COMMENT => 2;
my $prev_state = IN_RULE_DEF;
while ($_ = $am_file->getline)
{
$where->set ("$amfile:$.");
if (/$IGNORE_PATTERN/o)
{
# Merely delete comments beginning with two hashes.
}
elsif (/$WHITE_PATTERN/o)
{
error $where, "blank line following trailing backslash"
if $saw_bk;
# Stick a single white line before the incoming macro or rule.
$spacing = "\n";
$blank = 1;
# Flush all comments seen so far.
if ($comment ne '')
{
$output_vars .= $comment;
$comment = '';
}
}
elsif (/$COMMENT_PATTERN/o)
{
# Stick comments before the incoming macro or rule. Make
# sure a blank line precedes the first block of comments.
$spacing = "\n" unless $blank;
$blank = 1;
$comment .= $spacing . $_;
$spacing = '';
$prev_state = IN_COMMENT;
}
else
{
last;
}
$saw_bk = check_trailing_slash ($where, $_);
}
# We save the conditional stack on entry, and then check to make
# sure it is the same on exit. This lets us conditionally include
# other files.
my @saved_cond_stack = @cond_stack;
my $cond = new Automake::Condition (@cond_stack);
my $last_var_name = '';
my $last_var_type = '';
my $last_var_value = '';
my $last_where;
# FIXME: shouldn't use $_ in this loop; it is too big.
while ($_)
{
$where->set ("$amfile:$.");
# Make sure the line is \n-terminated.
chomp;
$_ .= "\n";
# Don't look at MAINTAINER_MODE_TRUE here. That shouldn't be
# used by users. @MAINT@ is an anachronism now.
$_ =~ s/\@MAINT\@//g
unless $seen_maint_mode;
my $new_saw_bk = check_trailing_slash ($where, $_);
if (/$IGNORE_PATTERN/o)
{
# Merely delete comments beginning with two hashes.
# Keep any backslash from the previous line.
$new_saw_bk = $saw_bk;
}
elsif (/$WHITE_PATTERN/o)
{
# Stick a single white line before the incoming macro or rule.
$spacing = "\n";
error $where, "blank line following trailing backslash"
if $saw_bk;
}
elsif (/$COMMENT_PATTERN/o)
{
error $where, "comment following trailing backslash"
if $saw_bk && $prev_state != IN_COMMENT;
# Stick comments before the incoming macro or rule.
$comment .= $spacing . $_;
$spacing = '';
$prev_state = IN_COMMENT;
}
elsif ($saw_bk)
{
if ($prev_state == IN_RULE_DEF)
{
my $cond = new Automake::Condition @cond_stack;
$output_trailer .= $cond->subst_string;
$output_trailer .= $_;
}
elsif ($prev_state == IN_COMMENT)
{
# If the line doesn't start with a '#', add it.
# We do this because a continued comment like
# # A = foo \
# bar \
# baz
# is not portable. BSD make doesn't honor
# escaped newlines in comments.
s/^#?/#/;
$comment .= $spacing . $_;
}
else # $prev_state == IN_VAR_DEF
{
$last_var_value .= ' '
unless $last_var_value =~ /\s$/;
$last_var_value .= $_;
if (!/\\$/)
{
Automake::Variable::define ($last_var_name, VAR_MAKEFILE,
$last_var_type, $cond,
$last_var_value, $comment,
$last_where, VAR_ASIS)
if $cond != FALSE;
$comment = $spacing = '';
}
}
}
elsif (/$IF_PATTERN/o)
{
$cond = cond_stack_if ($1, $2, $where);
}
elsif (/$ELSE_PATTERN/o)
{
$cond = cond_stack_else ($1, $2, $where);
}
elsif (/$ENDIF_PATTERN/o)
{
$cond = cond_stack_endif ($1, $2, $where);
}
elsif (/$RULE_PATTERN/o)
{
# Found a rule.
$prev_state = IN_RULE_DEF;
# For now we have to output all definitions of user rules
# and can't diagnose duplicates (see the comment in
# Automake::Rule::define). So we go on and ignore the return value.
Automake::Rule::define ($1, $amfile, RULE_USER, $cond, $where);
check_variable_expansions ($_, $where);
$output_trailer .= $comment . $spacing;
my $cond = new Automake::Condition @cond_stack;
$output_trailer .= $cond->subst_string;
$output_trailer .= $_;
$comment = $spacing = '';
}
elsif (/$ASSIGNMENT_PATTERN/o)
{
# Found a macro definition.
$prev_state = IN_VAR_DEF;
$last_var_name = $1;
$last_var_type = $2;
$last_var_value = $3;
$last_where = $where->clone;
if ($3 ne '' && substr ($3, -1) eq "\\")
{
# We preserve the '\' because otherwise the long lines
# that are generated will be truncated by broken
# 'sed's.
$last_var_value = $3 . "\n";
}
# Normally we try to output variable definitions in the
# same format they were input. However, POSIX compliant
# systems are not required to support lines longer than
# 2048 bytes (most notably, some sed implementation are
# limited to 4000 bytes, and sed is used by config.status
# to rewrite Makefile.in into Makefile). Moreover nobody
# would really write such long lines by hand since it is
# hardly maintainable. So if a line is longer that 1000
# bytes (an arbitrary limit), assume it has been
# automatically generated by some tools, and flatten the
# variable definition. Otherwise, keep the variable as it
# as been input.
$var_look = VAR_PRETTY if length ($last_var_value) >= 1000;
if (!/\\$/)
{
Automake::Variable::define ($last_var_name, VAR_MAKEFILE,
$last_var_type, $cond,
$last_var_value, $comment,
$last_where, $var_look)
if $cond != FALSE;
$comment = $spacing = '';
$var_look = VAR_ASIS;
}
}
elsif (/$INCLUDE_PATTERN/o)
{
my $path = $1;
if ($path =~ s/^\$\(top_srcdir\)\///)
{
push (@include_stack, "\$\(top_srcdir\)/$path");
# Distribute any included file.
# Always use the $(top_srcdir) prefix in DIST_COMMON,
# otherwise OSF make will implicitly copy the included
# file in the build tree during "make distdir" to satisfy
# the dependency.
# (subdir-am-cond.sh and subdir-ac-cond.sh will fail)
push_dist_common ("\$\(top_srcdir\)/$path");
}
else
{
$path =~ s/\$\(srcdir\)\///;
push (@include_stack, "\$\(srcdir\)/$path");
# Always use the $(srcdir) prefix in DIST_COMMON,
# otherwise OSF make will implicitly copy the included
# file in the build tree during "make distdir" to satisfy
# the dependency.
# (subdir-am-cond.sh and subdir-ac-cond.sh will fail)
push_dist_common ("\$\(srcdir\)/$path");
$path = $relative_dir . "/" . $path if $relative_dir ne '.';
}
$where->push_context ("'$path' included from here");
&read_am_file ($path, $where);
$where->pop_context;
}
else
{
# This isn't an error; it is probably a continued rule.
# In fact, this is what we assume.
$prev_state = IN_RULE_DEF;
check_variable_expansions ($_, $where);
$output_trailer .= $comment . $spacing;
my $cond = new Automake::Condition @cond_stack;
$output_trailer .= $cond->subst_string;
$output_trailer .= $_;
$comment = $spacing = '';
error $where, "'#' comment at start of rule is unportable"
if $_ =~ /^\t\s*\#/;
}
$saw_bk = $new_saw_bk;
$_ = $am_file->getline;
}
$output_trailer .= $comment;
error ($where, "trailing backslash on last line")
if $saw_bk;
error ($where, (@cond_stack ? "unterminated conditionals: @cond_stack"
: "too many conditionals closed in include file"))
if "@saved_cond_stack" ne "@cond_stack";
}
# define_standard_variables ()
# ----------------------------
# A helper for read_main_am_file which initializes configure variables
# and variables from header-vars.am.
sub define_standard_variables
{
my $saved_output_vars = $output_vars;
my ($comments, undef, $rules) =
file_contents_internal (1, "$libdir/am/header-vars.am",
new Automake::Location);
foreach my $var (sort keys %configure_vars)
{
&define_configure_variable ($var);
}
$output_vars .= $comments . $rules;
}
# Read main am file.
sub read_main_am_file ($$)
{
my ($amfile, $infile) = @_;
# This supports the strange variable tricks we are about to play.
prog_error ("variable defined before read_main_am_file\n" . variables_dump ())
if (scalar (variables) > 0);
# Generate copyright header for generated Makefile.in.
# We do discard the output of predefined variables, handled below.
$output_vars = ("# " . basename ($infile) . " generated by automake "
. $VERSION . " from " . basename ($amfile) . ".\n");
$output_vars .= '# ' . subst ('configure_input') . "\n";
$output_vars .= $gen_copyright;
# We want to predefine as many variables as possible. This lets
# the user set them with '+=' in Makefile.am.
&define_standard_variables;
# Read user file, which might override some of our values.
&read_am_file ($amfile, new Automake::Location);
}
################################################################
# $FLATTENED
# &flatten ($STRING)
# ------------------
# Flatten the $STRING and return the result.
sub flatten
{
$_ = shift;
s/\\\n//somg;
s/\s+/ /g;
s/^ //;
s/ $//;
return $_;
}
# transform_token ($TOKEN, \%PAIRS, $KEY)
# =======================================
# Return the value associated to $KEY in %PAIRS, as used on $TOKEN
# (which should be ?KEY? or any of the special %% requests)..
sub transform_token ($$$)
{
my ($token, $transform, $key) = @_;
my $res = $transform->{$key};
prog_error "Unknown key '$key' in '$token'" unless defined $res;
return $res;
}
# transform ($TOKEN, \%PAIRS)
# ===========================
# If ($TOKEN, $VAL) is in %PAIRS:
# - replaces %KEY% with $VAL,
# - enables/disables ?KEY? and ?!KEY?,
# - replaces %?KEY% with TRUE or FALSE.
sub transform ($$)
{
my ($token, $transform) = @_;
# %KEY%.
# Must be before the following pattern to exclude the case
# when there is neither IFTRUE nor IFFALSE.
if ($token =~ /^%([\w\-]+)%$/)
{
return transform_token ($token, $transform, $1);
}
# %?KEY%.
elsif ($token =~ /^%\?([\w\-]+)%$/)
{
return transform_token ($token, $transform, $1) ? 'TRUE' : 'FALSE';
}
# ?KEY? and ?!KEY?.
elsif ($token =~ /^ \? (!?) ([\w\-]+) \? $/x)
{
my $neg = ($1 eq '!') ? 1 : 0;
my $val = transform_token ($token, $transform, $2);
return (!!$val == $neg) ? '##%' : '';
}
else
{
prog_error "Unknown request format: $token";
}
}
# $TEXT
# preprocess_file ($MAKEFILE, [%TRANSFORM])
# -----------------------------------------
# Load a $MAKEFILE, apply the %TRANSFORM, and return the result.
# No extra parsing or post-processing is done (i.e., recognition of
# rules declaration or of make variables definitions).
sub preprocess_file ($%)
{
my ($file, %transform) = @_;
# Complete %transform with global options.
# Note that %transform goes last, so it overrides global options.
%transform = ( 'MAINTAINER-MODE'
=> $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
'XZ' => !! option 'dist-xz',
'LZIP' => !! option 'dist-lzip',
'BZIP2' => !! option 'dist-bzip2',
'COMPRESS' => !! option 'dist-tarZ',
'GZIP' => ! option 'no-dist-gzip',
'SHAR' => !! option 'dist-shar',
'ZIP' => !! option 'dist-zip',
'INSTALL-INFO' => ! option 'no-installinfo',
'INSTALL-MAN' => ! option 'no-installman',
'CK-NEWS' => !! option 'check-news',
'SUBDIRS' => !! var ('SUBDIRS'),
'TOPDIR_P' => $relative_dir eq '.',
'BUILD' => ($seen_canonical >= AC_CANONICAL_BUILD),
'HOST' => ($seen_canonical >= AC_CANONICAL_HOST),
'TARGET' => ($seen_canonical >= AC_CANONICAL_TARGET),
'LIBTOOL' => !! var ('LIBTOOL'),
'NONLIBTOOL' => 1,
%transform);
if (! defined ($_ = $am_file_cache{$file}))
{
verb "reading $file";
# Swallow the whole file.
my $fc_file = new Automake::XFile "< $file";
my $saved_dollar_slash = $/;
undef $/;
$_ = $fc_file->getline;
$/ = $saved_dollar_slash;
$fc_file->close;
# Remove ##-comments.
# Besides we don't need more than two consecutive new-lines.
s/(?:$IGNORE_PATTERN|(?<=\n\n)\n+)//gom;
# Remember the contents of the just-read file.
$am_file_cache{$file} = $_;
}
# Substitute Automake template tokens.
s/(?: % \?? [\w\-]+ %
| \? !? [\w\-]+ \?
)/transform($&, \%transform)/gex;
# transform() may have added some ##%-comments to strip.
# (we use '##%' instead of '##' so we can distinguish ##%##%##% from
# ####### and do not remove the latter.)
s/^[ \t]*(?:##%)+.*\n//gm;
return $_;
}
# @PARAGRAPHS
# &make_paragraphs ($MAKEFILE, [%TRANSFORM])
# ------------------------------------------
# Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
# paragraphs.
sub make_paragraphs ($%)
{
my ($file, %transform) = @_;
$transform{FIRST} = !$transformed_files{$file};
$transformed_files{$file} = 1;
my @lines = split /(?set ($file);
my $result_vars = '';
my $result_rules = '';
my $comment = '';
my $spacing = '';
# The following flags are used to track rules spanning across
# multiple paragraphs.
my $is_rule = 0; # 1 if we are processing a rule.
my $discard_rule = 0; # 1 if the current rule should not be output.
# We save the conditional stack on entry, and then check to make
# sure it is the same on exit. This lets us conditionally include
# other files.
my @saved_cond_stack = @cond_stack;
my $cond = new Automake::Condition (@cond_stack);
foreach (make_paragraphs ($file, %transform))
{
# FIXME: no line number available.
$where->set ($file);
# Sanity checks.
error $where, "blank line following trailing backslash:\n$_"
if /\\$/;
error $where, "comment following trailing backslash:\n$_"
if /\\#/;
if (/^$/)
{
$is_rule = 0;
# Stick empty line before the incoming macro or rule.
$spacing = "\n";
}
elsif (/$COMMENT_PATTERN/mso)
{
$is_rule = 0;
# Stick comments before the incoming macro or rule.
$comment = "$_\n";
}
# Handle inclusion of other files.
elsif (/$INCLUDE_PATTERN/o)
{
if ($cond != FALSE)
{
my $file = ($is_am ? "$libdir/am/" : '') . $1;
$where->push_context ("'$file' included from here");
# N-ary '.=' fails.
my ($com, $vars, $rules)
= file_contents_internal ($is_am, $file, $where, %transform);
$where->pop_context;
$comment .= $com;
$result_vars .= $vars;
$result_rules .= $rules;
}
}
# Handling the conditionals.
elsif (/$IF_PATTERN/o)
{
$cond = cond_stack_if ($1, $2, $file);
}
elsif (/$ELSE_PATTERN/o)
{
$cond = cond_stack_else ($1, $2, $file);
}
elsif (/$ENDIF_PATTERN/o)
{
$cond = cond_stack_endif ($1, $2, $file);
}
# Handling rules.
elsif (/$RULE_PATTERN/mso)
{
$is_rule = 1;
$discard_rule = 0;
# Separate relationship from optional actions: the first
# `new-line tab" not preceded by backslash (continuation
# line).
my $paragraph = $_;
/^(.*?)(?:(?subst_string/gme;
$result_rules .= "$spacing$comment$condparagraph\n";
}
if (scalar @undefined_conds == 0)
{
# Remember to discard next paragraphs
# if they belong to this rule.
# (but see also FIXME: #2 above.)
$discard_rule = 1;
}
$comment = $spacing = '';
last;
}
}
}
elsif (/$ASSIGNMENT_PATTERN/mso)
{
my ($var, $type, $val) = ($1, $2, $3);
error $where, "variable '$var' with trailing backslash"
if /\\$/;
$is_rule = 0;
Automake::Variable::define ($var,
$is_am ? VAR_AUTOMAKE : VAR_MAKEFILE,
$type, $cond, $val, $comment, $where,
VAR_ASIS)
if $cond != FALSE;
$comment = $spacing = '';
}
else
{
# This isn't an error; it is probably some tokens which
# configure is supposed to replace, such as '@SET-MAKE@',
# or some part of a rule cut by an if/endif.
if (! $cond->false && ! ($is_rule && $discard_rule))
{
s/^/$cond->subst_string/gme;
$result_rules .= "$spacing$comment$_\n";
}
$comment = $spacing = '';
}
}
error ($where, @cond_stack ?
"unterminated conditionals: @cond_stack" :
"too many conditionals closed in include file")
if "@saved_cond_stack" ne "@cond_stack";
return ($comment, $result_vars, $result_rules);
}
# $CONTENTS
# &file_contents ($BASENAME, $WHERE, [%TRANSFORM])
# ------------------------------------------------
# Return contents of a file from $libdir/am, automatically skipping
# macros or rules which are already known.
sub file_contents ($$%)
{
my ($basename, $where, %transform) = @_;
my ($comments, $variables, $rules) =
file_contents_internal (1, "$libdir/am/$basename.am", $where,
%transform);
return "$comments$variables$rules";
}
# @PREFIX
# &am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES)
# -----------------------------------------------------
# Find all variable prefixes that are used for install directories. A
# prefix 'zar' qualifies iff:
#
# * 'zardir' is a variable.
# * 'zar_PRIMARY' is a variable.
#
# As a side effect, it looks for misspellings. It is an error to have
# a variable ending in a "reserved" suffix whose prefix is unknown, e.g.
# "bni_PROGRAMS". However, unusual prefixes are allowed if a variable
# of the same name (with "dir" appended) exists. For instance, if the
# variable "zardir" is defined, then "zar_PROGRAMS" becomes valid.
# This is to provide a little extra flexibility in those cases which
# need it.
sub am_primary_prefixes ($$@)
{
my ($primary, $can_dist, @prefixes) = @_;
local $_;
my %valid = map { $_ => 0 } @prefixes;
$valid{'EXTRA'} = 0;
foreach my $var (variables $primary)
{
# Automake is allowed to define variables that look like primaries
# but which aren't. E.g. INSTALL_sh_DATA.
# Autoconf can also define variables like INSTALL_DATA, so
# ignore all configure variables (at least those which are not
# redefined in Makefile.am).
# FIXME: We should make sure that these variables are not
# conditionally defined (or else adjust the condition below).
my $def = $var->def (TRUE);
next if $def && $def->owner != VAR_MAKEFILE;
my $varname = $var->name;
if ($varname =~ /^(nobase_)?(dist_|nodist_)?(.*)_[[:alnum:]]+$/)
{
my ($base, $dist, $X) = ($1 || '', $2 || '', $3 || '');
if ($dist ne '' && ! $can_dist)
{
err_var ($var,
"invalid variable '$varname': 'dist' is forbidden");
}
# Standard directories must be explicitly allowed.
elsif (! defined $valid{$X} && exists $standard_prefix{$X})
{
err_var ($var,
"'${X}dir' is not a legitimate directory " .
"for '$primary'");
}
# A not explicitly valid directory is allowed if Xdir is defined.
elsif (! defined $valid{$X} &&
$var->requires_variables ("'$varname' is used", "${X}dir"))
{
# Nothing to do. Any error message has been output
# by $var->requires_variables.
}
else
{
# Ensure all extended prefixes are actually used.
$valid{"$base$dist$X"} = 1;
}
}
else
{
prog_error "unexpected variable name: $varname";
}
}
# Return only those which are actually defined.
return sort grep { var ($_ . '_' . $primary) } keys %valid;
}
# Handle 'where_HOW' variable magic. Does all lookups, generates
# install code, and possibly generates code to define the primary
# variable. The first argument is the name of the .am file to munge,
# the second argument is the primary variable (e.g. HEADERS), and all
# subsequent arguments are possible installation locations.
#
# Returns list of [$location, $value] pairs, where
# $value's are the values in all where_HOW variable, and $location
# there associated location (the place here their parent variables were
# defined).
#
# FIXME: this should be rewritten to be cleaner. It should be broken
# up into multiple functions.
#
# Usage is: am_install_var (OPTION..., file, HOW, where...)
sub am_install_var
{
my (@args) = @_;
my $do_require = 1;
my $can_dist = 0;
my $default_dist = 0;
while (@args)
{
if ($args[0] eq '-noextra')
{
$do_require = 0;
}
elsif ($args[0] eq '-candist')
{
$can_dist = 1;
}
elsif ($args[0] eq '-defaultdist')
{
$default_dist = 1;
$can_dist = 1;
}
elsif ($args[0] !~ /^-/)
{
last;
}
shift (@args);
}
my ($file, $primary, @prefix) = @args;
# Now that configure substitutions are allowed in where_HOW
# variables, it is an error to actually define the primary. We
# allow 'JAVA', as it is customarily used to mean the Java
# interpreter. This is but one of several Java hacks. Similarly,
# 'PYTHON' is customarily used to mean the Python interpreter.
reject_var $primary, "'$primary' is an anachronism"
unless $primary eq 'JAVA' || $primary eq 'PYTHON';
# Get the prefixes which are valid and actually used.
@prefix = am_primary_prefixes ($primary, $can_dist, @prefix);
# If a primary includes a configure substitution, then the EXTRA_
# form is required. Otherwise we can't properly do our job.
my $require_extra;
my @used = ();
my @result = ();
foreach my $X (@prefix)
{
my $nodir_name = $X;
my $one_name = $X . '_' . $primary;
my $one_var = var $one_name;
my $strip_subdir = 1;
# If subdir prefix should be preserved, do so.
if ($nodir_name =~ /^nobase_/)
{
$strip_subdir = 0;
$nodir_name =~ s/^nobase_//;
}
# If files should be distributed, do so.
my $dist_p = 0;
if ($can_dist)
{
$dist_p = (($default_dist && $nodir_name !~ /^nodist_/)
|| (! $default_dist && $nodir_name =~ /^dist_/));
$nodir_name =~ s/^(dist|nodist)_//;
}
# Use the location of the currently processed variable.
# We are not processing a particular condition, so pick the first
# available.
my $tmpcond = $one_var->conditions->one_cond;
my $where = $one_var->rdef ($tmpcond)->location->clone;
# Append actual contents of where_PRIMARY variable to
# @result, skipping @substitutions@.
foreach my $locvals ($one_var->value_as_list_recursive (location => 1))
{
my ($loc, $value) = @$locvals;
# Skip configure substitutions.
if ($value =~ /^\@.*\@$/)
{
if ($nodir_name eq 'EXTRA')
{
error ($where,
"'$one_name' contains configure substitution, "
. "but shouldn't");
}
# Check here to make sure variables defined in
# configure.ac do not imply that EXTRA_PRIMARY
# must be defined.
elsif (! defined $configure_vars{$one_name})
{
$require_extra = $one_name
if $do_require;
}
}
else
{
# Strip any $(EXEEXT) suffix the user might have added, or this
# will confuse &handle_source_transform and &check_canonical_spelling.
# We'll add $(EXEEXT) back later anyway.
# Do it here rather than in handle_programs so the uniquifying at the
# end of this function works.
${$locvals}[1] =~ s/\$\(EXEEXT\)$//
if $primary eq 'PROGRAMS';
push (@result, $locvals);
}
}
# A blatant hack: we rewrite each _PROGRAMS primary to include
# EXEEXT.
append_exeext { 1 } $one_name
if $primary eq 'PROGRAMS';
# "EXTRA" shouldn't be used when generating clean targets,
# all, or install targets. We used to warn if EXTRA_FOO was
# defined uselessly, but this was annoying.
next
if $nodir_name eq 'EXTRA';
if ($nodir_name eq 'check')
{
push (@check, '$(' . $one_name . ')');
}
else
{
push (@used, '$(' . $one_name . ')');
}
# Is this to be installed?
my $install_p = $nodir_name ne 'noinst' && $nodir_name ne 'check';
# If so, with install-exec? (or install-data?).
my $exec_p = ($nodir_name =~ /$EXEC_DIR_PATTERN/o);
my $check_options_p = $install_p && !! option 'std-options';
# Use the location of the currently processed variable as context.
$where->push_context ("while processing '$one_name'");
# The variable containing all files to distribute.
my $distvar = "\$($one_name)";
$distvar = shadow_unconditionally ($one_name, $where)
if ($dist_p && $one_var->has_conditional_contents);
# Singular form of $PRIMARY.
(my $one_primary = $primary) =~ s/S$//;
$output_rules .= &file_contents ($file, $where,
PRIMARY => $primary,
ONE_PRIMARY => $one_primary,
DIR => $X,
NDIR => $nodir_name,
BASE => $strip_subdir,
EXEC => $exec_p,
INSTALL => $install_p,
DIST => $dist_p,
DISTVAR => $distvar,
'CK-OPTS' => $check_options_p);
}
# The JAVA variable is used as the name of the Java interpreter.
# The PYTHON variable is used as the name of the Python interpreter.
if (@used && $primary ne 'JAVA' && $primary ne 'PYTHON')
{
# Define it.
define_pretty_variable ($primary, TRUE, INTERNAL, @used);
$output_vars .= "\n";
}
err_var ($require_extra,
"'$require_extra' contains configure substitution,\n"
. "but 'EXTRA_$primary' not defined")
if ($require_extra && ! var ('EXTRA_' . $primary));
# Push here because PRIMARY might be configure time determined.
push (@all, '$(' . $primary . ')')
if @used && $primary ne 'JAVA' && $primary ne 'PYTHON';
# Make the result unique. This lets the user use conditionals in
# a natural way, but still lets us program lazily -- we don't have
# to worry about handling a particular object more than once.
# We will keep only one location per object.
my %result = ();
for my $pair (@result)
{
my ($loc, $val) = @$pair;
$result{$val} = $loc;
}
my @l = sort keys %result;
return map { [$result{$_}->clone, $_] } @l;
}
################################################################
# Each key in this hash is the name of a directory holding a
# Makefile.in. These variables are local to 'is_make_dir'.
my %make_dirs = ();
my $make_dirs_set = 0;
sub is_make_dir
{
my ($dir) = @_;
if (! $make_dirs_set)
{
foreach my $iter (@configure_input_files)
{
$make_dirs{dirname ($iter)} = 1;
}
# We also want to notice Makefile.in's.
foreach my $iter (@other_input_files)
{
if ($iter =~ /Makefile\.in$/)
{
$make_dirs{dirname ($iter)} = 1;
}
}
$make_dirs_set = 1;
}
return defined $make_dirs{$dir};
}
################################################################
# Find the aux dir. This should match the algorithm used by
# ./configure. (See the Autoconf documentation for for
# AC_CONFIG_AUX_DIR.)
sub locate_aux_dir ()
{
if (! $config_aux_dir_set_in_configure_ac)
{
# The default auxiliary directory is the first
# of ., .., or ../.. that contains install-sh.
# Assume . if install-sh doesn't exist yet.
for my $dir (qw (. .. ../..))
{
if (-f "$dir/install-sh")
{
$config_aux_dir = $dir;
last;
}
}
$config_aux_dir = '.' unless $config_aux_dir;
}
# Avoid unsightly '/.'s.
$am_config_aux_dir =
'$(top_srcdir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
$am_config_aux_dir =~ s,/*$,,;
}
# &push_required_file ($DIR, $FILE, $FULLFILE)
# --------------------------------------------------
# Push the given file onto DIST_COMMON.
sub push_required_file
{
my ($dir, $file, $fullfile) = @_;
# If the file to be distributed is in the same directory of the
# currently processed Makefile.am, then we want to distribute it
# from this same Makefile.am.
if ($dir eq $relative_dir)
{
push_dist_common ($file);
}
# This is needed to allow a construct in a non-top-level Makefile.am
# to require a file in the build-aux directory (see at least the test
# script 'test-driver-is-distributed.sh'). This is related to the
# automake bug#9546. Note that the use of $config_aux_dir instead
# of $am_config_aux_dir here is deliberate and necessary.
elsif ($dir eq $config_aux_dir)
{
push_dist_common ("$am_config_aux_dir/$file");
}
# FIXME: another spacial case, for AC_LIBOBJ/AC_LIBSOURCE support.
# We probably need some refactoring of this function and its callers,
# to have a more explicit and systematic handling of all the special
# cases; but, since there are only two of them, this is low-priority
# ATM.
elsif ($config_libobj_dir && $dir eq $config_libobj_dir)
{
# Avoid unsightly '/.'s.
my $am_config_libobj_dir =
'$(top_srcdir)' .
($config_libobj_dir eq '.' ? "" : "/$config_libobj_dir");
$am_config_libobj_dir =~ s|/*$||;
push_dist_common ("$am_config_libobj_dir/$file");
}
elsif ($relative_dir eq '.' && ! &is_make_dir ($dir))
{
# If we are doing the topmost directory, and the file is in a
# subdir which does not have a Makefile, then we distribute it
# here.
# If a required file is above the source tree, it is important
# to prefix it with '$(srcdir)' so that no VPATH search is
# performed. Otherwise problems occur with Make implementations
# that rewrite and simplify rules whose dependencies are found in a
# VPATH location. Here is an example with OSF1/Tru64 Make.
#
# % cat Makefile
# VPATH = sub
# distdir: ../a
# echo ../a
# % ls
# Makefile a
# % make
# echo a
# a
#
# Dependency '../a' was found in 'sub/../a', but this make
# implementation simplified it as 'a'. (Note that the sub/
# directory does not even exist.)
#
# This kind of VPATH rewriting seems hard to cancel. The
# distdir.am hack against VPATH rewriting works only when no
# simplification is done, i.e., for dependencies which are in
# subdirectories, not in enclosing directories. Hence, in
# the latter case we use a full path to make sure no VPATH
# search occurs.
$fullfile = '$(srcdir)/' . $fullfile
if $dir =~ m,^\.\.(?:$|/),;
push_dist_common ($fullfile);
}
else
{
prog_error "a Makefile in relative directory $relative_dir " .
"can't add files in directory $dir to DIST_COMMON";
}
}
# If a file name appears as a key in this hash, then it has already
# been checked for. This allows us not to report the same error more
# than once.
my %required_file_not_found = ();
# &required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE)
# --------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
sub required_file_check_or_copy ($$$)
{
my ($where, $dir, $file) = @_;
my $fullfile = "$dir/$file";
my $found_it = 0;
my $dangling_sym = 0;
if (-l $fullfile && ! -f $fullfile)
{
$dangling_sym = 1;
}
elsif (dir_has_case_matching_file ($dir, $file))
{
$found_it = 1;
}
# '--force-missing' only has an effect if '--add-missing' is
# specified.
return
if $found_it && (! $add_missing || ! $force_missing);
# If we've already looked for it, we're done. You might
# wonder why we don't do this before searching for the
# file. If we do that, then something like
# AC_OUTPUT(subdir/foo foo) will fail to put foo.in into
# DIST_COMMON.
if (! $found_it)
{
return if defined $required_file_not_found{$fullfile};
$required_file_not_found{$fullfile} = 1;
}
if ($dangling_sym && $add_missing)
{
unlink ($fullfile);
}
my $trailer = '';
my $trailer2 = '';
my $suppress = 0;
# Only install missing files according to our desired
# strictness level.
my $message = "required file '$fullfile' not found";
if ($add_missing)
{
if (-f "$libdir/$file")
{
$suppress = 1;
# Install the missing file. Symlink if we
# can, copy if we must. Note: delete the file
# first, in case it is a dangling symlink.
$message = "installing '$fullfile'";
# The license file should not be volatile.
if ($file eq "COPYING")
{
$message .= " using GNU General Public License v3 file";
$trailer2 = "\n Consider adding the COPYING file"
. " to the version control system"
. "\n for your code, to avoid questions"
. " about which license your project uses";
}
# Windows Perl will hang if we try to delete a
# file that doesn't exist.
unlink ($fullfile) if -f $fullfile;
if ($symlink_exists && ! $copy_missing)
{
if (! symlink ("$libdir/$file", $fullfile)
|| ! -e $fullfile)
{
$suppress = 0;
$trailer = "; error while making link: $!";
}
}
elsif (system ('cp', "$libdir/$file", $fullfile))
{
$suppress = 0;
$trailer = "\n error while copying";
}
set_dir_cache_file ($dir, $file);
}
}
else
{
$trailer = "\n 'automake --add-missing' can install '$file'"
if -f "$libdir/$file";
}
# If --force-missing was specified, and we have
# actually found the file, then do nothing.
return
if $found_it && $force_missing;
# If we couldn't install the file, but it is a target in
# the Makefile, don't print anything. This allows files
# like README, AUTHORS, or THANKS to be generated.
return
if !$suppress && rule $file;
msg ($suppress ? 'note' : 'error', $where, "$message$trailer$trailer2");
}
# &require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
# ----------------------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
# $MYSTRICT is the strictness level at which this file becomes required.
# Worker threads may queue up the action to be serialized by the master,
# if $QUEUE is true
sub require_file_internal ($$$@)
{
my ($where, $mystrict, $dir, $queue, @files) = @_;
return
unless $strictness >= $mystrict;
foreach my $file (@files)
{
push_required_file ($dir, $file, "$dir/$file");
if ($queue)
{
queue_required_file_check_or_copy ($required_conf_file_queue,
QUEUE_CONF_FILE, $relative_dir,
$where, $mystrict, @files);
}
else
{
required_file_check_or_copy ($where, $dir, $file);
}
}
}
# &require_file ($WHERE, $MYSTRICT, @FILES)
# -----------------------------------------
sub require_file ($$@)
{
my ($where, $mystrict, @files) = @_;
require_file_internal ($where, $mystrict, $relative_dir, 0, @files);
}
# &require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
# -----------------------------------------------------------
sub require_file_with_macro ($$$@)
{
my ($cond, $macro, $mystrict, @files) = @_;
$macro = rvar ($macro) unless ref $macro;
require_file ($macro->rdef ($cond)->location, $mystrict, @files);
}
# &require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
# ----------------------------------------------------------------
# Require an AC_LIBSOURCEd file. If AC_CONFIG_LIBOBJ_DIR was called, it
# must be in that directory. Otherwise expect it in the current directory.
sub require_libsource_with_macro ($$$@)
{
my ($cond, $macro, $mystrict, @files) = @_;
$macro = rvar ($macro) unless ref $macro;
if ($config_libobj_dir)
{
require_file_internal ($macro->rdef ($cond)->location, $mystrict,
$config_libobj_dir, 0, @files);
}
else
{
require_file ($macro->rdef ($cond)->location, $mystrict, @files);
}
}
# &queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
# $MYSTRICT, @FILES)
# ---------------------------------------------------------------
sub queue_required_file_check_or_copy ($$$$@)
{
my ($queue, $key, $dir, $where, $mystrict, @files) = @_;
my @serial_loc;
if (ref $where)
{
@serial_loc = (QUEUE_LOCATION, $where->serialize ());
}
else
{
@serial_loc = (QUEUE_STRING, $where);
}
$queue->enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files);
}
# &require_queued_file_check_or_copy ($QUEUE)
# -------------------------------------------
sub require_queued_file_check_or_copy ($)
{
my ($queue) = @_;
my $where;
my $dir = $queue->dequeue ();
my $loc_key = $queue->dequeue ();
if ($loc_key eq QUEUE_LOCATION)
{
$where = Automake::Location::deserialize ($queue);
}
elsif ($loc_key eq QUEUE_STRING)
{
$where = $queue->dequeue ();
}
else
{
prog_error "unexpected key $loc_key";
}
my $mystrict = $queue->dequeue ();
my $nfiles = $queue->dequeue ();
my @files;
push @files, $queue->dequeue ()
foreach (1 .. $nfiles);
return
unless $strictness >= $mystrict;
foreach my $file (@files)
{
required_file_check_or_copy ($where, $config_aux_dir, $file);
}
}
# &require_conf_file ($WHERE, $MYSTRICT, @FILES)
# ----------------------------------------------
# Looks in configuration path, as specified by AC_CONFIG_AUX_DIR.
sub require_conf_file ($$@)
{
my ($where, $mystrict, @files) = @_;
my $queue = defined $required_conf_file_queue ? 1 : 0;
require_file_internal ($where, $mystrict, $config_aux_dir,
$queue, @files);
}
# &require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
# ----------------------------------------------------------------
sub require_conf_file_with_macro ($$$@)
{
my ($cond, $macro, $mystrict, @files) = @_;
require_conf_file (rvar ($macro)->rdef ($cond)->location,
$mystrict, @files);
}
################################################################
# &require_build_directory ($DIRECTORY)
# -------------------------------------
# Emit rules to create $DIRECTORY if needed, and return
# the file that any target requiring this directory should be made
# dependent upon.
# We don't want to emit the rule twice, and want to reuse it
# for directories with equivalent names (e.g., 'foo/bar' and './foo//bar').
sub require_build_directory ($)
{
my $directory = shift;
return $directory_map{$directory} if exists $directory_map{$directory};
my $cdir = File::Spec->canonpath ($directory);
if (exists $directory_map{$cdir})
{
my $stamp = $directory_map{$cdir};
$directory_map{$directory} = $stamp;
return $stamp;
}
my $dirstamp = "$cdir/\$(am__dirstamp)";
$directory_map{$directory} = $dirstamp;
$directory_map{$cdir} = $dirstamp;
# Set a variable for the dirstamp basename.
define_pretty_variable ('am__dirstamp', TRUE, INTERNAL,
'$(am__leading_dot)dirstamp');
# Directory must be removed by 'make distclean'.
$clean_files{$dirstamp} = DIST_CLEAN;
$output_rules .= ("$dirstamp:\n"
. "\t\@\$(MKDIR_P) $directory\n"
. "\t\@: > $dirstamp\n");
return $dirstamp;
}
# &require_build_directory_maybe ($FILE)
# --------------------------------------
# If $FILE lies in a subdirectory, emit a rule to create this
# directory and return the file that $FILE should be made
# dependent upon. Otherwise, just return the empty string.
sub require_build_directory_maybe ($)
{
my $file = shift;
my $directory = dirname ($file);
if ($directory ne '.')
{
return require_build_directory ($directory);
}
else
{
return '';
}
}
################################################################
# Push a list of files onto dist_common.
sub push_dist_common
{
prog_error "push_dist_common run after handle_dist"
if $handle_dist_run;
Automake::Variable::define ('DIST_COMMON', VAR_AUTOMAKE, '+', TRUE, "@_",
'', INTERNAL, VAR_PRETTY);
}
################################################################
# generate_makefile ($MAKEFILE_AM, $MAKEFILE_IN)
# ----------------------------------------------
# Generate a Makefile.in given the name of the corresponding Makefile and
# the name of the file output by config.status.
sub generate_makefile ($$)
{
my ($makefile_am, $makefile_in) = @_;
# Reset all the Makefile.am related variables.
initialize_per_input;
# AUTOMAKE_OPTIONS can contains -W flags to disable or enable
# warnings for this file. So hold any warning issued before
# we have processed AUTOMAKE_OPTIONS.
buffer_messages ('warning');
# $OUTPUT is encoded. If it contains a ":" then the first element
# is the real output file, and all remaining elements are input
# files. We don't scan or otherwise deal with these input files,
# other than to mark them as dependencies. See
# &scan_autoconf_files for details.
my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in});
$relative_dir = dirname ($makefile);
read_main_am_file ($makefile_am, $makefile_in);
if (handle_options)
{
# Process buffered warnings.
flush_messages;
# Fatal error. Just return, so we can continue with next file.
return;
}
# Process buffered warnings.
flush_messages;
# There are a few install-related variables that you should not define.
foreach my $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL')
{
my $v = var $var;
if ($v)
{
my $def = $v->def (TRUE);
prog_error "$var not defined in condition TRUE"
unless $def;
reject_var $var, "'$var' should not be defined"
if $def->owner != VAR_AUTOMAKE;
}
}
# Catch some obsolete variables.
msg_var ('obsolete', 'INCLUDES',
"'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')")
if var ('INCLUDES');
# Must do this after reading .am file.
define_variable ('subdir', $relative_dir, INTERNAL);
# If DIST_SUBDIRS is defined, make sure SUBDIRS is, so that
# recursive rules are enabled.
define_pretty_variable ('SUBDIRS', TRUE, INTERNAL, '')
if var 'DIST_SUBDIRS' && ! var 'SUBDIRS';
# Check first, because we might modify some state.
check_gnu_standards;
check_gnits_standards;
handle_configure ($makefile_am, $makefile_in, $makefile, @inputs);
handle_gettext;
handle_libraries;
handle_ltlibraries;
handle_programs;
handle_scripts;
handle_silent;
# These must be run after all the sources are scanned. They
# use variables defined by &handle_libraries, &handle_ltlibraries,
# or &handle_programs.
handle_compile;
handle_languages;
handle_libtool;
# Variables used by distdir.am and tags.am.
define_pretty_variable ('SOURCES', TRUE, INTERNAL, @sources);
if (! option 'no-dist')
{
define_pretty_variable ('DIST_SOURCES', TRUE, INTERNAL, @dist_sources);
}
handle_texinfo;
handle_emacs_lisp;
handle_python;
handle_java;
handle_man_pages;
handle_data;
handle_headers;
handle_subdirs;
handle_user_recursion;
handle_tags;
handle_minor_options;
# Must come after handle_programs so that %known_programs is up-to-date.
handle_tests;
# This must come after most other rules.
handle_dist;
handle_footer;
do_check_merge_target;
handle_all ($makefile);
# FIXME: Gross!
if (var ('lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
{
$output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n";
}
if (var ('nobase_lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
{
$output_rules .= "install-binPROGRAMS: install-nobase_libLTLIBRARIES\n\n";
}
handle_install;
handle_clean ($makefile);
handle_factored_dependencies;
# Comes last, because all the above procedures may have
# defined or overridden variables.
$output_vars .= output_variables;
check_typos;
if ($exit_code != 0)
{
verb "not writing $makefile_in because of earlier errors";
return;
}
my $am_relative_dir = dirname ($makefile_am);
mkdir ($am_relative_dir, 0755) if ! -d $am_relative_dir;
# We make sure that 'all:' is the first target.
my $output =
"$output_vars$output_all$output_header$output_rules$output_trailer";
# Decide whether we must update the output file or not.
# We have to update in the following situations.
# * $force_generation is set.
# * any of the output dependencies is younger than the output
# * the contents of the output is different (this can happen
# if the project has been populated with a file listed in
# @common_files since the last run).
# Output's dependencies are split in two sets:
# * dependencies which are also configure dependencies
# These do not change between each Makefile.am
# * other dependencies, specific to the Makefile.am being processed
# (such as the Makefile.am itself, or any Makefile fragment
# it includes).
my $timestamp = mtime $makefile_in;
if (! $force_generation
&& $configure_deps_greatest_timestamp < $timestamp
&& $output_deps_greatest_timestamp < $timestamp
&& $output eq contents ($makefile_in))
{
verb "$makefile_in unchanged";
# No need to update.
return;
}
if (-e $makefile_in)
{
unlink ($makefile_in)
or fatal "cannot remove $makefile_in: $!";
}
my $gm_file = new Automake::XFile "> $makefile_in";
verb "creating $makefile_in";
print $gm_file $output;
}
################################################################
################################################################
# Helper function for usage().
sub print_autodist_files (@)
{
my @lcomm = sort (&uniq (@_));
my @four;
format USAGE_FORMAT =
@<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<
$four[0], $four[1], $four[2], $four[3]
.
local $~ = "USAGE_FORMAT";
my $cols = 4;
my $rows = int(@lcomm / $cols);
my $rest = @lcomm % $cols;
if ($rest)
{
$rows++;
}
else
{
$rest = $cols;
}
for (my $y = 0; $y < $rows; $y++)
{
@four = ("", "", "", "");
for (my $x = 0; $x < $cols; $x++)
{
last if $y + 1 == $rows && $x == $rest;
my $idx = (($x > $rest)
? ($rows * $rest + ($rows - 1) * ($x - $rest))
: ($rows * $x));
$idx += $y;
$four[$x] = $lcomm[$idx];
}
write;
}
}
# Print usage information.
sub usage ()
{
print "Usage: $0 [OPTION]... [Makefile]...
Generate Makefile.in for configure from Makefile.am.
Operation modes:
--help print this help, then exit
--version print version number, then exit
-v, --verbose verbosely list files processed
--no-force only update Makefile.in's that are out of date
-W, --warnings=CATEGORY report the warnings falling in CATEGORY
Dependency tracking:
-i, --ignore-deps disable dependency tracking code
--include-deps enable dependency tracking code
Flavors:
--foreign set strictness to foreign
--gnits set strictness to gnits
--gnu set strictness to gnu
Library files:
-a, --add-missing add missing standard files to package
--libdir=DIR set directory storing library files
--print-libdir print directory storing library files
-c, --copy with -a, copy missing files (default is symlink)
-f, --force-missing force update of standard files
";
Automake::ChannelDefs::usage;
print "\nFiles automatically distributed if found " .
"(always):\n";
print_autodist_files @common_files;
print "\nFiles automatically distributed if found " .
"(under certain conditions):\n";
print_autodist_files @common_sometimes;
print '
Report bugs to .
GNU Automake home page: .
General help using GNU software: .
';
# --help always returns 0 per GNU standards.
exit 0;
}
# &version ()
# -----------
# Print version information
sub version ()
{
print <
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Tom Tromey
and Alexandre Duret-Lutz .
EOF
# --version always returns 0 per GNU standards.
exit 0;
}
################################################################
# Parse command line.
sub parse_arguments ()
{
my $strict = 'gnu';
my $ignore_deps = 0;
my @warnings = ();
my %cli_options =
(
'version' => \&version,
'help' => \&usage,
'libdir=s' => \$libdir,
'print-libdir' => sub { print "$libdir\n"; exit 0; },
'gnu' => sub { $strict = 'gnu'; },
'gnits' => sub { $strict = 'gnits'; },
'foreign' => sub { $strict = 'foreign'; },
'include-deps' => sub { $ignore_deps = 0; },
'i|ignore-deps' => sub { $ignore_deps = 1; },
'no-force' => sub { $force_generation = 0; },
'f|force-missing' => \$force_missing,
'a|add-missing' => \$add_missing,
'c|copy' => \$copy_missing,
'v|verbose' => sub { setup_channel 'verb', silent => 0; },
'W|warnings=s' => \@warnings,
);
use Automake::Getopt ();
Automake::Getopt::parse_options %cli_options;
set_strictness ($strict);
my $cli_where = new Automake::Location;
set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
for my $warning (@warnings)
{
&parse_warnings ('-W', $warning);
}
return unless @ARGV;
my $errspec = 0;
foreach my $arg (@ARGV)
{
fatal ("empty argument\nTry '$0 --help' for more information")
if ($arg eq '');
# Handle $local:$input syntax.
my ($local, @rest) = split (/:/, $arg);
@rest = ("$local.in",) unless @rest;
my $input = locate_am @rest;
if ($input)
{
push @input_files, $input;
$output_files{$input} = join (':', ($local, @rest));
}
else
{
error "no Automake input file found for '$arg'";
$errspec = 1;
}
}
fatal "no input file found among supplied arguments"
if $errspec && ! @input_files;
}
# handle_makefile ($MAKEFILE_IN)
# ------------------------------
# Deal with $MAKEFILE_IN.
sub handle_makefile ($)
{
my ($file) = @_;
($am_file = $file) =~ s/\.in$//;
if (! -f ($am_file . '.am'))
{
error "'$am_file.am' does not exist";
}
else
{
# Any warning setting now local to this Makefile.am.
dup_channel_setup;
generate_makefile ($am_file . '.am', $file);
# Back out any warning setting.
drop_channel_setup;
}
}
# handle_makefiles_serial ()
# --------------------------
# Deal with all makefiles, without threads.
sub handle_makefiles_serial ()
{
foreach my $file (@input_files)
{
handle_makefile ($file);
}
}
# get_number_of_threads ()
# ------------------------
# Logic for deciding how many worker threads to use.
sub get_number_of_threads
{
my $nthreads = $ENV{'AUTOMAKE_JOBS'} || 0;
$nthreads = 0
unless $nthreads =~ /^[0-9]+$/;
# It doesn't make sense to use more threads than makefiles,
my $max_threads = @input_files;
if ($nthreads > $max_threads)
{
$nthreads = $max_threads;
}
return $nthreads;
}
# handle_makefiles_threaded ($NTHREADS)
# -------------------------------------
# Deal with all makefiles, using threads. The general strategy is to
# spawn NTHREADS worker threads, dispatch makefiles to them, and let the
# worker threads push back everything that needs serialization:
# * warning and (normal) error messages, for stable stderr output
# order and content (avoiding duplicates, for example),
# * races when installing aux files (and respective messages),
# * races when collecting aux files for distribution.
#
# The latter requires that the makefile that deals with the aux dir
# files be handled last, done by the master thread.
sub handle_makefiles_threaded ($)
{
my ($nthreads) = @_;
# The file queue distributes all makefiles, the message queues
# collect all serializations needed for respective files.
my $file_queue = Thread::Queue->new;
my %msg_queues;
foreach my $file (@input_files)
{
$msg_queues{$file} = Thread::Queue->new;
}
verb "spawning $nthreads worker threads";
my @threads = (1 .. $nthreads);
foreach my $t (@threads)
{
$t = threads->new (sub
{
while (my $file = $file_queue->dequeue)
{
verb "handling $file";
my $queue = $msg_queues{$file};
setup_channel_queue ($queue, QUEUE_MESSAGE);
$required_conf_file_queue = $queue;
handle_makefile ($file);
$queue->enqueue (undef);
setup_channel_queue (undef, undef);
$required_conf_file_queue = undef;
}
return $exit_code;
});
}
# Queue all makefiles.
verb "queuing " . @input_files . " input files";
$file_queue->enqueue (@input_files, (undef) x @threads);
# Collect and process serializations.
foreach my $file (@input_files)
{
verb "dequeuing messages for " . $file;
reset_local_duplicates ();
my $queue = $msg_queues{$file};
while (my $key = $queue->dequeue)
{
if ($key eq QUEUE_MESSAGE)
{
pop_channel_queue ($queue);
}
elsif ($key eq QUEUE_CONF_FILE)
{
require_queued_file_check_or_copy ($queue);
}
else
{
prog_error "unexpected key $key";
}
}
}
foreach my $t (@threads)
{
my @exit_thread = $t->join;
$exit_code = $exit_thread[0]
if ($exit_thread[0] > $exit_code);
}
}
################################################################
# Parse the WARNINGS environment variable.
parse_WARNINGS;
# Parse command line.
parse_arguments;
$configure_ac = require_configure_ac;
# Do configure.ac scan only once.
scan_autoconf_files;
if (! @input_files)
{
my $msg = '';
$msg = "\nDid you forget AC_CONFIG_FILES([Makefile]) in $configure_ac?"
if -f 'Makefile.am';
fatal ("no 'Makefile.am' found for any configure output$msg");
}
my $nthreads = get_number_of_threads ();
if ($perl_threads && $nthreads >= 1)
{
handle_makefiles_threaded ($nthreads);
}
else
{
handle_makefiles_serial ();
}
exit $exit_code;
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:
07070100024f37000041ed00000000000000000000000853157abd00000000000001000001014cffffffffffffffff0000001500000000root/usr/local/share 07070100024f5d000041ed00000000000000000000000453157abd00000000000001000001014cffffffffffffffff0000002300000000root/usr/local/share/automake-1.13 07070100024fa8000081ed00000000000000000000000153157ab600004c3a000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/tap-driver.sh #! /bin/sh
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
scriptversion=2011-12-27.17; # UTC
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
me=tap-driver.sh
fatal ()
{
echo "$me: fatal: $*" >&2
exit 1
}
usage_error ()
{
echo "$me: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <
#
trap : 1 3 2 13 15
if test $merge -gt 0; then
exec 2>&1
else
exec 2>&3
fi
"$@"
echo $?
) | LC_ALL=C ${AM_TAP_AWK-awk} \
-v me="$me" \
-v test_script_name="$test_name" \
-v log_file="$log_file" \
-v trs_file="$trs_file" \
-v expect_failure="$expect_failure" \
-v merge="$merge" \
-v ignore_exit="$ignore_exit" \
-v comments="$comments" \
-v diag_string="$diag_string" \
'
# FIXME: the usages of "cat >&3" below could be optimized when using
# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
# Implementation note: in what follows, `result_obj` will be an
# associative array that (partly) simulates a TAP result object
# from the `TAP::Parser` perl module.
## ----------- ##
## FUNCTIONS ##
## ----------- ##
function fatal(msg)
{
print me ": " msg | "cat >&2"
exit 1
}
function abort(where)
{
fatal("internal error " where)
}
# Convert a boolean to a "yes"/"no" string.
function yn(bool)
{
return bool ? "yes" : "no";
}
function add_test_result(result)
{
if (!test_results_index)
test_results_index = 0
test_results_list[test_results_index] = result
test_results_index += 1
test_results_seen[result] = 1;
}
# Whether the test script should be re-run by "make recheck".
function must_recheck()
{
for (k in test_results_seen)
if (k != "XFAIL" && k != "PASS" && k != "SKIP")
return 1
return 0
}
# Whether the content of the log file associated to this test should
# be copied into the "global" test-suite.log.
function copy_in_global_log()
{
for (k in test_results_seen)
if (k != "PASS")
return 1
return 0
}
# FIXME: this can certainly be improved ...
function get_global_test_result()
{
if ("ERROR" in test_results_seen)
return "ERROR"
if ("FAIL" in test_results_seen || "XPASS" in test_results_seen)
return "FAIL"
all_skipped = 1
for (k in test_results_seen)
if (k != "SKIP")
all_skipped = 0
if (all_skipped)
return "SKIP"
return "PASS";
}
function stringify_result_obj(result_obj)
{
if (result_obj["is_unplanned"] || result_obj["number"] != testno)
return "ERROR"
if (plan_seen == LATE_PLAN)
return "ERROR"
if (result_obj["directive"] == "TODO")
return result_obj["is_ok"] ? "XPASS" : "XFAIL"
if (result_obj["directive"] == "SKIP")
return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL;
if (length(result_obj["directive"]))
abort("in function stringify_result_obj()")
return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL
}
function decorate_result(result)
{
color_name = color_for_result[result]
if (color_name)
return color_map[color_name] "" result "" color_map["std"]
# If we are not using colorized output, or if we do not know how
# to colorize the given result, we should return it unchanged.
return result
}
function report(result, details)
{
if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/)
{
msg = ": " test_script_name
add_test_result(result)
}
else if (result == "#")
{
msg = " " test_script_name ":"
}
else
{
abort("in function report()")
}
if (length(details))
msg = msg " " details
# Output on console might be colorized.
print decorate_result(result) msg
# Log the result in the log file too, to help debugging (this is
# especially true when said result is a TAP error or "Bail out!").
print result msg | "cat >&3";
}
function testsuite_error(error_message)
{
report("ERROR", "- " error_message)
}
function handle_tap_result()
{
details = result_obj["number"];
if (length(result_obj["description"]))
details = details " " result_obj["description"]
if (plan_seen == LATE_PLAN)
{
details = details " # AFTER LATE PLAN";
}
else if (result_obj["is_unplanned"])
{
details = details " # UNPLANNED";
}
else if (result_obj["number"] != testno)
{
details = sprintf("%s # OUT-OF-ORDER (expecting %d)",
details, testno);
}
else if (result_obj["directive"])
{
details = details " # " result_obj["directive"];
if (length(result_obj["explanation"]))
details = details " " result_obj["explanation"]
}
report(stringify_result_obj(result_obj), details)
}
# `skip_reason` should be empty whenever planned > 0.
function handle_tap_plan(planned, skip_reason)
{
planned += 0 # Avoid getting confused if, say, `planned` is "00"
if (length(skip_reason) && planned > 0)
abort("in function handle_tap_plan()")
if (plan_seen)
{
# Error, only one plan per stream is acceptable.
testsuite_error("multiple test plans")
return;
}
planned_tests = planned
# The TAP plan can come before or after *all* the TAP results; we speak
# respectively of an "early" or a "late" plan. If we see the plan line
# after at least one TAP result has been seen, assume we have a late
# plan; in this case, any further test result seen after the plan will
# be flagged as an error.
plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN)
# If testno > 0, we have an error ("too many tests run") that will be
# automatically dealt with later, so do not worry about it here. If
# $plan_seen is true, we have an error due to a repeated plan, and that
# has already been dealt with above. Otherwise, we have a valid "plan
# with SKIP" specification, and should report it as a particular kind
# of SKIP result.
if (planned == 0 && testno == 0)
{
if (length(skip_reason))
skip_reason = "- " skip_reason;
report("SKIP", skip_reason);
}
}
function extract_tap_comment(line)
{
if (index(line, diag_string) == 1)
{
# Strip leading `diag_string` from `line`.
line = substr(line, length(diag_string) + 1)
# And strip any leading and trailing whitespace left.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
# Return what is left (if any).
return line;
}
return "";
}
# When this function is called, we know that line is a TAP result line,
# so that it matches the (perl) RE "^(not )?ok\b".
function setup_result_obj(line)
{
# Get the result, and remove it from the line.
result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
sub("^(not )?ok[ \t]*", "", line)
# If the result has an explicit number, get it and strip it; otherwise,
# automatically assing the next progresive number to it.
if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
{
match(line, "^[0-9]+")
# The final `+ 0` is to normalize numbers with leading zeros.
result_obj["number"] = substr(line, 1, RLENGTH) + 0
line = substr(line, RLENGTH + 1)
}
else
{
result_obj["number"] = testno
}
if (plan_seen == LATE_PLAN)
# No further test results are acceptable after a "late" TAP plan
# has been seen.
result_obj["is_unplanned"] = 1
else if (plan_seen && testno > planned_tests)
result_obj["is_unplanned"] = 1
else
result_obj["is_unplanned"] = 0
# Strip trailing and leading whitespace.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
# This will have to be corrected if we have a "TODO"/"SKIP" directive.
result_obj["description"] = line
result_obj["directive"] = ""
result_obj["explanation"] = ""
if (index(line, "#") == 0)
return # No possible directive, nothing more to do.
# Directives are case-insensitive.
rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
# See whether we have the directive, and if yes, where.
pos = match(line, rx "$")
if (!pos)
pos = match(line, rx "[^a-zA-Z0-9_]")
# If there was no TAP directive, we have nothing more to do.
if (!pos)
return
# Let`s now see if the TAP directive has been escaped. For example:
# escaped: ok \# SKIP
# not escaped: ok \\# SKIP
# escaped: ok \\\\\# SKIP
# not escaped: ok \ # SKIP
if (substr(line, pos, 1) == "#")
{
bslash_count = 0
for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--)
bslash_count += 1
if (bslash_count % 2)
return # Directive was escaped.
}
# Strip the directive and its explanation (if any) from the test
# description.
result_obj["description"] = substr(line, 1, pos - 1)
# Now remove the test description from the line, that has been dealt
# with already.
line = substr(line, pos)
# Strip the directive, and save its value (normalized to upper case).
sub("^[ \t]*#[ \t]*", "", line)
result_obj["directive"] = toupper(substr(line, 1, 4))
line = substr(line, 5)
# Now get the explanation for the directive (if any), with leading
# and trailing whitespace removed.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
result_obj["explanation"] = line
}
function get_test_exit_message(status)
{
if (status == 0)
return ""
if (status !~ /^[1-9][0-9]*$/)
abort("getting exit status")
if (status < 127)
exit_details = ""
else if (status == 127)
exit_details = " (command not found?)"
else if (status >= 128 && status <= 255)
exit_details = sprintf(" (terminated by signal %d?)", status - 128)
else if (status > 256 && status <= 384)
# We used to report an "abnormal termination" here, but some Korn
# shells, when a child process die due to signal number n, can leave
# in $? an exit status of 256+n instead of the more standard 128+n.
# Apparently, both behaviours are allowed by POSIX (2008), so be
# prepared to handle them both. See also Austing Group report ID
# 0000051
exit_details = sprintf(" (terminated by signal %d?)", status - 256)
else
# Never seen in practice.
exit_details = " (abnormal termination)"
return sprintf("exited with status %d%s", status, exit_details)
}
function write_test_results()
{
print ":global-test-result: " get_global_test_result() > trs_file
print ":recheck: " yn(must_recheck()) > trs_file
print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file
for (i = 0; i < test_results_index; i += 1)
print ":test-result: " test_results_list[i] > trs_file
close(trs_file);
}
BEGIN {
## ------- ##
## SETUP ##
## ------- ##
'"$init_colors"'
# Properly initialized once the TAP plan is seen.
planned_tests = 0
COOKED_PASS = expect_failure ? "XPASS": "PASS";
COOKED_FAIL = expect_failure ? "XFAIL": "FAIL";
# Enumeration-like constants to remember which kind of plan (if any)
# has been seen. It is important that NO_PLAN evaluates "false" as
# a boolean.
NO_PLAN = 0
EARLY_PLAN = 1
LATE_PLAN = 2
testno = 0 # Number of test results seen so far.
bailed_out = 0 # Whether a "Bail out!" directive has been seen.
# Whether the TAP plan has been seen or not, and if yes, which kind
# it is ("early" is seen before any test result, "late" otherwise).
plan_seen = NO_PLAN
## --------- ##
## PARSING ##
## --------- ##
is_first_read = 1
while (1)
{
# Involutions required so that we are able to read the exit status
# from the last input line.
st = getline
if (st < 0) # I/O error.
fatal("I/O error while reading from input stream")
else if (st == 0) # End-of-input
{
if (is_first_read)
abort("in input loop: only one input line")
break
}
if (is_first_read)
{
is_first_read = 0
nextline = $0
continue
}
else
{
curline = nextline
nextline = $0
$0 = curline
}
# Copy any input line verbatim into the log file.
print | "cat >&3"
# Parsing of TAP input should stop after a "Bail out!" directive.
if (bailed_out)
continue
# TAP test result.
if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/)
{
testno += 1
setup_result_obj($0)
handle_tap_result()
}
# TAP plan (normal or "SKIP" without explanation).
else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/)
{
# The next two lines will put the number of planned tests in $0.
sub("^1\\.\\.", "")
sub("[^0-9]*$", "")
handle_tap_plan($0, "")
continue
}
# TAP "SKIP" plan, with an explanation.
else if ($0 ~ /^1\.\.0+[ \t]*#/)
{
# The next lines will put the skip explanation in $0, stripping
# any leading and trailing whitespace. This is a little more
# tricky in truth, since we want to also strip a potential leading
# "SKIP" string from the message.
sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
sub("[ \t]*$", "");
handle_tap_plan(0, $0)
}
# "Bail out!" magic.
# Older versions of prove and TAP::Harness (e.g., 3.17) did not
# recognize a "Bail out!" directive when preceded by leading
# whitespace, but more modern versions (e.g., 3.23) do. So we
# emulate the latter, "more modern" behaviour.
else if ($0 ~ /^[ \t]*Bail out!/)
{
bailed_out = 1
# Get the bailout message (if any), with leading and trailing
# whitespace stripped. The message remains stored in `$0`.
sub("^[ \t]*Bail out![ \t]*", "");
sub("[ \t]*$", "");
# Format the error message for the
bailout_message = "Bail out!"
if (length($0))
bailout_message = bailout_message " " $0
testsuite_error(bailout_message)
}
# Maybe we have too look for dianogtic comments too.
else if (comments != 0)
{
comment = extract_tap_comment($0);
if (length(comment))
report("#", comment);
}
}
## -------- ##
## FINISH ##
## -------- ##
# A "Bail out!" directive should cause us to ignore any following TAP
# error, as well as a non-zero exit status from the TAP producer.
if (!bailed_out)
{
if (!plan_seen)
{
testsuite_error("missing test plan")
}
else if (planned_tests != testno)
{
bad_amount = testno > planned_tests ? "many" : "few"
testsuite_error(sprintf("too %s tests run (expected %d, got %d)",
bad_amount, planned_tests, testno))
}
if (!ignore_exit)
{
# Fetch exit status from the last line.
exit_message = get_test_exit_message(nextline)
if (exit_message)
testsuite_error(exit_message)
}
}
write_test_results()
exit 0
} # End of "BEGIN" block.
'
# TODO: document that we consume the file descriptor 3 :-(
} 3>"$log_file"
test $? -eq 0 || fatal "I/O or internal error"
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024fa0000081ed00000000000000000000000153157ab500008ac1000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/config.sub #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2013-04-24'
# This file 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 3 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, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or1k-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
07070100024fa2000081ed00000000000000000000000153157ab5000036ad000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/install-sh #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024faa000081a400000000000000000000000153157ab50004ee1e000001000001014cffffffffffffffff0000002f00000000root/usr/local/share/automake-1.13/texinfo.tex % texinfo.tex -- TeX macros to handle Texinfo files.
%
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2013-02-01.11}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
%
% This texinfo.tex file 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 3 of the
% License, or (at your option) any later version.
%
% This texinfo.tex file 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, see .
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
% restriction. This Exception is an additional permission under section 7
% of the GNU General Public License, version 3 ("GPLv3").
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
%
% To process a Texinfo manual with TeX, it's most reliable to use the
% texi2dvi shell script that comes with the distribution. For a simple
% manual foo.texi, however, you can get away with this:
% tex foo.texi
% texindex foo.??
% tex foo.texi
% tex foo.texi
% dvips foo.dvi -o # or whatever; this makes foo.ps.
% The extra TeX runs get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
%
% It is possible to adapt texinfo.tex for other languages, to some
% extent. You can get the existing language-specific files from the
% full Texinfo distribution.
%
% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
\chardef\other=12
% We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign.
\let\+ = \relax
% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
\let\ptexcomma=\,
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
\let\ptexequiv=\equiv
\let\ptexexclam=\!
\let\ptexfootnote=\footnote
\let\ptexgtr=>
\let\ptexhat=^
\let\ptexi=\i
\let\ptexindent=\indent
\let\ptexinsert=\insert
\let\ptexlbrace=\{
\let\ptexless=<
\let\ptexnewwrite\newwrite
\let\ptexnoindent=\noindent
\let\ptexplus=+
\let\ptexraggedright=\raggedright
\let\ptexrbrace=\}
\let\ptexslash=\/
\let\ptexstar=\*
\let\ptext=\t
\let\ptextop=\top
{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J
% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
%
\ifx\inputlineno\thisisundefined
\let\linenumber = \empty % Pre-3.0.
\else
\def\linenumber{l.\the\inputlineno:\space}
\fi
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
\ifx\putworderror\undefined \gdef\putworderror{error}\fi
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
\ifx\putwordin\undefined \gdef\putwordin{in}\fi
\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
\ifx\putwordof\undefined \gdef\putwordof{of}\fi
\ifx\putwordon\undefined \gdef\putwordon{on}\fi
\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
%
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
%
\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
% Since the category of space is not known, we have to be careful.
\chardef\spacecat = 10
\def\spaceisspace{\catcode`\ =\spacecat}
% sometimes characters are active, so we need control sequences.
\chardef\ampChar = `\&
\chardef\colonChar = `\:
\chardef\commaChar = `\,
\chardef\dashChar = `\-
\chardef\dotChar = `\.
\chardef\exclamChar= `\!
\chardef\hashChar = `\#
\chardef\lquoteChar= `\`
\chardef\questChar = `\?
\chardef\rquoteChar= `\'
\chardef\semiChar = `\;
\chardef\slashChar = `\/
\chardef\underChar = `\_
% Ignore a token.
%
\def\gobble#1{}
% The following is used inside several \edef's.
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
% Hyphenation fixes.
\hyphenation{
Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
ap-pen-dix bit-map bit-maps
data-base data-bases eshell fall-ing half-way long-est man-u-script
man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
spell-ing spell-ings
stand-alone strong-est time-stamp time-stamps which-ever white-space
wide-spread wrap-around
}
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
\newdimen\normaloffset
\newdimen\pagewidth \newdimen\pageheight
% For a final copy, take out the rectangles
% that mark overfull boxes (in case you have decided
% that the text looks ok even though it passes the margin).
%
\def\finalout{\overfullrule=0pt }
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
% since that produces some useless output on the terminal. We also make
% some effort to order the tracing commands to reduce output in the log
% file; cf. trace.sty in LaTeX.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\loggingall{%
\tracingstats2
\tracingpages1
\tracinglostchars2 % 2 gives us more in etex
\tracingparagraphs1
\tracingoutput1
\tracingmacros2
\tracingrestores1
\showboxbreadth\maxdimen \showboxdepth\maxdimen
\ifx\eTeXversion\thisisundefined\else % etex gives us more logging
\tracingscantokens1
\tracingifs1
\tracinggroups1
\tracingnesting2
\tracingassigns1
\fi
\tracingcommands3 % 3 gives us more in etex
\errorcontextlines16
}%
% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
% aren't perfect, it's not the end of the world, being an error message,
% after all.
%
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
\def\doerrormsg#1{\errmessage{#1}}
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
%
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
\removelastskip\penalty-50\smallskip\fi\fi}
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
\removelastskip\penalty-100\medskip\fi\fi}
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
\removelastskip\penalty-200\bigskip\fi\fi}
% Do @cropmarks to get crop marks.
%
\newif\ifcropmarks
\let\cropmarks = \cropmarkstrue
%
% Dimensions to add cropmarks at corners.
% Added by P. A. MacKay, 12 Nov. 1986
%
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
\newdimen\cornerlong \cornerlong=1pc
\newdimen\cornerthick \cornerthick=.3pt
\newdimen\topandbottommargin \topandbottommargin=.75in
% Output a mark which sets \thischapter, \thissection and \thiscolor.
% We dump everything together because we only have one kind of mark.
% This works because we only use \botmark / \topmark, not \firstmark.
%
% A mark contains a subexpression of the \ifcase ... \fi construct.
% \get*marks macros below extract the needed part using \ifcase.
%
% Another complication is to let the user choose whether \thischapter
% (\thissection) refers to the chapter (section) in effect at the top
% of a page, or that at the bottom of a page. The solution is
% described on page 260 of The TeXbook. It involves outputting two
% marks for the sectioning macros, one before the section break, and
% one after. I won't pretend I can describe this better than DEK...
\def\domark{%
\toks0=\expandafter{\lastchapterdefs}%
\toks2=\expandafter{\lastsectiondefs}%
\toks4=\expandafter{\prevchapterdefs}%
\toks6=\expandafter{\prevsectiondefs}%
\toks8=\expandafter{\lastcolordefs}%
\mark{%
\the\toks0 \the\toks2
\noexpand\or \the\toks4 \the\toks6
\noexpand\else \the\toks8
}%
}
% \topmark doesn't work for the very first chapter (after the title
% page or the contents), so we use \firstmark there -- this gets us
% the mark with the chapter defs, unless the user sneaks in, e.g.,
% @setcolor (or @url, or @link, etc.) between @contents and the very
% first @chapter.
\def\gettopheadingmarks{%
\ifcase0\topmark\fi
\ifx\thischapter\empty \ifcase0\firstmark\fi \fi
}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
\def\getcolormarks{\ifcase2\topmark\fi}
% Avoid "undefined control sequence" errors.
\def\lastchapterdefs{}
\def\lastsectiondefs{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
\def\lastcolordefs{}
% Main output routine.
\chardef\PAGE = 255
\output = {\onepageout{\pagecontents\PAGE}}
\newbox\headlinebox
\newbox\footlinebox
% \onepageout takes a vbox as an argument. Note that \pagecontents
% does insertions, but you have to call it yourself.
\def\onepageout#1{%
\ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
%
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
%
% Do this outside of the \shipout so @code etc. will be expanded in
% the headline as they should be, not taken literally (outputting ''code).
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
\setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
\ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
\setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
%
{%
% Have to do this stuff outside the \shipout because we want it to
% take effect in \write's, yet the group defined by the \vbox ends
% before the \shipout runs.
%
\indexdummies % don't expand commands in the output.
\normalturnoffactive % \ in index entries must not stay \, e.g., if
% the page break happens to be in the middle of an example.
% We don't want .vr (or whatever) entries like this:
% \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
% "\acronym" won't work when it's read back in;
% it needs to be
% {\code {{\tt \backslashcurfont }acronym}
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
\ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
%
\ifcropmarks \vbox to \outervsize\bgroup
\hsize = \outerhsize
\vskip-\topandbottommargin
\vtop to0pt{%
\line{\ewtop\hfil\ewtop}%
\nointerlineskip
\line{%
\vbox{\moveleft\cornerthick\nstop}%
\hfill
\vbox{\moveright\cornerthick\nstop}%
}%
\vss}%
\vskip\topandbottommargin
\line\bgroup
\hfil % center the page within the outer (page) hsize.
\ifodd\pageno\hskip\bindingoffset\fi
\vbox\bgroup
\fi
%
\unvbox\headlinebox
\pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
% Only leave this space if the footline is nonempty.
% (We lessened \vsize for it in \oddfootingyyy.)
% The \baselineskip=24pt in plain's \makefootline has no effect.
\vskip 24pt
\unvbox\footlinebox
\fi
%
\ifcropmarks
\egroup % end of \vbox\bgroup
\hfil\egroup % end of (centering) \line\bgroup
\vskip\topandbottommargin plus1fill minus1fill
\boxmaxdepth = \cornerthick
\vbox to0pt{\vss
\line{%
\vbox{\moveleft\cornerthick\nsbot}%
\hfill
\vbox{\moveright\cornerthick\nsbot}%
}%
\nointerlineskip
\line{\ewbot\hfil\ewbot}%
}%
\egroup % \vbox from first cropmarks clause
\fi
}% end of \shipout\vbox
}% end of group with \indexdummies
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
\newinsert\margin \dimen\margin=\maxdimen
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
% marginal hacks, juha@viisa.uucp (Juha Takala)
\ifvoid\margin\else % marginal info is present
\rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
\dimen@=\dp#1\relax \unvbox#1\relax
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
% Here are the rules for the cropmarks. Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
%
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
\def\nstop{\vbox
{\hrule height\cornerthick depth\cornerlong width\cornerthick}}
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
\def\nsbot{\vbox
{\hrule height\cornerlong depth\cornerthick width\cornerthick}}
% Parse an argument, then pass it to #1. The argument is the rest of
% the input line (except we remove a trailing comment). #1 should be a
% macro which expects an ordinary undelimited TeX argument.
%
\def\parsearg{\parseargusing{}}
\def\parseargusing#1#2{%
\def\argtorun{#2}%
\begingroup
\obeylines
\spaceisspace
#1%
\parseargline\empty% Insert the \empty token, see \finishparsearg below.
}
{\obeylines %
\gdef\parseargline#1^^M{%
\endgroup % End of the group started in \parsearg.
\argremovecomment #1\comment\ArgTerm%
}%
}
% First remove any @comment, then any @c comment.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
% Each occurrence of `\^^M' or `\^^M' is replaced by a single space.
%
% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
% This space token undergoes the same procedure and is eventually removed
% by \finishparsearg.
%
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
\def\temp{#3}%
\ifx\temp\empty
% Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
\let\temp\finishparsearg
\else
\let\temp\argcheckspaces
\fi
% Put the space token in:
\temp#1 #3\ArgTerm
}
% If a _delimited_ argument is enclosed in braces, they get stripped; so
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \argtorun.
% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
%
% But first, we have to remove the trailing space token.
%
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
% \parseargdef\foo{...}
% is roughly equivalent to
% \def\foo{\parsearg\Xfoo}
% \def\Xfoo#1{...}
%
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
% favourite TeX trick. --kasal, 16nov03
\def\parseargdef#1{%
\expandafter \doparseargdef \csname\string#1\endcsname #1%
}
\def\doparseargdef#1#2{%
\def#2{\parsearg#1}%
\def#1##1%
}
% Several utility definitions with active space:
{
\obeyspaces
\gdef\obeyedspace{ }
% Make each space character in the input produce a normal interword
% space in the output. Don't allow a line break at this space, as this
% is used only in environments like @example, where each line of input
% should produce a line of output anyway.
%
\gdef\sepspaces{\obeyspaces\let =\tie}
% If an index command is used in an @example environment, any spaces
% therein should become regular spaces in the raw index file, not the
% expansion of \tie (\leavevmode \penalty \@M \ ).
\gdef\unsepspaces{\let =\space}
}
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
% Define the framework for environments in texinfo.tex. It's used like this:
%
% \envdef\foo{...}
% \def\Efoo{...}
%
% It's the responsibility of \envdef to insert \begingroup before the
% actual body; @end closes the group after calling \Efoo. \envdef also
% defines \thisenv, so the current environment is known; @end checks
% whether the environment name matches. The \checkenv macro can also be
% used to check whether the current environment is the one expected.
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
% are not treated as environments; they don't open a group. (The
% implementation of @end takes care not to call \endgroup in this
% special case.)
% At run-time, environments start with this:
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
% initialize
\let\thisenv\empty
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
% Check whether we're in the right environment:
\def\checkenv#1{%
\def\temp{#1}%
\ifx\thisenv\temp
\else
\badenverr
\fi
}
% Environment mismatch, #1 expected:
\def\badenverr{%
\errhelp = \EMsimple
\errmessage{This command can appear only \inenvironment\temp,
not \inenvironment\thisenv}%
}
\def\inenvironment#1{%
\ifx#1\empty
outside of any environment%
\else
in environment \expandafter\string#1%
\fi
}
% @end foo executes the definition of \Efoo.
% But first, it executes a specialized version of \checkenv
%
\parseargdef\end{%
\if 1\csname iscond.#1\endcsname
\else
% The general wording of \badenverr may not be ideal.
\expandafter\checkenv\csname#1\endcsname
\csname E#1\endcsname
\endgroup
\fi
}
\newhelp\EMsimple{Press RETURN to continue.}
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
% Avoid using \@M directly, because that causes trouble
% if the definition is written into an index file.
\global\let\tiepenalty = \@M
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
% @* forces a line break.
\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
% @/ allows a line break.
\let\/=\allowbreak
% @. is an end-of-sentence period.
\def\.{.\spacefactor=\endofsentencespacefactor\space}
% @! is an end-of-sentence bang.
\def\!{!\spacefactor=\endofsentencespacefactor\space}
% @? is an end-of-sentence query.
\def\?{?\spacefactor=\endofsentencespacefactor\space}
% @frenchspacing on|off says whether to put extra space after punctuation.
%
\def\onword{on}
\def\offword{off}
%
\parseargdef\frenchspacing{%
\def\temp{#1}%
\ifx\temp\onword \plainfrenchspacing
\else\ifx\temp\offword \plainnonfrenchspacing
\else
\errhelp = \EMsimple
\errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
\fi\fi
}
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
% produce a whole line of output instead of starting the paragraph.
\def\w#1{\leavevmode\hbox{#1}}
% @group ... @end group forces ... to be all on one page, by enclosing
% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
% to keep its height that of a normal line. According to the rules for
% \topskip (p.114 of the TeXbook), the glue inserted is
% max (\topskip - \ht (first item), 0). If that height is large,
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
% Another complication is that the group might be very large. This can
% cause the glue on the previous page to be unduly stretched, because it
% does not have much material. In this case, it's better to add an
% explicit \vfill so that the extra space is at the bottom. The
% threshold for doing this is if the group is more than \vfilllimit
% percent of a page (\vfilllimit can be changed inside of @tex).
%
\newbox\groupbox
\def\vfilllimit{0.7}
%
\envdef\group{%
\ifnum\catcode`\^^M=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
\startsavinginserts
%
\setbox\groupbox = \vtop\bgroup
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% The \vtop produces a box with normal height and large depth; thus, TeX puts
% \baselineskip glue before it, and (when the next line of text is done)
% \lineskip glue after it. Thus, space below is not quite equal to space
% above. But it's pretty close.
\def\Egroup{%
% To get correct interline space between the last line of the group
% and the first line afterwards, we have to propagate \prevdepth.
\endgraf % Not \par, as it may have been set to \lisppar.
\global\dimen1 = \prevdepth
\egroup % End the \vtop.
% \dimen0 is the vertical size of the group's box.
\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
% \dimen2 is how much space is left on the page (more or less).
\dimen2 = \pageheight \advance\dimen2 by -\pagetotal
% if the group doesn't fit on the current page, and it's a big big
% group, force a page break.
\ifdim \dimen0 > \dimen2
\ifdim \pagetotal < \vfilllimit\pageheight
\page
\fi
\fi
\box\groupbox
\prevdepth = \dimen1
\checkinserts
}
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
%
\newhelp\groupinvalidhelp{%
group can only be used in environments such as @example,^^J%
where each line of input produces a line of output.}
% @need space-in-mils
% forces a page break if there is not space-in-mils remaining.
\newdimen\mil \mil=0.001in
\parseargdef\need{%
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
% If the @need value is less than one line space, it's useless.
\dimen0 = #1\mil
\dimen2 = \ht\strutbox
\advance\dimen2 by \dp\strutbox
\ifdim\dimen0 > \dimen2
%
% Do a \strut just to make the height of this box be normal, so the
% normal leading is inserted relative to the preceding line.
% And a page break here is fine.
\vtop to #1\mil{\strut\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
\fi
}
% @br forces paragraph break (and is undocumented).
\let\br = \par
% @page forces the start of a new page.
%
\def\page{\par\vfill\supereject}
% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin
% This records the amount of indent in the innermost environment.
% That's how much \exdent should take out.
\newskip\exdentamount
% This defn is used inside fill environments such as @defun.
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
% This defn is used inside nofill environments such as @example.
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% paragraph. For more general purposes, use the \margin insertion
% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
%
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
%
\def\doinmargin#1#2{\strut\vadjust{%
\nobreak
\kern-\strutdepth
\vtop to \strutdepth{%
\baselineskip=\strutdepth
\vss
% if you have multiple lines of stuff to put here, you'll need to
% make the vbox yourself of the appropriate size.
\ifx#1l%
\llap{\ignorespaces #2\hskip\inmarginspacing}%
\else
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
\fi
\null
}%
}}
\def\inleftmargin{\doinmargin l}
\def\inrightmargin{\doinmargin r}
%
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\def\lefttext{#1}% have both texts
\def\righttext{#2}%
\else
\def\lefttext{#1}% have only one text
\def\righttext{#1}%
\fi
%
\ifodd\pageno
\def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
\else
\def\temp{\inleftmargin\lefttext}%
\fi
\temp
}
% @| inserts a changebar to the left of the current line. It should
% surround any changed text. This approach does *not* work if the
% change spans more than two lines of output. To handle that, we would
% have adopt a much more difficult approach (putting marks into the main
% vertical list for the beginning and end of each change). This command
% is not documented, not supported, and doesn't work.
%
\def\|{%
% \vadjust can only be used in horizontal mode.
\leavevmode
%
% Append this vertical mode material after the current line in the output.
\vadjust{%
% We want to insert a rule with the height and depth of the current
% leading; that is exactly what \strutbox is supposed to record.
\vskip-\baselineskip
%
% \vadjust-items are inserted at the left edge of the type. So
% the \llap here moves out into the left-hand margin.
\llap{%
%
% For a thicker or thinner bar, change the `1pt'.
\vrule height\baselineskip width1pt
%
% This is the space between the bar and the text.
\hskip 12pt
}%
}%
}
% @include FILE -- \input text of FILE.
%
\def\include{\parseargusing\filenamecatcodes\includezzz}
\def\includezzz#1{%
\pushthisfilestack
\def\thisfile{#1}%
{%
\makevalueexpandable % we want to expand any @value in FILE.
\turnoffactive % and allow special characters in the expansion
\indexnofonts % Allow `@@' and other weird things in file names.
\wlog{texinfo.tex: doing @include of #1^^J}%
\edef\temp{\noexpand\input #1 }%
%
% This trickery is to read FILE outside of a group, in case it makes
% definitions, etc.
\expandafter
}\temp
\popthisfilestack
}
\def\filenamecatcodes{%
\catcode`\\=\other
\catcode`~=\other
\catcode`^=\other
\catcode`_=\other
\catcode`|=\other
\catcode`<=\other
\catcode`>=\other
\catcode`+=\other
\catcode`-=\other
\catcode`\`=\other
\catcode`\'=\other
}
\def\pushthisfilestack{%
\expandafter\pushthisfilestackX\popthisfilestack\StackTerm
}
\def\pushthisfilestackX{%
\expandafter\pushthisfilestackY\thisfile\StackTerm
}
\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
\gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
}
\def\popthisfilestack{\errthisfilestackempty}
\def\errthisfilestackempty{\errmessage{Internal error:
the stack of filenames is empty.}}
%
\def\thisfile{}
% @center line
% outputs that line, centered.
%
\parseargdef\center{%
\ifhmode
\let\centersub\centerH
\else
\let\centersub\centerV
\fi
\centersub{\hfil \ignorespaces#1\unskip \hfil}%
\let\centersub\relax % don't let the definition persist, just in case
}
\def\centerH#1{{%
\hfil\break
\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\line{#1}%
\break
}}
%
\newcount\centerpenalty
\def\centerV#1{%
% The idea here is the same as in \startdefun, \cartouche, etc.: if
% @center is the first thing after a section heading, we need to wipe
% out the negative parskip inserted by \sectionheading, but still
% prevent a page break here.
\centerpenalty = \lastpenalty
\ifnum\centerpenalty>10000 \vskip\parskip \fi
\ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
\line{\kern\leftskip #1\kern\rightskip}%
}
% @sp n outputs n lines of vertical space
%
\parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
%
\def\comment{\begingroup \catcode`\^^M=\other%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\commentxxx}
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
%
\let\c=\comment
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
% NCHARS can also be the word `asis' or `none'.
% We cannot feasibly implement @paragraphindent asis, though.
%
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
%
\parseargdef\paragraphindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
\ifx\temp\noneword
\defaultparindent = 0pt
\else
\defaultparindent = #1em
\fi
\fi
\parindent = \defaultparindent
}
% @exampleindent NCHARS
% We'll use ems for NCHARS like @paragraphindent.
% It seems @exampleindent asis isn't necessary, but
% I preserve it to make it similar to @paragraphindent.
\parseargdef\exampleindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
\ifx\temp\noneword
\lispnarrowing = 0pt
\else
\lispnarrowing = #1em
\fi
\fi
}
% @firstparagraphindent WORD
% If WORD is `none', then suppress indentation of the first paragraph
% after a section heading. If WORD is `insert', then do indent at such
% paragraphs.
%
% The paragraph indentation is suppressed or not by calling
% \suppressfirstparagraphindent, which the sectioning commands do.
% We switch the definition of this back and forth according to WORD.
% By default, we suppress indentation.
%
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
\def\insertword{insert}
%
\parseargdef\firstparagraphindent{%
\def\temp{#1}%
\ifx\temp\noneword
\let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
\else\ifx\temp\insertword
\let\suppressfirstparagraphindent = \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @firstparagraphindent option `\temp'}%
\fi\fi
}
% Here is how we actually suppress indentation. Redefine \everypar to
% \kern backwards by \parindent, and then reset itself to empty.
%
% We also make \indent itself not actually do anything until the next
% paragraph.
%
\gdef\dosuppressfirstparagraphindent{%
\gdef\indent{%
\restorefirstparagraphindent
\indent
}%
\gdef\noindent{%
\restorefirstparagraphindent
\noindent
}%
\global\everypar = {%
\kern -\parindent
\restorefirstparagraphindent
}%
}
\gdef\restorefirstparagraphindent{%
\global \let \indent = \ptexindent
\global \let \noindent = \ptexnoindent
\global \everypar = {}%
}
% @refill is a no-op.
\let\refill=\relax
% If working on a large document in chapters, it is convenient to
% be able to disable indexing, cross-referencing, and contents, for test runs.
% This is done with @novalidate (before @setfilename).
%
\newif\iflinks \linkstrue % by default we want the aux files.
\let\novalidate = \linksfalse
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\iflinks
\tryauxfile
% Open the new aux file. TeX will close it automatically at exit.
\immediate\openout\auxfile=\jobname.aux
\fi % \openindices needs to do some work in any case.
\openindices
\let\setfilename=\comment % Ignore extra @setfilename cmds.
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc.
\openin 1 texinfo.cnf
\ifeof 1 \else \input texinfo.cnf \fi
\closein 1
%
\comment % Ignore the actual filename.
}
% Called from \setfilename.
%
\def\openindices{%
\newindex{cp}%
\newcodeindex{fn}%
\newcodeindex{vr}%
\newcodeindex{tp}%
\newcodeindex{ky}%
\newcodeindex{pg}%
}
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
\message{pdf,}
% adobe `portable' document format
\newcount\tempnum
\newcount\lnkcount
\newtoks\filename
\newcount\filenamelength
\newcount\pgn
\newtoks\toksA
\newtoks\toksB
\newtoks\toksC
\newtoks\toksD
\newbox\boxA
\newcount\countA
\newif\ifpdf
\newif\ifpdfmakepagedest
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
% can be set). So we test for \relax and 0 as well as being undefined.
\ifx\pdfoutput\thisisundefined
\else
\ifx\pdfoutput\relax
\else
\ifcase\pdfoutput
\else
\pdftrue
\fi
\fi
\fi
% PDF uses PostScript string constants for the names of xref targets,
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e. Not good.
%
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
% related messages. The final outcome is that it is up to the TeX user
% to double the backslashes and otherwise make the string valid, so
% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
% do this reliably, so we use it.
% #1 is a control sequence in which to do the replacements,
% which we \xdef.
\def\txiescapepdf#1{%
\ifx\pdfescapestring\thisisundefined
% No primitive available; should we give a warning or log?
% Many times it won't matter.
\else
% The expandable \pdfescapestring primitive escapes parentheses,
% backslashes, and other special chars.
\xdef#1{\pdfescapestring{#1}}%
\fi
}
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
with PDF output, and none of those formats could be found. (.eps cannot
be supported due to the design of the PDF format; use regular TeX (DVI
output) for that.)}
\ifpdf
%
% Color manipulation macros based on pdfcolor.tex,
% except using rgb instead of cmyk; the latter is said to render as a
% very dark gray on-screen and a very dark halftone in print, instead
% of actual black.
\def\rgbDarkRed{0.50 0.09 0.12}
\def\rgbBlack{0 0 0}
%
% k sets the color for filling (usual text, etc.);
% K sets the color for stroking (thin rules, e.g., normal _'s).
\def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
%
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\setcolor#1{%
\xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
}
%
\def\maincolor{\rgbBlack}
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
\def\lastcolordefs{}
%
\def\makefootline{%
\baselineskip24pt
\line{\pdfsetcolor{\maincolor}\the\footline}%
}
%
\def\makeheadline{%
\vbox to 0pt{%
\vskip-22.5pt
\line{%
\vbox to8.5pt{}%
% Extract \thiscolor definition from the marks.
\getcolormarks
% Typeset the headline with \maincolor, then restore the color.
\pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
}%
\vss
}%
\nointerlineskip
}
%
%
\pdfcatalog{/PageMode /UseOutlines}
%
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\dopdfimage#1#2#3{%
\def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
\def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
%
% pdftex (and the PDF format) support .pdf, .png, .jpg (among
% others). Let's try in that order, PDF first since if
% someone has a scalable image, presumably better to use that than a
% bitmap.
\let\pdfimgext=\empty
\begingroup
\openin 1 #1.pdf \ifeof 1
\openin 1 #1.PDF \ifeof 1
\openin 1 #1.png \ifeof 1
\openin 1 #1.jpg \ifeof 1
\openin 1 #1.jpeg \ifeof 1
\openin 1 #1.JPG \ifeof 1
\errhelp = \nopdfimagehelp
\errmessage{Could not find image file #1 for pdf}%
\else \gdef\pdfimgext{JPG}%
\fi
\else \gdef\pdfimgext{jpeg}%
\fi
\else \gdef\pdfimgext{jpg}%
\fi
\else \gdef\pdfimgext{png}%
\fi
\else \gdef\pdfimgext{PDF}%
\fi
\else \gdef\pdfimgext{pdf}%
\fi
\closein 1
\endgroup
%
% without \immediate, ancient pdftex seg faults when the same image is
% included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
\ifnum\pdftexversion < 14
\immediate\pdfimage
\else
\immediate\pdfximage
\fi
\ifdim \wd0 >0pt width \pdfimagewidth \fi
\ifdim \wd2 >0pt height \pdfimageheight \fi
\ifnum\pdftexversion<13
#1.\pdfimgext
\else
{#1.\pdfimgext}%
\fi
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
%
\def\pdfmkdest#1{{%
% We have to set dummies so commands such as @code, and characters
% such as \, aren't expanded when present in a section title.
\indexnofonts
\turnoffactive
\makevalueexpandable
\def\pdfdestname{#1}%
\txiescapepdf\pdfdestname
\safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}}
%
% used to mark target names; must be expandable.
\def\pdfmkpgn#1{#1}
%
% by default, use a color that is dark enough to print on paper as
% nearly black, but still distinguishable for online viewing.
\def\urlcolor{\rgbDarkRed}
\def\linkcolor{\rgbDarkRed}
\def\endlink{\setcolor{\maincolor}\pdfendlink}
%
% Adding outlines to PDF; macros for calculating structure of outlines
% come from Petr Olsak
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
\else \csname#1\endcsname \fi}
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax
\advance\tempnum by 1
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
%
% #1 is the section text, which is what will be displayed in the
% outline by the pdf viewer. #2 is the pdf expression for the number
% of subentries (or empty, for subsubsections). #3 is the node text,
% which might be empty if this toc entry had no corresponding node.
% #4 is the page number
%
\def\dopdfoutline#1#2#3#4{%
% Generate a link to the node text if that exists; else, use the
% page number. We could generate a destination for the section
% text in the case where a section has no node, but it doesn't
% seem worth the trouble, since most documents are normally structured.
\edef\pdfoutlinedest{#3}%
\ifx\pdfoutlinedest\empty
\def\pdfoutlinedest{#4}%
\else
\txiescapepdf\pdfoutlinedest
\fi
%
% Also escape PDF chars in the display string.
\edef\pdfoutlinetext{#1}%
\txiescapepdf\pdfoutlinetext
%
\pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
\begingroup
% Read toc silently, to get counts of subentries for \pdfoutline.
\def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
\def\thischapnum{##2}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
}%
\def\numsecentry##1##2##3##4{%
\advancenumber{chap\thischapnum}%
\def\thissecnum{##2}%
\def\thissubsecnum{0}%
}%
\def\numsubsecentry##1##2##3##4{%
\advancenumber{sec\thissecnum}%
\def\thissubsecnum{##2}%
}%
\def\numsubsubsecentry##1##2##3##4{%
\advancenumber{subsec\thissubsecnum}%
}%
\def\thischapnum{0}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
%
% use \def rather than \let here because we redefine \chapentry et
% al. a second time, below.
\def\appentry{\numchapentry}%
\def\appsecentry{\numsecentry}%
\def\appsubsecentry{\numsubsecentry}%
\def\appsubsubsecentry{\numsubsubsecentry}%
\def\unnchapentry{\numchapentry}%
\def\unnsecentry{\numsecentry}%
\def\unnsubsecentry{\numsubsecentry}%
\def\unnsubsubsecentry{\numsubsubsecentry}%
\readdatafile{toc}%
%
% Read toc second time, this time actually producing the outlines.
% The `-' means take the \expnumber as the absolute number of
% subentries, which we calculated on our first read of the .toc above.
%
% We use the node names as the destinations.
\def\numchapentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
\def\numsecentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
\def\numsubsecentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
\def\numsubsubsecentry##1##2##3##4{% count is always zero
\dopdfoutline{##1}{}{##3}{##4}}%
%
% PDF outlines are displayed using system fonts, instead of
% document fonts. Therefore we cannot use special characters,
% since the encoding is unknown. For example, the eogonek from
% Latin 2 (0xea) gets translated to a | character. Info from
% Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
%
% TODO this right, we have to translate 8-bit characters to
% their "best" equivalent, based on the @documentencoding. Too
% much work for too little return. Just use the ASCII equivalents
% we use for the index sort strings.
%
\indexnofonts
\setupdatafile
% We can have normal brace characters in the PDF outlines, unlike
% Texinfo index files. So set that up.
\def\{{\lbracecharliteral}%
\def\}{\rbracecharliteral}%
\catcode`\\=\active \otherbackslash
\input \tocreadfilename
\endgroup
}
{\catcode`[=1 \catcode`]=2
\catcode`{=\other \catcode`}=\other
\gdef\lbracecharliteral[{]%
\gdef\rbracecharliteral[}]%
]
%
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
\addtokens{\filename}{\PP}%
\advance\filenamelength by 1
\fi
\nextsp}
\def\getfilename#1{%
\filenamelength=0
% If we don't expand the argument now, \skipspaces will get
% snagged on things like "@value{foo}".
\edef\temp{#1}%
\expandafter\skipspaces\temp|\relax
}
\ifnum\pdftexversion < 14
\let \startlink \pdfannotlink
\else
\let \startlink \pdfstartlink
\fi
% make a live url in pdf output.
\def\pdfurl#1{%
\begingroup
% it seems we really need yet another set of dummies; have not
% tried to figure out what each command should do in the context
% of @url. for now, just make @/ a no-op, that's the only one
% people have actually reported a problem with.
%
\normalturnoffactive
\def\@{@}%
\let\/=\empty
\makevalueexpandable
% do we want to go so far as to use \indexnofonts instead of just
% special-casing \var here?
\def\var##1{##1}%
%
\leavevmode\setcolor{\urlcolor}%
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
\endgroup}
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
\def\maketoks{%
\expandafter\poptoks\the\toksA|ENDTOKS|\relax
\ifx\first0\adn0
\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
\else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
\else
\ifnum0=\countA\else\makelink\fi
\ifx\first.\let\next=\done\else
\let\next=\maketoks
\addtokens{\toksB}{\the\toksD}
\ifx\first,\addtokens{\toksB}{\space}\fi
\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\next}
\def\makelink{\addtokens{\toksB}%
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
\def\pdflink#1{%
\startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
\setcolor{\linkcolor}#1\endlink}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\else
% non-pdf mode
\let\pdfmkdest = \gobble
\let\pdfurl = \gobble
\let\endlink = \relax
\let\setcolor = \gobble
\let\pdfsetcolor = \gobble
\let\pdfmakeoutlines = \relax
\fi % \ifx\pdfoutput
\message{fonts,}
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
%
\def\setfontstyle#1{%
\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
\csname ten#1\endcsname % change the current font
}
% Select #1 fonts with the current style.
%
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
% Unfortunately, we have to override this for titles and the like, since
% in those cases "rm" is bold. Sigh.
\def\rmisbold{\rm\def\curfontstyle{bf}}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
\newfam\sffam
\def\sf{\fam=\sffam \setfontstyle{sf}}
\let\li = \sf % Sometimes we call it \li, not \sf.
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
% Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers
% used as factors; they just match (closely enough) what Knuth defined.
%
\def\lineskipfactor{.08333}
\def\strutheightpercent{.70833}
\def\strutdepthpercent {.29167}
%
% can get a sort of poor man's double spacing by redefining this.
\def\baselinefactor{1}
%
\newdimen\textleading
\def\setleading#1{%
\dimen0 = #1\relax
\normalbaselineskip = \baselinefactor\dimen0
\normallineskip = \lineskipfactor\normalbaselineskip
\normalbaselines
\setbox\strutbox =\hbox{%
\vrule width0pt height\strutheightpercent\baselineskip
depth \strutdepthpercent \baselineskip
}%
}
% PDF CMaps. See also LaTeX's t1.cmap.
%
% do nothing with this by default.
\expandafter\let\csname cmapOT1\endcsname\gobble
\expandafter\let\csname cmapOT1IT\endcsname\gobble
\expandafter\let\csname cmapOT1TT\endcsname\gobble
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
% (\pdffontattr was introduced many years ago, but people still run
% older pdftex's; it's easy to conditionalize, so we do.)
\ifpdf \ifx\pdffontattr\thisisundefined \else
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1-0)
%%Title: (TeX-OT1-0 TeX OT1 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1)
/Supplement 0
>> def
/CMapName /TeX-OT1-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
8 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<23> <26> <0023>
<28> <3B> <0028>
<3F> <5B> <003F>
<5D> <5E> <005D>
<61> <7A> <0061>
<7B> <7C> <2013>
endbfrange
40 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <00660066>
<0C> <00660069>
<0D> <0066006C>
<0E> <006600660069>
<0F> <00660066006C>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<21> <0021>
<22> <201D>
<27> <2019>
<3C> <00A1>
<3D> <003D>
<3E> <00BF>
<5C> <201C>
<5F> <02D9>
<60> <2018>
<7D> <02DD>
<7E> <007E>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
%
% \cmapOT1IT
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1IT-0)
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1IT)
/Supplement 0
>> def
/CMapName /TeX-OT1IT-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
8 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<25> <26> <0025>
<28> <3B> <0028>
<3F> <5B> <003F>
<5D> <5E> <005D>
<61> <7A> <0061>
<7B> <7C> <2013>
endbfrange
42 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <00660066>
<0C> <00660069>
<0D> <0066006C>
<0E> <006600660069>
<0F> <00660066006C>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<21> <0021>
<22> <201D>
<23> <0023>
<24> <00A3>
<27> <2019>
<3C> <00A1>
<3D> <003D>
<3E> <00BF>
<5C> <201C>
<5F> <02D9>
<60> <2018>
<7D> <02DD>
<7E> <007E>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1IT\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
%
% \cmapOT1TT
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1TT-0)
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1TT)
/Supplement 0
>> def
/CMapName /TeX-OT1TT-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
5 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<21> <26> <0021>
<28> <5F> <0028>
<61> <7E> <0061>
endbfrange
32 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <2191>
<0C> <2193>
<0D> <0027>
<0E> <00A1>
<0F> <00BF>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<20> <2423>
<27> <2019>
<60> <2018>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1TT\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
\fi\fi
% Set the font macro #1 to the font named \fontprefix#2.
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
% Example:
% #1 = \textrm
% #2 = \rmshape
% #3 = 10
% #4 = \mainmagstep
% #5 = OT1
%
\def\setfont#1#2#3#4#5{%
\font#1=\fontprefix#2#3 scaled #4
\csname cmap#5\endcsname#1%
}
% This is what gets called when #5 of \setfont is empty.
\let\cmap\gobble
%
% (end of cmaps)
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
% before you read in texinfo.tex.
\ifx\fontprefix\thisisundefined
\def\fontprefix{cm}
\fi
% Support font families that don't use the same naming scheme as CM.
\def\rmshape{r}
\def\rmbshape{bx} % where the normal face is bold
\def\bfshape{b}
\def\bxshape{bx}
\def\ttshape{tt}
\def\ttbshape{tt}
\def\ttslshape{sltt}
\def\itshape{ti}
\def\itbshape{bxti}
\def\slshape{sl}
\def\slbshape{bxsl}
\def\sfshape{ss}
\def\sfbshape{ss}
\def\scshape{csc}
\def\scbshape{csc}
% Definitions for a main text size of 11pt. (The default in Texinfo.)
%
\def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1).
\def\textnominalsize{11pt}
\edef\mainmagstep{\magstephalf}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1095}
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smallsy=cmsy9
\def\smallecsize{0900}
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\titleecsize{2074}
% Chapter (and unnumbered) fonts (17.28pt).
\def\chapnominalsize{17pt}
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
\setfont\chapsf\sfbshape{17}{1000}{OT1}
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
\font\chapi=cmmi12 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep3
\def\chapecsize{1728}
% Section fonts (14.4pt).
\def\secnominalsize{14pt}
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
\font\seci=cmmi12 scaled \magstep1
\font\secsy=cmsy10 scaled \magstep2
\def\sececsize{1440}
% Subsection fonts (13.15pt).
\def\ssecnominalsize{13pt}
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
\setfont\ssecsl\slbshape{10}{1315}{OT1}
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1315}{OT1}
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled 1315
\def\ssececsize{1200}
% Reduced fonts for @acro in text (10pt).
\def\reducednominalsize{10pt}
\setfont\reducedrm\rmshape{10}{1000}{OT1}
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{1000}{OT1}
\setfont\reducedit\itshape{10}{1000}{OT1IT}
\setfont\reducedsl\slshape{10}{1000}{OT1}
\setfont\reducedsf\sfshape{10}{1000}{OT1}
\setfont\reducedsc\scshape{10}{1000}{OT1}
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
\font\reducedi=cmmi10
\font\reducedsy=cmsy10
\def\reducedecsize{1000}
\textleading = 13.2pt % line spacing for 11pt CM
\textfonts % reset the current fonts
\rm
} % end of 11pt text font size definitions, \definetextfontsizexi
% Definitions to make the main text be 10pt Computer Modern, with
% section, chapter, etc., sizes following suit. This is for the GNU
% Press printing of the Emacs 22 manual. Maybe other manuals in the
% future. Used with @smallbook, which sets the leading to 12pt.
%
\def\definetextfontsizex{%
% Text fonts (10pt).
\def\textnominalsize{10pt}
\edef\mainmagstep{1000}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1000}
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smallsy=cmsy9
\def\smallecsize{0900}
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\titleecsize{2074}
% Chapter fonts (14.4pt).
\def\chapnominalsize{14pt}
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
\let\chapbf\chaprm
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
\font\chapi=cmmi12 scaled \magstep1
\font\chapsy=cmsy10 scaled \magstep2
\def\chapecsize{1440}
% Section fonts (12pt).
\def\secnominalsize{12pt}
\setfont\secrm\rmbshape{12}{1000}{OT1}
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
\setfont\secsf\sfbshape{12}{1000}{OT1}
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
\font\seci=cmmi12
\font\secsy=cmsy10 scaled \magstep1
\def\sececsize{1200}
% Subsection fonts (10pt).
\def\ssecnominalsize{10pt}
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
\setfont\ssecsl\slbshape{10}{1000}{OT1}
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1000}{OT1}
\font\sseci=cmmi10
\font\ssecsy=cmsy10
\def\ssececsize{1000}
% Reduced fonts for @acro in text (9pt).
\def\reducednominalsize{9pt}
\setfont\reducedrm\rmshape{9}{1000}{OT1}
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{900}{OT1}
\setfont\reducedit\itshape{9}{1000}{OT1IT}
\setfont\reducedsl\slshape{9}{1000}{OT1}
\setfont\reducedsf\sfshape{9}{1000}{OT1}
\setfont\reducedsc\scshape{10}{900}{OT1}
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
\font\reducedi=cmmi9
\font\reducedsy=cmsy9
\def\reducedecsize{0900}
\divide\parskip by 2 % reduce space between paragraphs
\textleading = 12pt % line spacing for 10pt CM
\textfonts % reset the current fonts
\rm
} % end of 10pt text font size definitions, \definetextfontsizex
% We provide the user-level command
% @fonttextsize 10
% (or 11) to redefine the text font size. pt is assumed.
%
\def\xiword{11}
\def\xword{10}
\def\xwordpt{10pt}
%
\parseargdef\fonttextsize{%
\def\textsizearg{#1}%
%\wlog{doing @fonttextsize \textsizearg}%
%
% Set \globaldefs so that documents can use this inside @tex, since
% makeinfo 4.8 does not support it, but we need it nonetheless.
%
\begingroup \globaldefs=1
\ifx\textsizearg\xword \definetextfontsizex
\else \ifx\textsizearg\xiword \definetextfontsizexi
\else
\errhelp=\EMsimple
\errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
\fi\fi
\endgroup
}
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. Since
% texinfo doesn't allow for producing subscripts and superscripts except
% in the main text, we don't bother to reset \scriptfont and
% \scriptscriptfont (which would also require loading a lot more fonts).
%
\def\resetmathfonts{%
\textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
\textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
\textfont\ttfam=\tentt \textfont\sffam=\tensf
}
% The font-changing commands redefine the meanings of \tenSTYLE, instead
% of just \STYLE. We do this because \STYLE needs to also set the
% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
% \tenSTYLE to set the current font.
%
% Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower). These relative commands are used in
% the LaTeX logo and acronyms.
%
% This all needs generalizing, badly.
%
\def\textfonts{%
\let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
\let\tenttsl=\textttsl
\def\curfontsize{text}%
\def\lsize{reduced}\def\lllsize{smaller}%
\resetmathfonts \setleading{\textleading}}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\def\curfontsize{title}%
\def\lsize{chap}\def\lllsize{subsec}%
\resetmathfonts \setleading{27pt}}
\def\titlefont#1{{\titlefonts\rmisbold #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
\let\tenttsl=\chapttsl
\def\curfontsize{chap}%
\def\lsize{sec}\def\lllsize{text}%
\resetmathfonts \setleading{19pt}}
\def\secfonts{%
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
\let\tenttsl=\secttsl
\def\curfontsize{sec}%
\def\lsize{subsec}\def\lllsize{reduced}%
\resetmathfonts \setleading{16pt}}
\def\subsecfonts{%
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
\let\tenttsl=\ssecttsl
\def\curfontsize{ssec}%
\def\lsize{text}\def\lllsize{small}%
\resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts
\def\reducedfonts{%
\let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
\let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
\let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
\let\tenttsl=\reducedttsl
\def\curfontsize{reduced}%
\def\lsize{small}\def\lllsize{smaller}%
\resetmathfonts \setleading{10.5pt}}
\def\smallfonts{%
\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
\let\tenttsl=\smallttsl
\def\curfontsize{small}%
\def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{10.5pt}}
\def\smallerfonts{%
\let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
\let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
\let\tenttsl=\smallerttsl
\def\curfontsize{smaller}%
\def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{9.5pt}}
% Fonts for short table of contents.
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
\setfont\shortcontsl\slshape{12}{1000}{OT1}
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
% Define these just so they can be easily changed for other fonts.
\def\angleleft{$\langle$}
\def\angleright{$\rangle$}
% Set the fonts to use with the @small... environments.
\let\smallexamplefonts = \smallfonts
% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
% can fit this many characters:
% 8.5x11=86 smallbook=72 a4=90 a5=69
% If we use \scriptfonts (8pt), then we can fit this many characters:
% 8.5x11=90+ smallbook=80 a4=90+ a5=77
% For me, subjectively, the few extra characters that fit aren't worth
% the additional smallness of 8pt. So I'm making the default 9pt.
%
% By the way, for comparison, here's what fits with @example (10pt):
% 8.5x11=71 smallbook=60 a4=75 a5=58
% --karl, 24jan03.
% Set up the default fonts, so we can use them for creating boxes.
%
\definetextfontsizexi
\message{markup,}
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
% shrink), and it is reasonable to expect all typewriter fonts to have
% this property, we can check that font parameter.
%
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
% define and register \INITMACRO to be called on markup style changes.
% \INITMACRO can check \currentmarkupstyle for the innermost
% style and the set of \ifmarkupSTYLE switches for all styles
% currently in effect.
\newif\ifmarkupvar
\newif\ifmarkupsamp
\newif\ifmarkupkey
%\newif\ifmarkupfile % @file == @samp.
%\newif\ifmarkupoption % @option == @samp.
\newif\ifmarkupcode
\newif\ifmarkupkbd
%\newif\ifmarkupenv % @env == @code.
%\newif\ifmarkupcommand % @command == @code.
\newif\ifmarkuptex % @tex (and part of @math, for now).
\newif\ifmarkupexample
\newif\ifmarkupverb
\newif\ifmarkupverbatim
\let\currentmarkupstyle\empty
\def\setupmarkupstyle#1{%
\csname markup#1true\endcsname
\def\currentmarkupstyle{#1}%
\markupstylesetup
}
\let\markupstylesetup\empty
\def\defmarkupstylesetup#1{%
\expandafter\def\expandafter\markupstylesetup
\expandafter{\markupstylesetup #1}%
\def#1%
}
% Markup style setup for left and right quotes.
\defmarkupstylesetup\markupsetuplq{%
\expandafter\let\expandafter \temp
\csname markupsetuplq\currentmarkupstyle\endcsname
\ifx\temp\relax \markupsetuplqdefault \else \temp \fi
}
\defmarkupstylesetup\markupsetuprq{%
\expandafter\let\expandafter \temp
\csname markupsetuprq\currentmarkupstyle\endcsname
\ifx\temp\relax \markupsetuprqdefault \else \temp \fi
}
{
\catcode`\'=\active
\catcode`\`=\active
\gdef\markupsetuplqdefault{\let`\lq}
\gdef\markupsetuprqdefault{\let'\rq}
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
\gdef\markupsetcodequoteright{\let'\codequoteright}
}
\let\markupsetuplqcode \markupsetcodequoteleft
\let\markupsetuprqcode \markupsetcodequoteright
%
\let\markupsetuplqexample \markupsetcodequoteleft
\let\markupsetuprqexample \markupsetcodequoteright
%
\let\markupsetuplqkbd \markupsetcodequoteleft
\let\markupsetuprqkbd \markupsetcodequoteright
%
\let\markupsetuplqsamp \markupsetcodequoteleft
\let\markupsetuprqsamp \markupsetcodequoteright
%
\let\markupsetuplqverb \markupsetcodequoteleft
\let\markupsetuprqverb \markupsetcodequoteright
%
\let\markupsetuplqverbatim \markupsetcodequoteleft
\let\markupsetuprqverbatim \markupsetcodequoteright
% Allow an option to not use regular directed right quote/apostrophe
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
% The undirected quote is ugly, so don't make it the default, but it
% works for pasting with more pdf viewers (at least evince), the
% lilypond developers report. xpdf does work with the regular 0x27.
%
\def\codequoteright{%
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
\expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
'%
\else \char'15 \fi
\else \char'15 \fi
}
%
% and a similar option for the left quote char vs. a grave accent.
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
% the code environments to do likewise.
%
\def\codequoteleft{%
\expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
\expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
% [Knuth] pp. 380,381,391
% \relax disables Spanish ligatures ?` and !` of \tt font.
\relax`%
\else \char'22 \fi
\else \char'22 \fi
}
% Commands to set the quote options.
%
\parseargdef\codequoteundirected{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxicodequoteundirected\endcsname
= t%
\else\ifx\temp\offword
\expandafter\let\csname SETtxicodequoteundirected\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
\fi\fi
}
%
\parseargdef\codequotebacktick{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxicodequotebacktick\endcsname
= t%
\else\ifx\temp\offword
\expandafter\let\csname SETtxicodequotebacktick\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
\fi\fi
}
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
\def\noligaturesquoteleft{\relax\lq}
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
% Font commands.
% #1 is the font command (\sl or \it), #2 is the text to slant.
% If we are in a monospaced environment, however, 1) always use \ttsl,
% and 2) do not add an italic correction.
\def\dosmartslant#1#2{%
\ifusingtt
{{\ttsl #2}\let\next=\relax}%
{\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
\next
}
\def\smartslanted{\dosmartslant\sl}
\def\smartitalic{\dosmartslant\it}
% Output an italic correction unless \next (presumed to be the following
% character) is such as not to need one.
\def\smartitaliccorrection{%
\ifx\next,%
\else\ifx\next-%
\else\ifx\next.%
\else\ptexslash
\fi\fi\fi
\aftersmartic
}
% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
\def\ttslanted#1{{\ttsl #1}}
% @cite is like \smartslanted except unconditionally use \sl. We never want
% ttsl for book titles, do we?
\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
\def\aftersmartic{}
\def\var#1{%
\let\saveaftersmartic = \aftersmartic
\def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
\smartslanted{#1}%
}
\let\i=\smartitalic
\let\slanted=\smartslanted
\let\dfn=\smartslanted
\let\emph=\smartitalic
% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
% @b, explicit bold. Also @strong.
\def\b#1{{\bf #1}}
\let\strong=\b
% @sansserif, explicit sans.
\def\sansserif#1{{\sf #1}}
% We can't just use \exhyphenpenalty, because that only has effect at
% the end of a paragraph. Restore normal hyphenation at the end of the
% group within which \nohyphenation is presumably called.
%
\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- }
% Set sfcode to normal for the chars that usually have another value.
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% sometimes \x has an active definition that messes things up.
%
\catcode`@=11
\def\plainfrenchspacing{%
\sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
\sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
\def\endofsentencespacefactor{1000}% for @. and friends
}
\def\plainnonfrenchspacing{%
\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
\sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
\def\endofsentencespacefactor{3000}% for @. and friends
}
\catcode`@=\other
\def\endofsentencespacefactor{3000}% default
% @t, explicit typewriter.
\def\t#1{%
{\tt \rawbackslash \plainfrenchspacing #1}%
\null
}
% @samp.
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
% @indicateurl is \samp, that is, with quotes.
\let\indicateurl=\samp
% @code (and similar) prints in typewriter, but with spaces the same
% size as normal in the surrounding text, without hyphenation, etc.
% This is a subroutine for that.
\def\tclose#1{%
{%
% Change normal interword space to be same as for the current font.
\spaceskip = \fontdimen2\font
%
% Switch to typewriter.
\tt
%
% But `\ ' produces the large typewriter interword space.
\def\ {{\spaceskip = 0pt{} }}%
%
% Turn off hyphenation.
\nohyphenation
%
\rawbackslash
\plainfrenchspacing
#1%
}%
\null % reset spacefactor to 1000
}
% We *must* turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
%
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
% both hyphenation at - and hyphenation within words.
% We must therefore turn them both off (\tclose does that)
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
\catcode`\-=\active \catcode`\_=\active
\catcode`\'=\active \catcode`\`=\active
\global\let'=\rq \global\let`=\lq % default definitions
%
\global\def\code{\begingroup
\setupmarkupstyle{code}%
% The following should really be moved into \setupmarkupstyle handlers.
\catcode\dashChar=\active \catcode\underChar=\active
\ifallowcodebreaks
\let-\codedash
\let_\codeunder
\else
\let-\normaldash
\let_\realunder
\fi
\codex
}
}
\def\codex #1{\tclose{#1}\endgroup}
\def\normaldash{-}
\def\codedash{-\discretionary{}{}{}}
\def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _
% is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
% will therefore expand the active definition of _, which is us
% (inside @code that is), therefore an endless loop.
\ifusingtt{\ifmmode
\mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
\else\normalunderscore \fi
\discretionary{}{}{}}%
{\_}%
}
% An additional complication: the above will allow breaks after, e.g.,
% each of the four underscores in __typeof__. This is bad.
% @allowcodebreaks provides a document-level way to turn breaking at -
% and _ on and off.
%
\newif\ifallowcodebreaks \allowcodebreakstrue
\def\keywordtrue{true}
\def\keywordfalse{false}
\parseargdef\allowcodebreaks{%
\def\txiarg{#1}%
\ifx\txiarg\keywordtrue
\allowcodebreakstrue
\else\ifx\txiarg\keywordfalse
\allowcodebreaksfalse
\else
\errhelp = \EMsimple
\errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
\fi\fi
}
% For @command, @env, @file, @option quotes seem unnecessary,
% so use \code rather than \samp.
\let\command=\code
\let\env=\code
\let\file=\code
\let\option=\code
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
% second argument specifying the text to display and an optional third
% arg as text to display instead of (rather than in addition to) the url
% itself. First (mandatory) arg is the url.
% (This \urefnobreak definition isn't used now, leaving it for a while
% for comparison.)
\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
\unsepspaces
\pdfurl{#1}%
\setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt
\unhbox0 % third arg given, show only that
\else
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\ifpdf
\unhbox0 % PDF: 2nd arg given, show only it
\else
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
\fi
\else
\code{#1}% only url given, so show it
\fi
\fi
\endlink
\endgroup}
% This \urefbreak definition is the active one.
\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
\let\uref=\urefbreak
\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
\unsepspaces
\pdfurl{#1}%
\setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt
\unhbox0 % third arg given, show only that
\else
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\ifpdf
\unhbox0 % PDF: 2nd arg given, show only it
\else
\unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
\fi
\else
\urefcode{#1}% only url given, so show it
\fi
\fi
\endlink
\endgroup}
% Allow line breaks around only a few characters (only).
\def\urefcatcodes{%
\catcode\ampChar=\active \catcode\dotChar=\active
\catcode\hashChar=\active \catcode\questChar=\active
\catcode\slashChar=\active
}
{
\urefcatcodes
%
\global\def\urefcode{\begingroup
\setupmarkupstyle{code}%
\urefcatcodes
\let&\urefcodeamp
\let.\urefcodedot
\let#\urefcodehash
\let?\urefcodequest
\let/\urefcodeslash
\codex
}
%
% By default, they are just regular characters.
\global\def&{\normalamp}
\global\def.{\normaldot}
\global\def#{\normalhash}
\global\def?{\normalquest}
\global\def/{\normalslash}
}
% we put a little stretch before and after the breakable chars, to help
% line breaking of long url's. The unequal skips make look better in
% cmtt at least, especially for dots.
\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
%
\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
\def\urefcodedot{\urefprestretch .\urefpoststretch}
\def\urefcodehash{\urefprestretch \#\urefpoststretch}
\def\urefcodequest{\urefprestretch ?\urefpoststretch}
\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
{
\catcode`\/=\active
\global\def\urefcodeslashfinish{%
\urefprestretch \slashChar
% Allow line break only after the final / in a sequence of
% slashes, to avoid line break between the slashes in http://.
\ifx\next/\else \urefpoststretch \fi
}
}
% One more complication: by default we'll break after the special
% characters, but some people like to break before the special chars, so
% allow that. Also allow no breaking at all, for manual control.
%
\parseargdef\urefbreakstyle{%
\def\txiarg{#1}%
\ifx\txiarg\wordnone
\def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordbefore
\def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordafter
\def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
\else
\errhelp = \EMsimple
\errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
\fi\fi\fi
}
\def\wordafter{after}
\def\wordbefore{before}
\def\wordnone{none}
\urefbreakstyle after
% @url synonym for @uref, since that's how everyone uses it.
%
\let\url=\uref
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
%
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdf
\def\email#1{\doemail#1,,\finish}
\def\doemail#1,#2,#3\finish{\begingroup
\unsepspaces
\pdfurl{mailto:#1}%
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
\endlink
\endgroup}
\else
\let\email=\uref
\fi
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always).
\parseargdef\kbdinputstyle{%
\def\txiarg{#1}%
\ifx\txiarg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
\else\ifx\txiarg\wordexample
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\txiarg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\else
\errhelp = \EMsimple
\errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
% Default is `distinct'.
\kbdinputstyle distinct
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
\def\xkey{\key}
\def\kbdsub#1#2#3\par{%
\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
}
% definition of @key that produces a lozenge. Doesn't adjust to text size.
%\setfont\keyrm\rmshape{8}{1000}{OT1}
%\font\keysy=cmsy9
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
% \vbox{\hrule\kern-0.4pt
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
% \kern-0.4pt\hrule}%
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% definition of @key with no lozenge. If the current font is already
% monospace, don't change it; that way, we respect @kbdinputstyle. But
% if it isn't monospace, then use \tt.
%
\def\key#1{{\setupmarkupstyle{key}%
\nohyphenation
\ifmonospace\else\tt\fi
#1}\null}
% @clicksequence{File @click{} Open ...}
\def\clicksequence#1{\begingroup #1\endgroup}
% @clickstyle @arrow (by default)
\parseargdef\clickstyle{\def\click{#1}}
\def\click{\arrow}
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
% @l was never documented to mean ``switch to the Lisp font'',
% and it is not used as such in any manual I can find. We need it for
% Polish suppressed-l. --karl, 22sep96.
%\def\l#1{{\li #1}\null}
% @acronym for "FBI", "NATO", and the like.
% We print this one point size smaller, since it's intended for
% all-uppercase.
%
\def\acronym#1{\doacronym #1,,\finish}
\def\doacronym#1,#2,#3\finish{%
{\selectfonts\lsize #1}%
\def\temp{#2}%
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
\null % reset \spacefactor=1000
}
% @abbr for "Comput. J." and the like.
% No font change, but don't do end-of-sentence spacing.
%
\def\abbr#1{\doabbr #1,,\finish}
\def\doabbr#1,#2,#3\finish{%
{\plainfrenchspacing #1}%
\def\temp{#2}%
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
\null % reset \spacefactor=1000
}
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
% @math outputs its argument in math mode.
%
% One complication: _ usually means subscripts, but it could also mean
% an actual _ character, as in @math{@var{some_variable} + 1}. So make
% _ active, and distinguish by seeing if the current family is \slfam,
% which is what @var uses.
{
\catcode`\_ = \active
\gdef\mathunderscore{%
\catcode`\_=\active
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
}
}
% Another complication: we want \\ (and @\) to output a math (or tt) \.
% FYI, plain.tex uses \\ as a temporary control sequence (for no
% particular reason), but this is not advertised and we don't care.
%
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
%
\def\math{%
\tex
\mathunderscore
\let\\ = \mathbackslash
\mathactive
% make the texinfo accent commands work in math mode
\let\"=\ddot
\let\'=\acute
\let\==\bar
\let\^=\hat
\let\`=\grave
\let\u=\breve
\let\v=\check
\let\~=\tilde
\let\dotaccent=\dot
$\finishmath
}
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
% Some active characters (such as <) are spaced differently in math.
% We have to reset their definitions in case the @math was an argument
% to a command which sets the catcodes (such as @item or @section).
%
{
\catcode`^ = \active
\catcode`< = \active
\catcode`> = \active
\catcode`+ = \active
\catcode`' = \active
\gdef\mathactive{%
\let^ = \ptexhat
\let< = \ptexless
\let> = \ptexgtr
\let+ = \ptexplus
\let' = \ptexquoteright
}
}
% ctrl is no longer a Texinfo command, but leave this definition for fun.
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about.
%
\def\outfmtnametex{tex}
%
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
\long\def\doinlinefmt#1,#2,\finish{%
\def\inlinefmtname{#1}%
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
}
% For raw, must switch into @tex before parsing the argument, to avoid
% setting catcodes prematurely. Doing it this way means that, for
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
% ignored. But this isn't important because if people want a literal
% *right* brace they would have to use a command anyway, so they may as
% well use a command to get a left brace too. We could re-use the
% delimiter character idea from \verb, but it seems like overkill.
%
\long\def\inlineraw{\tex \doinlineraw}
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
\def\doinlinerawtwo#1,#2,\finish{%
\def\inlinerawname{#1}%
\ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
\endgroup % close group opened by \tex.
}
\message{glyphs,}
% and logos.
% @@ prints an @, as does @atchar{}.
\def\@{\char64 }
\let\atchar=\@
% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
% Unless we're in typewriter, use \ecfont because the CM text fonts do
% not have braces, and we don't want to switch into math.
\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
\let\{=\mylbrace \let\lbracechar=\{
\let\}=\myrbrace \let\rbracechar=\}
\begingroup
% Definitions to produce \{ and \} commands for indices,
% and @{ and @} for the aux/toc files.
\catcode`\{ = \other \catcode`\} = \other
\catcode`\[ = 1 \catcode`\] = 2
\catcode`\! = 0 \catcode`\\ = \other
!gdef!lbracecmd[\{]%
!gdef!rbracecmd[\}]%
!gdef!lbraceatcmd[@{]%
!gdef!rbraceatcmd[@}]%
!endgroup
% @comma{} to avoid , parsing problems.
\let\comma = ,
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \ptexc
\let\dotaccent = \ptexdot
\def\ringaccent#1{{\accent23 #1}}
\let\tieaccent = \ptext
\let\ubaraccent = \ptexb
\let\udotaccent = \d
% Other special characters: @questiondown @exclamdown @ordf @ordm
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
% Dotless i and dotless j, used for accents.
\def\imacro{i}
\def\jmacro{j}
\def\dotless#1{%
\def\temp{#1}%
\ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
\else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
\else \errmessage{@dotless can be used only with i or j}%
\fi\fi
}
% The \TeX{} logo, as in plain, but resetting the spacing so that a
% period following counts as ending a sentence. (Idea found in latex.)
%
\edef\TeX{\TeX \spacefactor=1000 }
% @LaTeX{} logo. Not quite the same results as the definition in
% latex.ltx, since we use a different font for the raised A; it's most
% convenient for us to use an explicitly smaller font, rather than using
% the \scriptstyle font (since we don't reset \scriptstyle and
% \scriptscriptstyle).
%
\def\LaTeX{%
L\kern-.36em
{\setbox0=\hbox{T}%
\vbox to \ht0{\hbox{%
\ifx\textnominalsize\xwordpt
% for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
% Revert to plain's \scriptsize, which is 7pt.
\count255=\the\fam $\fam\count255 \scriptstyle A$%
\else
% For 11pt, we can use our lllsize.
\selectfonts\lllsize A%
\fi
}%
\vss
}}%
\kern-.15em
\TeX
}
% Some math mode symbols.
\def\bullet{$\ptexbullet$}
\def\geq{\ifmmode \ge\else $\ge$\fi}
\def\leq{\ifmmode \le\else $\le$\fi}
\def\minus{\ifmmode -\else $-$\fi}
% @dots{} outputs an ellipsis using the current font.
% We do .5em per period so that it has the same spacing in the cm
% typewriter fonts as three actual period characters; on the other hand,
% in other typewriter fonts three periods are wider than 1.5em. So do
% whichever is larger.
%
\def\dots{%
\leavevmode
\setbox0=\hbox{...}% get width of three periods
\ifdim\wd0 > 1.5em
\dimen0 = \wd0
\else
\dimen0 = 1.5em
\fi
\hbox to \dimen0{%
\hskip 0pt plus.25fil
.\hskip 0pt plus1fil
.\hskip 0pt plus1fil
.\hskip 0pt plus.5fil
}%
}
% @enddots{} is an end-of-sentence ellipsis.
%
\def\enddots{%
\dots
\spacefactor=\endofsentencespacefactor
}
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
%
% Since these characters are used in examples, they should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
%
\def\point{$\star$}
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
% The @error{} command.
% Adapted from the TeXbook's \boxit.
%
\newbox\errorbox
%
{\tentt \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
%
\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
\advance\hsize by -2\dimen2 % Rules.
\vbox{%
\hrule height\dimen2
\hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
\vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
\kern3pt\vrule width\dimen2}% Space to right.
\hrule height\dimen2}
\hfil}
%
\def\error{\leavevmode\lower.7ex\copy\errorbox}
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
%
\def\pounds{{\it\$}}
% @euro{} comes from a separate font, depending on the current style.
% We use the free feym* fonts from the eurosym package by Henrik
% Theiling, which support regular, slanted, bold and bold slanted (and
% "outlined" (blackboard board, sort of) versions, which we don't need).
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
%
% Although only regular is the truly official Euro symbol, we ignore
% that. The Euro is designed to be slightly taller than the regular
% font height.
%
% feymr - regular
% feymo - slanted
% feybr - bold
% feybo - bold slanted
%
% There is no good (free) typewriter version, to my knowledge.
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
% Hmm.
%
% Also doesn't work in math. Do we need to do math with euro symbols?
% Hope not.
%
%
\def\euro{{\eurofont e}}
\def\eurofont{%
% We set the font at each command, rather than predefining it in
% \textfonts and the other font-switching commands, so that
% installations which never need the symbol don't have to have the
% font installed.
%
% There is only one designed size (nominal 10pt), so we always scale
% that to the current nominal size.
%
% By the way, simply using "at 1em" works for cmr10 and the like, but
% does not work for cmbx10 and other extended/shrunken fonts.
%
\def\eurosize{\csname\curfontsize nominalsize\endcsname}%
%
\ifx\curfontstyle\bfstylename
% bold:
\font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
\else
% regular:
\font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
\fi
\thiseurofont
}
% Glyphs from the EC fonts. We don't use \let for the aliases, because
% sometimes we redefine the original macro, and the alias should reflect
% the redefinition.
%
% Use LaTeX names for the Icelandic letters.
\def\DH{{\ecfont \char"D0}} % Eth
\def\dh{{\ecfont \char"F0}} % eth
\def\TH{{\ecfont \char"DE}} % Thorn
\def\th{{\ecfont \char"FE}} % thorn
%
\def\guillemetleft{{\ecfont \char"13}}
\def\guillemotleft{\guillemetleft}
\def\guillemetright{{\ecfont \char"14}}
\def\guillemotright{\guillemetright}
\def\guilsinglleft{{\ecfont \char"0E}}
\def\guilsinglright{{\ecfont \char"0F}}
\def\quotedblbase{{\ecfont \char"12}}
\def\quotesinglbase{{\ecfont \char"0D}}
%
% This positioning is not perfect (see the ogonek LaTeX package), but
% we have the precomposed glyphs for the most common cases. We put the
% tests to use those glyphs in the single \ogonek macro so we have fewer
% dummy definitions to worry about for index entries, etc.
%
% ogonek is also used with other letters in Lithuanian (IOU), but using
% the precomposed glyphs for those is not so easy since they aren't in
% the same EC font.
\def\ogonek#1{{%
\def\temp{#1}%
\ifx\temp\macrocharA\Aogonek
\else\ifx\temp\macrochara\aogonek
\else\ifx\temp\macrocharE\Eogonek
\else\ifx\temp\macrochare\eogonek
\else
\ecfont \setbox0=\hbox{#1}%
\ifdim\ht0=1ex\accent"0C #1%
\else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
\fi
\fi\fi\fi\fi
}%
}
\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
%
% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
\def\ecfont{%
% We can't distinguish serif/sans and italic/slanted, but this
% is used for crude hacks anyway (like adding French and German
% quotes to documents typeset with CM, where we lose kerning), so
% hopefully nobody will notice/care.
\edef\ecsize{\csname\curfontsize ecsize\endcsname}%
\edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
\ifmonospace
% typewriter:
\font\thisecfont = ectt\ecsize \space at \nominalsize
\else
\ifx\curfontstyle\bfstylename
% bold:
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
\else
% regular:
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
\fi
\fi
\thisecfont
}
% @registeredsymbol - R in a circle. The font for the R should really
% be smaller yet, but lllsize is the best we can do for now.
% Adapted from the plain.tex definition of \copyright.
%
\def\registeredsymbol{%
$^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
\hfil\crcr\Orb}}%
}$%
}
% @textdegree - the normal degrees sign.
%
\def\textdegree{$^\circ$}
% Laurent Siebenmann reports \Orb undefined with:
% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
% so we'll define it if necessary.
%
\ifx\Orb\thisisundefined
\def\Orb{\mathhexbox20D}
\fi
% Quotes.
\chardef\quotedblleft="5C
\chardef\quotedblright=`\"
\chardef\quoteleft=`\`
\chardef\quoteright=`\'
\message{page headings,}
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage.
\newif\ifseenauthor
\newif\iffinishedtitlepage
% Do an implicit @contents or @shortcontents after @end titlepage if the
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
%
\newif\ifsetcontentsaftertitlepage
\let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
\newif\ifsetshortcontentsaftertitlepage
\let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
\parseargdef\shorttitlepage{%
\begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\envdef\titlepage{%
% Open one extra group, as we want to close it in the middle of \Etitlepage.
\begingroup
\parindent=0pt \textfonts
% Leave some space at the very top of the page.
\vglue\titlepagetopglue
% No rule at page bottom unless we print one at the top with @title.
\finishedtitlepagetrue
%
% Most title ``pages'' are actually two pages long, with space
% at the top of the second. We don't want the ragged left on the second.
\let\oldpage = \page
\def\page{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
\let\page = \oldpage
\page
\null
}%
}
\def\Etitlepage{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
% It is important to do the page break before ending the group,
% because the headline and footline are only empty inside the group.
% If we use the new definition of \page, we always get a blank page
% after the title page, which we certainly don't want.
\oldpage
\endgroup
%
% Need this before the \...aftertitlepage checks so that if they are
% in effect the toc pages will come out with page numbers.
\HEADINGSon
%
% If they want short, they certainly want long too.
\ifsetshortcontentsaftertitlepage
\shortcontents
\contents
\global\let\shortcontents = \relax
\global\let\contents = \relax
\fi
%
\ifsetcontentsaftertitlepage
\contents
\global\let\contents = \relax
\global\let\shortcontents = \relax
\fi
}
\def\finishtitlepage{%
\vskip4pt \hrule height 2pt width \hsize
\vskip\titlepagebottomglue
\finishedtitlepagetrue
}
% Settings used for typesetting titles: no hyphenation, no indentation,
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. Because
% it is always used for titles, nothing else, we call \rmisbold. \par
% should be specified before the end of the \vbox, since a vbox is a group.
%
\def\raggedtitlesettings{%
\rmisbold
\hyphenpenalty=10000
\parindent=0pt
\tolerance=5000
\ptexraggedright
}
% Macros to be used within @titlepage:
\let\subtitlerm=\tenrm
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\parseargdef\title{%
\checkenv\titlepage
\vbox{\titlefonts \raggedtitlesettings #1\par}%
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt
}
\parseargdef\subtitle{%
\checkenv\titlepage
{\subtitlefont \rightline{#1}}%
}
% @author should come last, but may come many times.
% It can also be used inside @quotation.
%
\parseargdef\author{%
\def\temp{\quotation}%
\ifx\thisenv\temp
\def\quotationauthor{#1}% printed in \Equotation.
\else
\checkenv\titlepage
\ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
{\secfonts\rmisbold \leftline{#1}}%
\fi
}
% Set up page headings and footings.
\let\thispage=\folio
\newtoks\evenheadline % headline on even pages
\newtoks\oddheadline % headline on odd pages
\newtoks\evenfootline % footline on even pages
\newtoks\oddfootline % footline on odd pages
% Now make TeX use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
\else \the\evenheadline \fi}}
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
\else \the\evenfootline \fi}\HEADINGShook}
\let\HEADINGShook=\relax
% Commands to set those variables.
% For example, this is what @headings on does
% @evenheading @thistitle|@thispage|@thischapter
% @oddheading @thischapter|@thispage|@thistitle
% @evenfooting @thisfile||
% @oddfooting ||@thisfile
\def\evenheading{\parsearg\evenheadingxxx}
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\def\oddheading{\parsearg\oddheadingxxx}
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\def\evenfooting{\parsearg\evenfootingxxx}
\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\def\oddfooting{\parsearg\oddfootingxxx}
\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
\global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
\global\advance\pageheight by -12pt
\global\advance\vsize by -12pt
}
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
% @evenheadingmarks top \thischapter <- chapter at the top of a page
% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
%
% The same set of arguments for:
%
% @oddheadingmarks
% @evenfootingmarks
% @oddfootingmarks
% @everyheadingmarks
% @everyfootingmarks
\def\evenheadingmarks{\headingmarks{even}{heading}}
\def\oddheadingmarks{\headingmarks{odd}{heading}}
\def\evenfootingmarks{\headingmarks{even}{footing}}
\def\oddfootingmarks{\headingmarks{odd}{footing}}
\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
\headingmarks{odd}{heading}{#1} }
\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
\headingmarks{odd}{footing}{#1} }
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
\def\headingmarks#1#2#3 {%
\expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
\global\expandafter\let\csname get#1#2marks\endcsname \temp
}
\everyheadingmarks bottom
\everyfootingmarks bottom
% @headings double turns headings on for double-sided printing.
% @headings single turns headings on for single-sided printing.
% @headings off turns them off.
% @headings on same as @headings double, retained for compatibility.
% @headings after turns on double-sided headings after this page.
% @headings doubleafter turns on double-sided headings after this page.
% @headings singleafter turns on single-sided headings after this page.
% By default, they are off at the start of a document,
% and turned `on' after @end titlepage.
\def\headings #1 {\csname HEADINGS#1\endcsname}
\def\headingsoff{% non-global headings elimination
\evenheadline={\hfil}\evenfootline={\hfil}%
\oddheadline={\hfil}\oddfootline={\hfil}%
}
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
\HEADINGSoff % it's the default
% When we turn headings on, set the page number to 1.
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
\def\HEADINGSdouble{%
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
}
\let\contentsalignmacro = \chappager
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
\def\HEADINGSsingle{%
\global\pageno=1
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chappager
}
\def\HEADINGSon{\HEADINGSdouble}
\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
\let\HEADINGSdoubleafter=\HEADINGSafter
\def\HEADINGSdoublex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
}
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
\def\HEADINGSsinglex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chappager
}
% Subroutines used in generating headings
% This produces Day Month Year style of output.
% Only define if not already defined, in case a txi-??.tex file has set
% up a different format (e.g., txi-cs.tex does this).
\ifx\today\thisisundefined
\def\today{%
\number\day\space
\ifcase\month
\or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
\or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
\or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
\fi
\space\number\year}
\fi
% @settitle line... specifies the title of the document, for headings.
% It generates no output of its own.
\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg{\gdef\thistitle}}
\message{tables,}
% Tables -- @table, @ftable, @vtable, @item(x).
% default indentation of table text
\newdimen\tableindent \tableindent=.8in
% default indentation of @itemize and @enumerate text
\newdimen\itemindent \itemindent=.3in
% margin between end of table item and start of table text.
\newdimen\itemmargin \itemmargin=.1in
% used internally for \itemindent minus \itemmargin
\newdimen\itemmax
% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
% these defs.
% They also define \itemindex
% to index the item name in whatever manner is desired (perhaps none).
\newif\ifitemxneedsnegativevskip
\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
\def\itemzzz #1{\begingroup %
\advance\hsize by -\rightskip
\advance\hsize by -\tableindent
\setbox0=\hbox{\itemindicate{#1}}%
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
% command is, e.g., @kindex, the whatsit would get put into the
% horizontal list on a line by itself, resulting in extra blank space.
\ifdim \wd0>\itemmax
%
% Make this a paragraph so we get the \parskip glue and wrapping,
% but leave it ragged-right.
\begingroup
\advance\leftskip by-\tableindent
\advance\hsize by\tableindent
\advance\rightskip by0pt plus1fil\relax
\leavevmode\unhbox0\par
\endgroup
%
% We're going to be starting a paragraph, but we don't want the
% \parskip glue -- logically it's part of the @item we just started.
\nobreak \vskip-\parskip
%
% Stop a page break at the \parskip glue coming up. However, if
% what follows is an environment such as @example, there will be no
% \parskip glue; then the negative vskip we just inserted would
% cause the example and the item to crash together. So we use this
% bizarre value of 10001 as a signal to \aboveenvbreak to insert
% \parskip glue after all. Section titles are handled this way also.
%
\penalty 10001
\endgroup
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
% following text (if any) will end up on the same line.
\noindent
% Do this with kerns and \unhbox so that if there is a footnote in
% the item text, it can migrate to the main vertical list and
% eventually be printed.
\nobreak\kern-\tableindent
\dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
\unhbox0
\nobreak\kern\dimen0
\endgroup
\itemxneedsnegativevskiptrue
\fi
}
\def\item{\errmessage{@item while not in a list environment}}
\def\itemx{\errmessage{@itemx while not in a list environment}}
% @table, @ftable, @vtable.
\envdef\table{%
\let\itemindex\gobble
\tablecheck{table}%
}
\envdef\ftable{%
\def\itemindex ##1{\doind {fn}{\code{##1}}}%
\tablecheck{ftable}%
}
\envdef\vtable{%
\def\itemindex ##1{\doind {vr}{\code{##1}}}%
\tablecheck{vtable}%
}
\def\tablecheck#1{%
\ifnum \the\catcode`\^^M=\active
\endgroup
\errmessage{This command won't work in this context; perhaps the problem is
that we are \inenvironment\thisenv}%
\def\next{\doignore{#1}}%
\else
\let\next\tablex
\fi
\next
}
\def\tablex#1{%
\def\itemindicate{#1}%
\parsearg\tabley
}
\def\tabley#1{%
{%
\makevalueexpandable
\edef\temp{\noexpand\tablez #1\space\space\space}%
\expandafter
}\temp \endtablez
}
\def\tablez #1 #2 #3 #4\endtablez{%
\aboveenvbreak
\ifnum 0#1>0 \advance \leftskip by #1\mil \fi
\ifnum 0#2>0 \tableindent=#2\mil \fi
\ifnum 0#3>0 \advance \rightskip by #3\mil \fi
\itemmax=\tableindent
\advance \itemmax by -\itemmargin
\advance \leftskip by \tableindent
\exdentamount=\tableindent
\parindent = 0pt
\parskip = \smallskipamount
\ifdim \parskip=0pt \parskip=2pt \fi
\let\item = \internalBitem
\let\itemx = \internalBitemx
}
\def\Etable{\endgraf\afterenvbreak}
\let\Eftable\Etable
\let\Evtable\Etable
\let\Eitemize\Etable
\let\Eenumerate\Etable
% This is the counter used by @enumerate, which is really @itemize
\newcount \itemno
\envdef\itemize{\parsearg\doitemize}
\def\doitemize#1{%
\aboveenvbreak
\itemmax=\itemindent
\advance\itemmax by -\itemmargin
\advance\leftskip by \itemindent
\exdentamount=\itemindent
\parindent=0pt
\parskip=\smallskipamount
\ifdim\parskip=0pt \parskip=2pt \fi
%
% Try typesetting the item mark that if the document erroneously says
% something like @itemize @samp (intending @table), there's an error
% right away at the @itemize. It's not the best error message in the
% world, but it's better than leaving it to the @item. This means if
% the user wants an empty mark, they have to say @w{} not just @w.
\def\itemcontents{#1}%
\setbox0 = \hbox{\itemcontents}%
%
% @itemize with no arg is equivalent to @itemize @bullet.
\ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
%
\let\item=\itemizeitem
}
% Definition of @item while inside @itemize and @enumerate.
%
\def\itemizeitem{%
\advance\itemno by 1 % for enumerations
{\let\par=\endgraf \smallbreak}% reasonable place to break
{%
% If the document has an @itemize directly after a section title, a
% \nobreak will be last on the list, and \sectionheading will have
% done a \vskip-\parskip. In that case, we don't want to zero
% parskip, or the item text will crash with the heading. On the
% other hand, when there is normal text preceding the item (as there
% usually is), we do want to zero parskip, or there would be too much
% space. In that case, we won't have a \nobreak before. At least
% that's the theory.
\ifnum\lastpenalty<10000 \parskip=0in \fi
\noindent
\hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
%
\vadjust{\penalty 1200}}% not good to break after first line of item.
\flushcr
}
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
%
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
% Allow an optional argument of an uppercase letter, lowercase letter,
% or number, to specify the first label in the enumerated list. No
% argument is the same as `1'.
%
\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
\def\enumeratey #1 #2\endenumeratey{%
% If we were given no argument, pretend we were given `1'.
\def\thearg{#1}%
\ifx\thearg\empty \def\thearg{1}\fi
%
% Detect if the argument is a single token. If so, it might be a
% letter. Otherwise, the only valid thing it can be is a number.
% (We will always have one token, because of the test we just made.
% This is a good thing, since \splitoff doesn't work given nothing at
% all -- the first parameter is undelimited.)
\expandafter\splitoff\thearg\endmark
\ifx\rest\empty
% Only one token in the argument. It could still be anything.
% A ``lowercase letter'' is one whose \lccode is nonzero.
% An ``uppercase letter'' is one whose \lccode is both nonzero, and
% not equal to itself.
% Otherwise, we assume it's a number.
%
% We need the \relax at the end of the \ifnum lines to stop TeX from
% continuing to look for a .
%
\ifnum\lccode\expandafter`\thearg=0\relax
\numericenumerate % a number (we hope)
\else
% It's a letter.
\ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
\lowercaseenumerate % lowercase letter
\else
\uppercaseenumerate % uppercase letter
\fi
\fi
\else
% Multiple tokens in the argument. We hope it's a number.
\numericenumerate
\fi
}
% An @enumerate whose labels are integers. The starting integer is
% given in \thearg.
%
\def\numericenumerate{%
\itemno = \thearg
\startenumeration{\the\itemno}%
}
% The starting (lowercase) letter is in \thearg.
\def\lowercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more lowercase letters in @enumerate; get a bigger
alphabet}%
\fi
\char\lccode\itemno
}%
}
% The starting (uppercase) letter is in \thearg.
\def\uppercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more uppercase letters in @enumerate; get a bigger
alphabet}
\fi
\char\uccode\itemno
}%
}
% Call \doitemize, adding a period to the first argument and supplying the
% common last two arguments. Also subtract one from the initial value in
% \itemno, since @item increments \itemno.
%
\def\startenumeration#1{%
\advance\itemno by -1
\doitemize{#1.}\flushcr
}
% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
% to @enumerate.
%
\def\alphaenumerate{\enumerate{a}}
\def\capsenumerate{\enumerate{A}}
\def\Ealphaenumerate{\Eenumerate}
\def\Ecapsenumerate{\Eenumerate}
% @multitable macros
% Amy Hendrickson, 8/18/94, 3/6/96
%
% @multitable ... @end multitable will make as many columns as desired.
% Contents of each column will wrap at width given in preamble. Width
% can be specified either with sample text given in a template line,
% or in percent of \hsize, the current width of text on page.
% Table can continue over pages but will only break between lines.
% To make preamble:
%
% Either define widths of columns in terms of percent of \hsize:
% @multitable @columnfractions .25 .3 .45
% @item ...
%
% Numbers following @columnfractions are the percent of the total
% current hsize to be used for each column. You may use as many
% columns as desired.
% Or use a template:
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
% @item ...
% using the widest term desired in each column.
% Each new table line starts with @item, each subsequent new column
% starts with @tab. Empty columns may be produced by supplying @tab's
% with nothing between them for as many times as empty columns are needed,
% ie, @tab@tab@tab will produce two empty columns.
% @item, @tab do not need to be on their own lines, but it will not hurt
% if they are.
% Sample multitable:
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
% @item first col stuff @tab second col stuff @tab third col
% @item
% first col stuff
% @tab
% second col stuff
% @tab
% third col
% @item first col stuff @tab second col stuff
% @tab Many paragraphs of text may be used in any column.
%
% They will wrap at the width determined by the template.
% @item@tab@tab This will be in third column.
% @end multitable
% Default dimensions may be reset by user.
% @multitableparskip is vertical space between paragraphs in table.
% @multitableparindent is paragraph indent in table.
% @multitablecolmargin is horizontal space to be left between columns.
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
%
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
\newskip\multitablelinespace
\multitableparskip=0pt
\multitableparindent=6pt
\multitablecolspace=12pt
\multitablelinespace=0pt
% Macros used to set up halign preamble:
%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
% #1 is the @columnfraction, usually a decimal number like .5, but might
% be just 1. We just use it, whatever it is.
%
\def\pickupwholefraction#1 {%
\global\advance\colcount by 1
\expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
\setuptable
}
\newcount\colcount
\def\setuptable#1{%
\def\firstarg{#1}%
\ifx\firstarg\xendsetuptable
\let\go = \relax
\else
\ifx\firstarg\xcolumnfractions
\global\setpercenttrue
\else
\ifsetpercent
\let\go\pickupwholefraction
\else
\global\advance\colcount by 1
\setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
% separator; typically that is always in the input, anyway.
\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
\fi
\fi
\ifx\go\pickupwholefraction
% Put the argument back for the \pickupwholefraction call, so
% we'll always have a period there to be parsed.
\def\go{\pickupwholefraction#1}%
\else
\let\go = \setuptable
\fi%
\fi
\go
}
% multitable-only commands.
%
% @headitem starts a heading row, which we typeset in bold.
% Assignments have to be global since we are inside the implicit group
% of an alignment entry. \everycr resets \everytab so we don't have to
% undo it ourselves.
\def\headitemfont{\b}% for people to use in the template row; not changeable
\def\headitem{%
\checkenv\multitable
\crcr
\global\everytab={\bf}% can't use \headitemfont since the parsing differs
\the\everytab % for the first item
}%
%
% A \tab used to include \hskip1sp. But then the space in a template
% line is not enough. That is bad. So let's go back to just `&' until
% we again encounter the problem the 1sp was intended to solve.
% --karl, nathan@acm.org, 20apr99.
\def\tab{\checkenv\multitable &\the\everytab}%
% @multitable ... @end multitable definitions:
%
\newtoks\everytab % insert after every tab.
%
\envdef\multitable{%
\vskip\parskip
\startsavinginserts
%
% @item within a multitable starts a normal row.
% We use \def instead of \let so that if one of the multitable entries
% contains an @itemize, we don't choke on the \item (seen as \crcr aka
% \endtemplate) expanding \doitemize.
\def\item{\crcr}%
%
\tolerance=9500
\hbadness=9500
\setmultitablespacing
\parskip=\multitableparskip
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0
%
\everycr = {%
\noalign{%
\global\everytab={}%
\global\colcount=0 % Reset the column counter.
% Check for saved footnotes, etc.
\checkinserts
% Keeps underfull box messages off when table breaks over pages.
%\filbreak
% Maybe so, but it also creates really weird page breaks when the
% table breaks over pages. Wouldn't \vfil be better? Wait until the
% problem manifests itself, so it can be fixed for real --karl.
}%
}%
%
\parsearg\domultitable
}
\def\domultitable#1{%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
%
% This preamble sets up a generic column definition, which will
% be used as many times as user calls for columns.
% \vtop will set a single line and will also let text wrap and
% continue for many paragraphs if desired.
\halign\bgroup &%
\global\advance\colcount by 1
\multistrut
\vtop{%
% Use the current \colcount to find the correct column width:
\hsize=\expandafter\csname col\the\colcount\endcsname
%
% In order to keep entries from bumping into each other
% we will add a \leftskip of \multitablecolspace to all columns after
% the first one.
%
% If a template has been used, we will add \multitablecolspace
% to the width of each template entry.
%
% If the user has set preamble in terms of percent of \hsize we will
% use that dimension as the width of the column, and the \leftskip
% will keep entries from bumping into each other. Table will start at
% left margin and final column will justify at right margin.
%
% Make sure we don't inherit \rightskip from the outer environment.
\rightskip=0pt
\ifnum\colcount=1
% The first column will be indented with the surrounding text.
\advance\hsize by\leftskip
\else
\ifsetpercent \else
% If user has not set preamble in terms of percent of \hsize
% we will advance \hsize by \multitablecolspace.
\advance\hsize by \multitablecolspace
\fi
% In either case we will make \leftskip=\multitablecolspace:
\leftskip=\multitablecolspace
\fi
% Ignoring space at the beginning and end avoids an occasional spurious
% blank line, when TeX decides to break the line at the space before the
% box from the multistrut, so the strut ends up on a line by itself.
% For example:
% @multitable @columnfractions .11 .89
% @item @code{#}
% @tab Legal holiday which is valid in major parts of the whole country.
% Is automatically provided with highlighting sequences respectively
% marking characters.
\noindent\ignorespaces##\unskip\multistrut
}\cr
}
\def\Emultitable{%
\crcr
\egroup % end the \halign
\global\setpercentfalse
}
\def\setmultitablespacing{%
\def\multistrut{\strut}% just use the standard line spacing
%
% Compute \multitablelinespace (if not defined by user) for use in
% \multitableparskip calculation. We used define \multistrut based on
% this, but (ironically) that caused the spacing to be off.
% See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
\ifdim\multitablelinespace=0pt
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
\global\advance\multitablelinespace by-\ht0
\fi
% Test to see if parskip is larger than space between lines of
% table. If not, do nothing.
% If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
% than skip between lines in the table.
\fi%
\ifdim\multitableparskip=0pt
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
% than skip between lines in the table.
\fi}
\message{conditionals,}
% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
% @ifnotxml always succeed. They currently do nothing; we don't
% attempt to check whether the conditionals are properly nested. But we
% have to remember that they are conditionals, so that @end doesn't
% attempt to close an environment group.
%
\def\makecond#1{%
\expandafter\let\csname #1\endcsname = \relax
\expandafter\let\csname iscond.#1\endcsname = 1
}
\makecond{iftex}
\makecond{ifnotdocbook}
\makecond{ifnothtml}
\makecond{ifnotinfo}
\makecond{ifnotplaintext}
\makecond{ifnotxml}
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
%
\def\direntry{\doignore{direntry}}
\def\documentdescription{\doignore{documentdescription}}
\def\docbook{\doignore{docbook}}
\def\html{\doignore{html}}
\def\ifdocbook{\doignore{ifdocbook}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifinfo{\doignore{ifinfo}}
\def\ifnottex{\doignore{ifnottex}}
\def\ifplaintext{\doignore{ifplaintext}}
\def\ifxml{\doignore{ifxml}}
\def\ignore{\doignore{ignore}}
\def\menu{\doignore{menu}}
\def\xml{\doignore{xml}}
% Ignore text until a line `@end #1', keeping track of nested conditionals.
%
% A count to remember the depth of nesting.
\newcount\doignorecount
\def\doignore#1{\begingroup
% Scan in ``verbatim'' mode:
\obeylines
\catcode`\@ = \other
\catcode`\{ = \other
\catcode`\} = \other
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\spaceisspace
%
% Count number of #1's that we've seen.
\doignorecount = 0
%
% Swallow text until we reach the matching `@end #1'.
\dodoignore{#1}%
}
{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
\obeylines %
%
\gdef\dodoignore#1{%
% #1 contains the command name as a string, e.g., `ifinfo'.
%
% Define a command to find the next `@end #1'.
\long\def\doignoretext##1^^M@end #1{%
\doignoretextyyy##1^^M@#1\_STOP_}%
%
% And this command to find another #1 command, at the beginning of a
% line. (Otherwise, we would consider a line `@c @ifset', for
% example, to count as an @ifset for nesting.)
\long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
%
% And now expand that command.
\doignoretext ^^M%
}%
}
\def\doignoreyyy#1{%
\def\temp{#1}%
\ifx\temp\empty % Nothing found.
\let\next\doignoretextzzz
\else % Found a nested condition, ...
\advance\doignorecount by 1
\let\next\doignoretextyyy % ..., look for another.
% If we're here, #1 ends with ^^M\ifinfo (for example).
\fi
\next #1% the token \_STOP_ is present just after this macro.
}
% We have to swallow the remaining "\_STOP_".
%
\def\doignoretextzzz#1{%
\ifnum\doignorecount = 0 % We have just found the outermost @end.
\let\next\enddoignore
\else % Still inside a nested condition.
\advance\doignorecount by -1
\let\next\doignoretext % Look for the next @end.
\fi
\next
}
% Finish off ignored text.
{ \obeylines%
% Ignore anything after the last `@end #1'; this matters in verbatim
% environments, where otherwise the newline after an ignored conditional
% would result in a blank line in the output.
\gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
}
% @set VAR sets the variable VAR to an empty value.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
%
% Since we want to separate VAR from REST-OF-LINE (which might be
% empty), we can't just use \parsearg; we have to insert a space of our
% own to delimit the rest of the line, and then take it out again if we
% didn't need it.
% We rely on the fact that \parsearg sets \catcode`\ =10.
%
\parseargdef\set{\setyyy#1 \endsetyyy}
\def\setyyy#1 #2\endsetyyy{%
{%
\makevalueexpandable
\def\temp{#2}%
\edef\next{\gdef\makecsname{SET#1}}%
\ifx\temp\empty
\next{}%
\else
\setzzz#2\endsetzzz
\fi
}%
}
% Remove the trailing space \setxxx inserted.
\def\setzzz#1 \endsetzzz{\next{#1}}
% @clear VAR clears (i.e., unsets) the variable VAR.
%
\parseargdef\clear{%
{%
\makevalueexpandable
\global\expandafter\let\csname SET#1\endcsname=\relax
}%
}
% @value{foo} gets the text saved in variable foo.
\def\value{\begingroup\makevalueexpandable\valuexxx}
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
{
\catcode`\- = \active \catcode`\_ = \active
%
\gdef\makevalueexpandable{%
\let\value = \expandablevalue
% We don't want these characters active, ...
\catcode`\-=\other \catcode`\_=\other
% ..., but we might end up with active ones in the argument if
% we're called from @code, as @code{@value{foo-bar_}}, though.
% So \let them to their normal equivalents.
\let-\normaldash \let_\normalunderscore
}
}
% We have this subroutine so that we can handle at least some @value's
% properly in indexes (we call \makevalueexpandable in \indexdummies).
% The command has to be fully expandable (if the variable is set), since
% the result winds up in the index file. This means that if the
% variable's value contains other Texinfo commands, it's almost certain
% it will fail (although perhaps we could fix that with sufficient work
% to do a one-level expansion on the result, instead of complete).
%
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}%
\message{Variable `#1', used in @value, is not set.}%
\else
\csname SET#1\endcsname
\fi
}
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
% To get special treatment of `@end ifset,' call \makeond and the redefine.
%
\makecond{ifset}
\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
\def\doifset#1#2{%
{%
\makevalueexpandable
\let\next=\empty
\expandafter\ifx\csname SET#2\endcsname\relax
#1% If not set, redefine \next.
\fi
\expandafter
}\next
}
\def\ifsetfail{\doignore{ifset}}
% @ifclear VAR ... @end executes the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
% The `\else' inside the `\doifset' parameter is a trick to reuse the
% above code: if the variable is not set, do nothing, if it is set,
% then redefine \next to \ifclearfail.
%
\makecond{ifclear}
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclearfail{\doignore{ifclear}}
% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
% without the @) is in fact defined. We can only feasibly check at the
% TeX level, so something like `mathcode' is going to considered
% defined even though it is not a Texinfo command.
%
\makecond{ifcommanddefined}
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
%
\def\doifcmddefined#1#2{{%
\makevalueexpandable
\let\next=\empty
\expandafter\ifx\csname #2\endcsname\relax
#1% If not defined, \let\next as above.
\fi
\expandafter
}\next
}
\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
\makecond{ifcommandnotdefined}
\def\ifcommandnotdefined{%
\parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
% Set the `txicommandconditionals' variable, so documents have a way to
% test if the @ifcommand...defined conditionals are available.
\set txicommandconditionals
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\let\dircategory=\comment
% @defininfoenclose.
\let\definfoenclose=\comment
\message{indexing,}
% Index generation facilities
% Define \newwrite to be identical to plain tex's \newwrite
% except not \outer, so it can be used within macros and \if's.
\edef\newwrite{\makecsname{ptexnewwrite}}
% \newindex {foo} defines an index named foo.
% It automatically defines \fooindex such that
% \fooindex ...rest of line... puts an entry in the index foo.
% It also defines \fooindfile to be the number of the output channel for
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
%
\def\newindex#1{%
\iflinks
\expandafter\newwrite \csname#1indfile\endcsname
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
\fi
\expandafter\xdef\csname#1index\endcsname{% % Define @#1index
\noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
%
\def\defindex{\parsearg\newindex}
% Define @defcodeindex, like @defindex except put all entries in @code.
%
\def\defcodeindex{\parsearg\newcodeindex}
%
\def\newcodeindex#1{%
\iflinks
\expandafter\newwrite \csname#1indfile\endcsname
\openout \csname#1indfile\endcsname \jobname.#1
\fi
\expandafter\xdef\csname#1index\endcsname{%
\noexpand\docodeindex{#1}}%
}
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
%
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
%
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
% #3 the target index (bar).
\def\dosynindex#1#2#3{%
% Only do \closeout if we haven't already done it, else we'll end up
% closing the target index.
\expandafter \ifx\csname donesynindex#2\endcsname \relax
% The \closeout helps reduce unnecessary open files; the limit on the
% Acorn RISC OS is a mere 16 files.
\expandafter\closeout\csname#2indfile\endcsname
\expandafter\let\csname donesynindex#2\endcsname = 1
\fi
% redefine \fooindfile:
\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
\expandafter\let\csname#2indfile\endcsname=\temp
% redefine \fooindex:
\expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
}
% Define \doindex, the driver for all \fooindex macros.
% Argument #1 is generated by the calling \fooindex macro,
% and it is "foo", the name of the index.
% \doindex just uses \parsearg; it calls \doind for the actual work.
% This is because \doind is more useful to call from other macros.
% There is also \dosubind {index}{topic}{subtopic}
% which makes an entry in a two-level index such as the operation index.
\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
\def\singleindexer #1{\doind{\indexname}{#1}}
% like the previous two, but they put @code around the argument.
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
% Take care of Texinfo commands that can appear in an index entry.
% Since there are some commands we want to expand, and others we don't,
% we have to laboriously prevent expansion for those that we don't.
%
\def\indexdummies{%
\escapechar = `\\ % use backslash in output files.
\def\@{@}% change to @@ when we switch to @ as escape char in index files.
\def\ {\realbackslash\space }%
%
% Need these unexpandable (because we define \tt as a dummy)
% definitions when @{ or @} appear in index entry text. Also, more
% complicated, when \tex is in effect and \{ is a \delimiter again.
% We can't use \lbracecmd and \rbracecmd because texindex assumes
% braces and backslashes are used only as delimiters. Perhaps we
% should define @lbrace and @rbrace commands a la @comma.
\def\{{{\tt\char123}}%
\def\}{{\tt\char125}}%
%
% I don't entirely understand this, but when an index entry is
% generated from a macro call, the \endinput which \scanmacro inserts
% causes processing to be prematurely terminated. This is,
% apparently, because \indexsorttmp is fully expanded, and \endinput
% is an expandable command. The redefinition below makes \endinput
% disappear altogether for that purpose -- although logging shows that
% processing continues to some further point. On the other hand, it
% seems \endinput does not hurt in the printed index arg, since that
% is still getting written without apparent harm.
%
% Sample source (mac-idx3.tex, reported by Graham Percival to
% help-texinfo, 22may06):
% @macro funindex {WORD}
% @findex xyz
% @end macro
% ...
% @funindex commtest
%
% The above is not enough to reproduce the bug, but it gives the flavor.
%
% Sample whatsit resulting:
% .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
%
% So:
\let\endinput = \empty
%
% Do the redefinitions.
\commondummies
}
% For the aux and toc files, @ is the escape character. So we want to
% redefine everything using @ as the escape character (instead of
% \realbackslash, still used for index files). When everything uses @,
% this will be simpler.
%
\def\atdummies{%
\def\@{@@}%
\def\ {@ }%
\let\{ = \lbraceatcmd
\let\} = \rbraceatcmd
%
% Do the redefinitions.
\commondummies
\otherbackslash
}
% Called from \indexdummies and \atdummies.
%
\def\commondummies{%
%
% \definedummyword defines \#1 as \string\#1\space, thus effectively
% preventing its expansion. This is used only for control words,
% not control letters, because the \space would be incorrect for
% control characters, but is needed to separate the control word
% from whatever follows.
%
% For control letters, we have \definedummyletter, which omits the
% space.
%
% These can be used both for control words that take an argument and
% those that do not. If it is followed by {arg} in the input, then
% that will dutifully get written to the index (or wherever).
%
\def\definedummyword ##1{\def##1{\string##1\space}}%
\def\definedummyletter##1{\def##1{\string##1}}%
\let\definedummyaccent\definedummyletter
%
\commondummiesnofonts
%
\definedummyletter\_%
\definedummyletter\-%
%
% Non-English letters.
\definedummyword\AA
\definedummyword\AE
\definedummyword\DH
\definedummyword\L
\definedummyword\O
\definedummyword\OE
\definedummyword\TH
\definedummyword\aa
\definedummyword\ae
\definedummyword\dh
\definedummyword\exclamdown
\definedummyword\l
\definedummyword\o
\definedummyword\oe
\definedummyword\ordf
\definedummyword\ordm
\definedummyword\questiondown
\definedummyword\ss
\definedummyword\th
%
% Although these internal commands shouldn't show up, sometimes they do.
\definedummyword\bf
\definedummyword\gtr
\definedummyword\hat
\definedummyword\less
\definedummyword\sf
\definedummyword\sl
\definedummyword\tclose
\definedummyword\tt
%
\definedummyword\LaTeX
\definedummyword\TeX
%
% Assorted special characters.
\definedummyword\arrow
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
\definedummyword\registeredsymbol
\definedummyword\dots
\definedummyword\enddots
\definedummyword\entrybreak
\definedummyword\equiv
\definedummyword\error
\definedummyword\euro
\definedummyword\expansion
\definedummyword\geq
\definedummyword\guillemetleft
\definedummyword\guillemetright
\definedummyword\guilsinglleft
\definedummyword\guilsinglright
\definedummyword\lbracechar
\definedummyword\leq
\definedummyword\minus
\definedummyword\ogonek
\definedummyword\pounds
\definedummyword\point
\definedummyword\print
\definedummyword\quotedblbase
\definedummyword\quotedblleft
\definedummyword\quotedblright
\definedummyword\quoteleft
\definedummyword\quoteright
\definedummyword\quotesinglbase
\definedummyword\rbracechar
\definedummyword\result
\definedummyword\textdegree
%
% We want to disable all macros so that they are not expanded by \write.
\macrolist
%
\normalturnoffactive
%
% Handle some cases of @value -- where it does not contain any
% (non-fully-expandable) commands.
\makevalueexpandable
}
% \commondummiesnofonts: common to \commondummies and \indexnofonts.
%
\def\commondummiesnofonts{%
% Control letters and accents.
\definedummyletter\!%
\definedummyaccent\"%
\definedummyaccent\'%
\definedummyletter\*%
\definedummyaccent\,%
\definedummyletter\.%
\definedummyletter\/%
\definedummyletter\:%
\definedummyaccent\=%
\definedummyletter\?%
\definedummyaccent\^%
\definedummyaccent\`%
\definedummyaccent\~%
\definedummyword\u
\definedummyword\v
\definedummyword\H
\definedummyword\dotaccent
\definedummyword\ogonek
\definedummyword\ringaccent
\definedummyword\tieaccent
\definedummyword\ubaraccent
\definedummyword\udotaccent
\definedummyword\dotless
%
% Texinfo font commands.
\definedummyword\b
\definedummyword\i
\definedummyword\r
\definedummyword\sansserif
\definedummyword\sc
\definedummyword\slanted
\definedummyword\t
%
% Commands that take arguments.
\definedummyword\abbr
\definedummyword\acronym
\definedummyword\anchor
\definedummyword\cite
\definedummyword\code
\definedummyword\command
\definedummyword\dfn
\definedummyword\dmn
\definedummyword\email
\definedummyword\emph
\definedummyword\env
\definedummyword\file
\definedummyword\image
\definedummyword\indicateurl
\definedummyword\inforef
\definedummyword\kbd
\definedummyword\key
\definedummyword\math
\definedummyword\option
\definedummyword\pxref
\definedummyword\ref
\definedummyword\samp
\definedummyword\strong
\definedummyword\tie
\definedummyword\uref
\definedummyword\url
\definedummyword\var
\definedummyword\verb
\definedummyword\w
\definedummyword\xref
}
% \indexnofonts is used when outputting the strings to sort the index
% by, and when constructing control sequence names. It eliminates all
% control sequences and just writes whatever the best ASCII sort string
% would be for a given command (usually its argument).
%
\def\indexnofonts{%
% Accent commands should become @asis.
\def\definedummyaccent##1{\let##1\asis}%
% We can just ignore other control letters.
\def\definedummyletter##1{\let##1\empty}%
% All control words become @asis by default; overrides below.
\let\definedummyword\definedummyaccent
%
\commondummiesnofonts
%
% Don't no-op \tt, since it isn't a user-level command
% and is used in the definitions of the active chars like <, >, |, etc.
% Likewise with the other plain tex font commands.
%\let\tt=\asis
%
\def\ { }%
\def\@{@}%
\def\_{\normalunderscore}%
\def\-{}% @- shouldn't affect sorting
%
% Unfortunately, texindex is not prepared to handle braces in the
% content at all. So for index sorting, we map @{ and @} to strings
% starting with |, since that ASCII character is between ASCII { and }.
\def\{{|a}%
\def\lbracechar{|a}%
%
\def\}{|b}%
\def\rbracechar{|b}%
%
% Non-English letters.
\def\AA{AA}%
\def\AE{AE}%
\def\DH{DZZ}%
\def\L{L}%
\def\OE{OE}%
\def\O{O}%
\def\TH{ZZZ}%
\def\aa{aa}%
\def\ae{ae}%
\def\dh{dzz}%
\def\exclamdown{!}%
\def\l{l}%
\def\oe{oe}%
\def\ordf{a}%
\def\ordm{o}%
\def\o{o}%
\def\questiondown{?}%
\def\ss{ss}%
\def\th{zzz}%
%
\def\LaTeX{LaTeX}%
\def\TeX{TeX}%
%
% Assorted special characters.
% (The following {} will end up in the sort string, but that's ok.)
\def\arrow{->}%
\def\bullet{bullet}%
\def\comma{,}%
\def\copyright{copyright}%
\def\dots{...}%
\def\enddots{...}%
\def\equiv{==}%
\def\error{error}%
\def\euro{euro}%
\def\expansion{==>}%
\def\geq{>=}%
\def\guillemetleft{<<}%
\def\guillemetright{>>}%
\def\guilsinglleft{<}%
\def\guilsinglright{>}%
\def\leq{<=}%
\def\minus{-}%
\def\point{.}%
\def\pounds{pounds}%
\def\print{-|}%
\def\quotedblbase{"}%
\def\quotedblleft{"}%
\def\quotedblright{"}%
\def\quoteleft{`}%
\def\quoteright{'}%
\def\quotesinglbase{,}%
\def\registeredsymbol{R}%
\def\result{=>}%
\def\textdegree{o}%
%
\expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
\else \indexlquoteignore \fi
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
% makeinfo does not expand macros in the argument to @deffn, which ends up
% writing an index entry, and texindex isn't prepared for an index sort entry
% that starts with \.
%
% Since macro invocations are followed by braces, we can just redefine them
% to take a single TeX argument. The case of a macro invocation that
% goes to end-of-line is not handled.
%
\macrolist
}
% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
% ignore left quotes in the sort term.
{\catcode`\`=\active
\gdef\indexlquoteignore{\let`=\empty}}
\let\indexbackslash=0 %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
% Most index entries go through here, but \dosubind is the general case.
% #1 is the index name, #2 is the entry text.
\def\doind#1#2{\dosubind{#1}{#2}{}}
% Workhorse for all \fooindexes.
% #1 is name of index, #2 is stuff to put there, #3 is subentry --
% empty if called from \doind, as we usually are (the main exception
% is with most defuns, which call us directly).
%
\def\dosubind#1#2#3{%
\iflinks
{%
% Store the main index entry text (including the third arg).
\toks0 = {#2}%
% If third arg is present, precede it with a space.
\def\thirdarg{#3}%
\ifx\thirdarg\empty \else
\toks0 = \expandafter{\the\toks0 \space #3}%
\fi
%
\edef\writeto{\csname#1indfile\endcsname}%
%
\safewhatsit\dosubindwrite
}%
\fi
}
% Write the entry in \toks0 to the index file:
%
\def\dosubindwrite{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
\fi
%
% Remember, we are within a group.
\indexdummies % Must do this here, since \bf, etc expand at this stage
\def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
% Process the index entry with all font commands turned off, to
% get the string to sort by.
{\indexnofonts
\edef\temp{\the\toks0}% need full expansion
\xdef\indexsorttmp{\temp}%
}%
%
% Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the
% subentry case), texindex reduces to two when writing the .??s
% sorted result.
\edef\temp{%
\write\writeto{%
\string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
}%
\temp
}
% Take care of unwanted page breaks/skips around a whatsit:
%
% If a skip is the last thing on the list now, preserve it
% by backing up by \lastskip, doing the \write, then inserting
% the skip again. Otherwise, the whatsit generated by the
% \write or \pdfdest will make \lastskip zero. The result is that
% sequences like this:
% @end defun
% @tindex whatever
% @defun ...
% will have extra space inserted, because the \medbreak in the
% start of the @defun won't see the skip inserted by the @end of
% the previous defun.
%
% But don't do any of this if we're not in vertical mode. We
% don't want to do a \vskip and prematurely end a paragraph.
%
% Avoid page breaks due to these extra skips, too.
%
% But wait, there is a catch there:
% We'll have to check whether \lastskip is zero skip. \ifdim is not
% sufficient for this purpose, as it ignores stretch and shrink parts
% of the skip. The only way seems to be to check the textual
% representation of the skip.
%
% The following is almost like \def\zeroskipmacro{0.0pt} except that
% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
%
\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
%
\newskip\whatsitskip
\newcount\whatsitpenalty
%
% ..., ready, GO:
%
\def\safewhatsit#1{\ifhmode
#1%
\else
% \lastskip and \lastpenalty cannot both be nonzero simultaneously.
\whatsitskip = \lastskip
\edef\lastskipmacro{\the\lastskip}%
\whatsitpenalty = \lastpenalty
%
% If \lastskip is nonzero, that means the last item was a
% skip. And since a skip is discardable, that means this
% -\whatsitskip glue we're inserting is preceded by a
% non-discardable item, therefore it is not a potential
% breakpoint, therefore no \nobreak needed.
\ifx\lastskipmacro\zeroskipmacro
\else
\vskip-\whatsitskip
\fi
%
#1%
%
\ifx\lastskipmacro\zeroskipmacro
% If \lastskip was zero, perhaps the last item was a penalty, and
% perhaps it was >=10000, e.g., a \nobreak. In that case, we want
% to re-insert the same penalty (values >10000 are used for various
% signals); since we just inserted a non-discardable item, any
% following glue (such as a \parskip) would be a breakpoint. For example:
% @deffn deffn-whatever
% @vindex index-whatever
% Description.
% would allow a break between the index-whatever whatsit
% and the "Description." paragraph.
\ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
\else
% On the other hand, if we had a nonzero \lastskip,
% this make-up glue would be preceded by a non-discardable item
% (the whatsit from the \write), so we must insert a \nobreak.
\nobreak\vskip\whatsitskip
\fi
\fi}
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
% \entry {sortstring}{page}{topic}{subtopic}
% The texindex program reads in these files and writes files
% containing these kinds of lines:
% \initial {c}
% before the first topic whose initial is c
% \entry {topic}{pagelist}
% for a topic that is used without subtopics
% \primary {topic}
% for the beginning of a topic that is used with subtopics
% \secondary {subtopic}{pagelist}
% for each subtopic.
% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.
\def\findex {\fnindex}
\def\kindex {\kyindex}
\def\cindex {\cpindex}
\def\vindex {\vrindex}
\def\tindex {\tpindex}
\def\pindex {\pgindex}
\def\cindexsub {\begingroup\obeylines\cindexsub}
{\obeylines %
\gdef\cindexsub "#1" #2^^M{\endgroup %
\dosubind{cp}{#2}{#1}}}
% Define the macros used in formatting output of the sorted index material.
% @printindex causes a particular index (the ??s file) to get printed.
% It does not print any chapter heading (usually an @unnumbered).
%
\parseargdef\printindex{\begingroup
\dobreak \chapheadingskip{10000}%
%
\smallfonts \rm
\tolerance = 9500
\plainfrenchspacing
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
%
% See if the index file exists and is nonempty.
% Change catcode of @ here so that if the index file contains
% \initial {@}
% as its first line, TeX doesn't complain about mismatched braces
% (because it thinks @} is a control sequence).
\catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
\putwordIndexNonexistent
\else
%
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
% it can discover if there is anything in it.
\read 1 to \temp
\ifeof 1
\putwordIndexIsEmpty
\else
% Index files are almost Texinfo source, but we use \ as the escape
% character. It would be better to use @, but that's too big a change
% to make right now.
\def\indexbackslash{\backslashcurfont}%
\catcode`\\ = 0
\escapechar = `\\
\begindoublecolumns
\input \jobname.#1s
\enddoublecolumns
\fi
\fi
\closein 1
\endgroup}
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
\def\initial#1{{%
% Some minor font changes for the special characters.
\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
%
% Remove any glue we may have, we'll be inserting our own.
\removelastskip
%
% We like breaks before the index initials, so insert a bonus.
\nobreak
\vskip 0pt plus 3\baselineskip
\penalty 0
\vskip 0pt plus -3\baselineskip
%
% Typeset the initial. Making this add up to a whole number of
% baselineskips increases the chance of the dots lining up from column
% to column. It still won't often be perfect, because of the stretch
% we need before each entry, but it's better.
%
% No shrink because it confuses \balancecolumns.
\vskip 1.67\baselineskip plus .5\baselineskip
\leftline{\secbf #1}%
% Do our best not to break after the initial.
\nobreak
\vskip .33\baselineskip plus .1\baselineskip
}}
% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
% then page number (#2) flushed to the right margin. It is used for index
% and table of contents entries. The paragraph is indented by \leftskip.
%
% A straightforward implementation would start like this:
% \def\entry#1#2{...
% But this freezes the catcodes in the argument, and can cause problems to
% @code, which sets - active. This problem was fixed by a kludge---
% ``-'' was active throughout whole index, but this isn't really right.
% The right solution is to prevent \entry from swallowing the whole text.
% --kasal, 21nov03
\def\entry{%
\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
\par
%
% Do not fill out the last line with white space.
\parfillskip = 0in
%
% No extra space above this paragraph.
\parskip = 0in
%
% Do not prefer a separate line ending with a hyphen to fewer lines.
\finalhyphendemerits = 0
%
% \hangindent is only relevant when the entry text and page number
% don't both fit on one line. In that case, bob suggests starting the
% dots pretty far over on the line. Unfortunately, a large
% indentation looks wrong when the entry text itself is broken across
% lines. So we use a small indentation and put up with long leaders.
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
\hangindent = 2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
% A bit of stretch before each entry for the benefit of balancing
% columns.
\vskip 0pt plus1pt
%
% When reading the text of entry, convert explicit line breaks
% from @* into spaces. The user might give these in long section
% titles, for instance.
\def\*{\unskip\space\ignorespaces}%
\def\entrybreak{\hfil\break}%
%
% Swallow the left brace of the text (first parameter):
\afterassignment\doentry
\let\temp =
}
\def\entrybreak{\unskip\space\ignorespaces}%
\def\doentry{%
\bgroup % Instead of the swallowed brace.
\noindent
\aftergroup\finishentry
% And now comes the text of the entry.
}
\def\finishentry#1{%
% #1 is the page number.
%
% The following is kludged to not output a line of dots in the index if
% there are no page numbers. The next person who breaks this will be
% cursed by a Unix daemon.
\setbox\boxA = \hbox{#1}%
\ifdim\wd\boxA = 0pt
\ %
\else
%
% If we must, put the page number on a line of its own, and fill out
% this line with blank space. (The \hfil is overwhelmed with the
% fill leaders glue in \indexdotfill if the page number does fit.)
\hfil\penalty50
\null\nobreak\indexdotfill % Have leaders before the page number.
%
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
\ifpdf
\pdfgettoks#1.%
\ \the\toksA
\else
\ #1%
\fi
\fi
\par
\endgroup
}
% Like plain.tex's \dotfill, except uses up at least 1 em.
\def\indexdotfill{\cleaders
\hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
\def\primary #1{\line{#1\hfil}}
\newskip\secondaryindent \secondaryindent=0.5cm
\def\secondary#1#2{{%
\parfillskip=0in
\parskip=0in
\hangindent=1in
\hangafter=1
\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
\ifpdf
\pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
\else
#2
\fi
\par
}}
% Define two-column mode, which we use to typeset indexes.
% Adapted from the TeXbook, page 416, which is to say,
% the manmac.tex format used to print the TeXbook itself.
\catcode`\@=11
\newbox\partialpage
\newdimen\doublecolumnhsize
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% Grab any single-column material above us.
\output = {%
%
% Here is a possibility not foreseen in manmac: if we accumulate a
% whole lot of material, we might end up calling this \output
% routine twice in a row (see the doublecol-lose test, which is
% essentially a couple of indexes with @setchapternewpage off). In
% that case we just ship out what is in \partialpage with the normal
% output routine. Generally, \partialpage will be empty when this
% runs and this will be a no-op. See the indexspread.tex test case.
\ifvoid\partialpage \else
\onepageout{\pagecontents\partialpage}%
\fi
%
\global\setbox\partialpage = \vbox{%
% Unvbox the main output page.
\unvbox\PAGE
\kern-\topskip \kern\baselineskip
}%
}%
\eject % run that output routine to set \partialpage
%
% Use the double-column output routine for subsequent pages.
\output = {\doublecolumnout}%
%
% Change the page size parameters. We could do this once outside this
% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
% format, but then we repeat the same computation. Repeating a couple
% of assignments once per index is clearly meaningless for the
% execution time, so we may as well do it in one place.
%
% First we halve the line length, less a little for the gutter between
% the columns. We compute the gutter based on the line length, so it
% changes automatically with the paper format. The magic constant
% below is chosen so that the gutter has the same value (well, +-<1pt)
% as it did when we hard-coded it.
%
% We put the result in a separate register, \doublecolumhsize, so we
% can restore it in \pagesofar, after \hsize itself has (potentially)
% been clobbered.
%
\doublecolumnhsize = \hsize
\advance\doublecolumnhsize by -.04154\hsize
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
% Double the \vsize as well. (We don't need a separate register here,
% since nobody clobbers \vsize.)
\vsize = 2\vsize
}
% The double-column output routine for all double-column pages except
% the last.
%
\def\doublecolumnout{%
\splittopskip=\topskip \splitmaxdepth=\maxdepth
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
\dimen@ = \vsize
\divide\dimen@ by 2
\advance\dimen@ by -\ht\partialpage
%
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
\unvbox255
\penalty\outputpenalty
}
%
% Re-output the contents of the output page -- any previous material,
% followed by the two boxes we just split, in box0 and box2.
\def\pagesofar{%
\unvbox\partialpage
%
\hsize = \doublecolumnhsize
\wd0=\hsize \wd2=\hsize
\hbox to\pagewidth{\box0\hfil\box2}%
}
%
% All done with double columns.
\def\enddoublecolumns{%
% The following penalty ensures that the page builder is exercised
% _before_ we change the output routine. This is necessary in the
% following situation:
%
% The last section of the index consists only of a single entry.
% Before this section, \pagetotal is less than \pagegoal, so no
% break occurs before the last section starts. However, the last
% section, consisting of \initial and the single \entry, does not
% fit on the page and has to be broken off. Without the following
% penalty the page builder will not be exercised until \eject
% below, and by that time we'll already have changed the output
% routine to the \balancecolumns version, so the next-to-last
% double-column page will be processed with \balancecolumns, which
% is wrong: The two columns will go to the main vertical list, with
% the broken-off section in the recent contributions. As soon as
% the output routine finishes, TeX starts reconsidering the page
% break. The two columns and the broken-off section both fit on the
% page, because the two columns now take up only half of the page
% goal. When TeX sees \eject from below which follows the final
% section, it invokes the new output routine that we've set after
% \balancecolumns below; \onepageout will try to fit the two columns
% and the final section into the vbox of \pageheight (see
% \pagebody), causing an overfull box.
%
% Note that glue won't work here, because glue does not exercise the
% page builder, unlike penalties (see The TeXbook, pp. 280-281).
\penalty0
%
\output = {%
% Split the last of the double-column material. Leave it on the
% current page, no automatic page break.
\balancecolumns
%
% If we end up splitting too much material for the current page,
% though, there will be another page break right after this \output
% invocation ends. Having called \balancecolumns once, we do not
% want to call it again. Therefore, reset \output to its normal
% definition right away. (We hope \balancecolumns will never be
% called on to balance too much material, but if it is, this makes
% the output somewhat more palatable.)
\global\output = {\onepageout{\pagecontents\PAGE}}%
}%
\eject
\endgroup % started in \begindoublecolumns
%
% \pagegoal was set to the doubled \vsize above, since we restarted
% the current page. We're now back to normal single-column
% typesetting, so reset \pagegoal to the normal \vsize (after the
% \endgroup where \vsize got restored).
\pagegoal = \vsize
}
%
% Called at the end of the double column material.
\def\balancecolumns{%
\setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
\divide\dimen@ by 2 % target to split to
%debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
\splittopskip = \topskip
% Loop until we get a decent breakpoint.
{%
\vbadness = 10000
\loop
\global\setbox3 = \copy0
\global\setbox1 = \vsplit3 to \dimen@
\ifdim\ht3>\dimen@
\global\advance\dimen@ by 1pt
\repeat
}%
%debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
\setbox0=\vbox to\dimen@{\unvbox1}%
\setbox2=\vbox to\dimen@{\unvbox3}%
%
\pagesofar
}
\catcode`\@ = \other
\message{sectioning,}
% Chapters, sections, etc.
% Let's start with @part.
\outer\parseargdef\part{\partzzz{#1}}
\def\partzzz#1{%
\chapoddpage
\null
\vskip.3\vsize % move it down on the page a bit
\begingroup
\noindent \titlefonts\rmisbold #1\par % the text
\let\lastnode=\empty % no node to associate with
\writetocentry{part}{#1}{}% but put it in the toc
\headingsoff % no headline or footline on the part page
\chapoddpage
\endgroup
}
% \unnumberedno is an oxymoron. But we count the unnumbered
% sections so that we can refer to them unambiguously in the pdf
% outlines by their "section number". We avoid collisions with chapter
% numbers by starting them at 10000. (If a document ever has 10000
% chapters, we're in trouble anyway, I'm sure.)
\newcount\unnumberedno \unnumberedno = 10000
\newcount\chapno
\newcount\secno \secno=0
\newcount\subsecno \subsecno=0
\newcount\subsubsecno \subsubsecno=0
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno \appendixno = `\@
%
% \def\appendixletter{\char\the\appendixno}
% We do the following ugly conditional instead of the above simple
% construct for the sake of pdftex, which needs the actual
% letter in the expansion, not just typeset.
%
\def\appendixletter{%
\ifnum\appendixno=`A A%
\else\ifnum\appendixno=`B B%
\else\ifnum\appendixno=`C C%
\else\ifnum\appendixno=`D D%
\else\ifnum\appendixno=`E E%
\else\ifnum\appendixno=`F F%
\else\ifnum\appendixno=`G G%
\else\ifnum\appendixno=`H H%
\else\ifnum\appendixno=`I I%
\else\ifnum\appendixno=`J J%
\else\ifnum\appendixno=`K K%
\else\ifnum\appendixno=`L L%
\else\ifnum\appendixno=`M M%
\else\ifnum\appendixno=`N N%
\else\ifnum\appendixno=`O O%
\else\ifnum\appendixno=`P P%
\else\ifnum\appendixno=`Q Q%
\else\ifnum\appendixno=`R R%
\else\ifnum\appendixno=`S S%
\else\ifnum\appendixno=`T T%
\else\ifnum\appendixno=`U U%
\else\ifnum\appendixno=`V V%
\else\ifnum\appendixno=`W W%
\else\ifnum\appendixno=`X X%
\else\ifnum\appendixno=`Y Y%
\else\ifnum\appendixno=`Z Z%
% The \the is necessary, despite appearances, because \appendixletter is
% expanded while writing the .toc file. \char\appendixno is not
% expandable, thus it is written literally, thus all appendixes come out
% with the same letter (or @) in the toc without it.
\else\char\the\appendixno
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines these (using marks) as the number+name, number
% and name of the chapter. Page headings and footings can use
% these. @section does likewise.
\def\thischapter{}
\def\thischapternum{}
\def\thischaptername{}
\def\thissection{}
\def\thissectionnum{}
\def\thissectionname{}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
\let\up=\raisesections % original BFox name
% @lowersections: treat @chapter as section, @section as subsection, etc.
\def\lowersections{\global\advance\secbase by 1}
\let\down=\lowersections % original BFox name
% we only have subsub.
\chardef\maxseclevel = 3
%
% A numbered section within an unnumbered changes to unnumbered too.
% To achieve this, remember the "biggest" unnum. sec. we are currently in:
\chardef\unnlevel = \maxseclevel
%
% Trace whether the current chapter is an appendix or not:
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
\def\chapheadtype{N}
% Choose a heading macro
% #1 is heading type
% #2 is heading level
% #3 is text for heading
\def\genhead#1#2#3{%
% Compute the abs. sec. level:
\absseclevel=#2
\advance\absseclevel by \secbase
% Make sure \absseclevel doesn't fall outside the range:
\ifnum \absseclevel < 0
\absseclevel = 0
\else
\ifnum \absseclevel > 3
\absseclevel = 3
\fi
\fi
% The heading type:
\def\headtype{#1}%
\if \headtype U%
\ifnum \absseclevel < \unnlevel
\chardef\unnlevel = \absseclevel
\fi
\else
% Check for appendix sections:
\ifnum \absseclevel = 0
\edef\chapheadtype{\headtype}%
\else
\if \headtype A\if \chapheadtype N%
\errmessage{@appendix... within a non-appendix chapter}%
\fi\fi
\fi
% Check for numbered within unnumbered:
\ifnum \absseclevel > \unnlevel
\def\headtype{U}%
\else
\chardef\unnlevel = 3
\fi
\fi
% Now print the heading:
\if \headtype U%
\ifcase\absseclevel
\unnumberedzzz{#3}%
\or \unnumberedseczzz{#3}%
\or \unnumberedsubseczzz{#3}%
\or \unnumberedsubsubseczzz{#3}%
\fi
\else
\if \headtype A%
\ifcase\absseclevel
\appendixzzz{#3}%
\or \appendixsectionzzz{#3}%
\or \appendixsubseczzz{#3}%
\or \appendixsubsubseczzz{#3}%
\fi
\else
\ifcase\absseclevel
\chapterzzz{#3}%
\or \seczzz{#3}%
\or \numberedsubseczzz{#3}%
\or \numberedsubsubseczzz{#3}%
\fi
\fi
\fi
\suppressfirstparagraphindent
}
% an interface:
\def\numhead{\genhead N}
\def\apphead{\genhead A}
\def\unnmhead{\genhead U}
% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
% all lower-level sectioning counters to zero.
%
% Also set \chaplevelprefix, which we prepend to @float sequence numbers
% (e.g., figures), q.v. By default (before any chapter), that is empty.
\let\chaplevelprefix = \empty
%
\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz#1{%
% section resetting is \global in case the chapter is in a group, such
% as an @include file.
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\chapno by 1
%
% Used for \float.
\gdef\chaplevelprefix{\the\chapno.}%
\resetallfloatnos
%
% \putwordChapter can contain complex things in translations.
\toks0=\expandafter{\putwordChapter}%
\message{\the\toks0 \space \the\chapno}%
%
% Write the actual heading.
\chapmacro{#1}{Ynumbered}{\the\chapno}%
%
% So @section and the like are numbered underneath this chapter.
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
}
\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
%
\def\appendixzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\appendixno by 1
\gdef\chaplevelprefix{\appendixletter.}%
\resetallfloatnos
%
% \putwordAppendix can contain complex things in translations.
\toks0=\expandafter{\putwordAppendix}%
\message{\the\toks0 \space \appendixletter}%
%
\chapmacro{#1}{Yappendix}{\appendixletter}%
%
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
}
% normally unnmhead0 calls unnumberedzzz:
\outer\parseargdef\unnumbered{\unnmhead0{#1}}
\def\unnumberedzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\unnumberedno by 1
%
% Since an unnumbered has no number, no prefix for figures.
\global\let\chaplevelprefix = \empty
\resetallfloatnos
%
% This used to be simply \message{#1}, but TeX fully expands the
% argument to \message. Therefore, if #1 contained @-commands, TeX
% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
% expanded @cite (which turns out to cause errors because \cite is meant
% to be executed, not expanded).
%
% Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use
% \the to achieve this: TeX expands \the only once,
% simply yielding the contents of . (We also do this for
% the toc entries.)
\toks0 = {#1}%
\message{(\the\toks0)}%
%
\chapmacro{#1}{Ynothing}{\the\unnumberedno}%
%
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\parseargdef\centerchap{%
% Well, we could do the following in a group, but that would break
% an assumption that \chapmacro is called at the outermost level.
% Thus we are safer this way: --kasal, 24feb04
\let\centerparametersmaybe = \centerparameters
\unnmhead0{#1}%
\let\centerparametersmaybe = \relax
}
% @top is like @unnumbered.
\let\top\unnumbered
% Sections.
%
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
}
% normally calls appendixsectionzzz:
\outer\parseargdef\appendixsection{\apphead1{#1}}
\def\appendixsectionzzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
}
\let\appendixsec\appendixsection
% normally calls unnumberedseczzz:
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
\def\unnumberedseczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
}
% Subsections.
%
% normally calls numberedsubseczzz:
\outer\parseargdef\numberedsubsec{\numhead2{#1}}
\def\numberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
}
% normally calls appendixsubseczzz:
\outer\parseargdef\appendixsubsec{\apphead2{#1}}
\def\appendixsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno}%
}
% normally calls unnumberedsubseczzz:
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
\def\unnumberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno}%
}
% Subsubsections.
%
% normally numberedsubsubseczzz:
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
\def\numberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynumbered}%
{\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% normally appendixsubsubseczzz:
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
\def\appendixsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% normally unnumberedsubsubseczzz:
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
\def\unnumberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% These macros control what the section commands do, according
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% Define them by default for a numbered chapter.
\let\section = \numberedsec
\let\subsection = \numberedsubsec
\let\subsubsection = \numberedsubsubsec
% Define @majorheading, @heading and @subheading
\def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }%
\parsearg\chapheadingzzz
}
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{%
\vbox{\chapfonts \raggedtitlesettings #1\par}%
\nobreak\bigskip \nobreak
\suppressfirstparagraphindent
}
% @heading, @subheading, @subsubheading.
\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.
% Args are the skip and penalty (usually negative)
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
% Parameter controlling skip before chapter headings (if needed)
\newskip\chapheadingskip
% Define plain chapter starts, and page on/off switching for it.
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
\def\chappager{\par\vfill\supereject}
% Because \domark is called before \chapoddpage, the filler page will
% get the headings for the next chapter, which is wrong. But we don't
% care -- we just disable all headings on the filler page.
\def\chapoddpage{%
\chappager
\ifodd\pageno \else
\begingroup
\headingsoff
\null
\chappager
\endgroup
\fi
}
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}
\def\CHAPPAGodd{%
\global\let\contentsalignmacro = \chapoddpage
\global\let\pchapsepmacro=\chapoddpage
\global\let\pagealignmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}
\CHAPPAGon
% Chapter opening.
%
% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
% Yappendix, Yomitfromtoc), #3 the chapter number.
%
% To test against our argument.
\def\Ynothingkeyword{Ynothing}
\def\Yomitfromtockeyword{Yomitfromtoc}
\def\Yappendixkeyword{Yappendix}
%
\def\chapmacro#1#2#3{%
% Insert the first mark before the heading break (see notes for \domark).
\let\prevchapterdefs=\lastchapterdefs
\let\prevsectiondefs=\lastsectiondefs
\gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
\gdef\thissection{}}%
%
\def\temptype{#2}%
\ifx\temptype\Ynothingkeyword
\gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{\thischaptername}}%
\else\ifx\temptype\Yomitfromtockeyword
\gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{}}%
\else\ifx\temptype\Yappendixkeyword
\toks0={#1}%
\xdef\lastchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\appendixletter}%
% \noexpand\putwordAppendix avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
\noexpand\thischapternum:
\noexpand\thischaptername}%
}%
\else
\toks0={#1}%
\xdef\lastchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\the\chapno}%
% \noexpand\putwordChapter avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thischapter{\noexpand\putwordChapter{}
\noexpand\thischapternum:
\noexpand\thischaptername}%
}%
\fi\fi\fi
%
% Output the mark. Pass it through \safewhatsit, to take care of
% the preceding space.
\safewhatsit\domark
%
% Insert the chapter heading break.
\pchapsepmacro
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
\let\prevchapterdefs=\lastchapterdefs
\let\prevsectiondefs=\lastsectiondefs
\domark
%
{%
\chapfonts \rmisbold
%
% Have to define \lastsection before calling \donoderef, because the
% xref code eventually uses it. On the other hand, it has to be called
% after \pchapsepmacro, or the headline will change too soon.
\gdef\lastsection{#1}%
%
% Only insert the separating space if we have a chapter/appendix
% number, and don't print the unnumbered ``number''.
\ifx\temptype\Ynothingkeyword
\setbox0 = \hbox{}%
\def\toctype{unnchap}%
\else\ifx\temptype\Yomitfromtockeyword
\setbox0 = \hbox{}% contents like unnumbered, but no toc entry
\def\toctype{omit}%
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
\def\toctype{app}%
\else
\setbox0 = \hbox{#3\enspace}%
\def\toctype{numchap}%
\fi\fi\fi
%
% Write the toc entry for this chapter. Must come before the
% \donoderef, because we include the current node name in the toc
% entry, and \donoderef resets it to empty.
\writetocentry{\toctype}{#1}{#3}%
%
% For pdftex, we have to write out the node definition (aka, make
% the pdfdest) after any page break, but before the actual text has
% been typeset. If the destination for the pdf outline is after the
% text, then jumping from the outline may wind up with the text not
% being visible, for instance under high magnification.
\donoderef{#2}%
%
% Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue.
\vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}%
}%
\nobreak\bigskip % no page break after a chapter title
\nobreak
}
% @centerchap -- centered and unnumbered.
\let\centerparametersmaybe = \relax
\def\centerparameters{%
\advance\rightskip by 3\rightskip
\leftskip = \rightskip
\parfillskip = 0pt
}
% I don't think this chapter style is supported any more, so I'm not
% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
%
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
%
\def\unnchfopen #1{%
\chapoddpage
\vbox{\chapfonts \raggedtitlesettings #1\par}%
\nobreak\bigskip\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 %
}
\def\centerchfopen #1{%
\chapoddpage
\vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
\nobreak\bigskip \nobreak
}
\def\CHAPFopen{%
\global\let\chapmacro=\chfopen
\global\let\centerchapmacro=\centerchfopen}
% Section titles. These macros combine the section number parts and
% call the generic \sectionheading to do the printing.
%
\newskip\secheadingskip
\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
% Subsection titles.
\newskip\subsecheadingskip
\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
% Subsubsection titles.
\def\subsubsecheadingskip{\subsecheadingskip}
\def\subsubsecheadingbreak{\subsecheadingbreak}
% Print any size, any type, section title.
%
% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
% section number.
%
\def\seckeyword{sec}
%
\def\sectionheading#1#2#3#4{%
{%
\checkenv{}% should not be in an environment.
%
% Switch to the right set of fonts.
\csname #2fonts\endcsname \rmisbold
%
\def\sectionlevel{#2}%
\def\temptype{#3}%
%
% Insert first mark before the heading break (see notes for \domark).
\let\prevsectiondefs=\lastsectiondefs
\ifx\temptype\Ynothingkeyword
\ifx\sectionlevel\seckeyword
\gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
\gdef\thissection{\thissectionname}}%
\fi
\else\ifx\temptype\Yomitfromtockeyword
% Don't redefine \thissection.
\else\ifx\temptype\Yappendixkeyword
\ifx\sectionlevel\seckeyword
\toks0={#1}%
\xdef\lastsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thissection{\noexpand\putwordSection{}
\noexpand\thissectionnum:
\noexpand\thissectionname}%
}%
\fi
\else
\ifx\sectionlevel\seckeyword
\toks0={#1}%
\xdef\lastsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thissection{\noexpand\putwordSection{}
\noexpand\thissectionnum:
\noexpand\thissectionname}%
}%
\fi
\fi\fi\fi
%
% Go into vertical mode. Usually we'll already be there, but we
% don't want the following whatsit to end up in a preceding paragraph
% if the document didn't happen to have a blank line.
\par
%
% Output the mark. Pass it through \safewhatsit, to take care of
% the preceding space.
\safewhatsit\domark
%
% Insert space above the heading.
\csname #2headingbreak\endcsname
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
\let\prevsectiondefs=\lastsectiondefs
\domark
%
% Only insert the space after the number if we have a section number.
\ifx\temptype\Ynothingkeyword
\setbox0 = \hbox{}%
\def\toctype{unn}%
\gdef\lastsection{#1}%
\else\ifx\temptype\Yomitfromtockeyword
% for @headings -- no section number, don't include in toc,
% and don't redefine \lastsection.
\setbox0 = \hbox{}%
\def\toctype{omit}%
\let\sectionlevel=\empty
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{#4\enspace}%
\def\toctype{app}%
\gdef\lastsection{#1}%
\else
\setbox0 = \hbox{#4\enspace}%
\def\toctype{num}%
\gdef\lastsection{#1}%
\fi\fi\fi
%
% Write the toc entry (before \donoderef). See comments in \chapmacro.
\writetocentry{\toctype\sectionlevel}{#1}{#4}%
%
% Write the node reference (= pdf destination for pdftex).
% Again, see comments in \chapmacro.
\donoderef{#3}%
%
% Interline glue will be inserted when the vbox is completed.
% That glue will be a valid breakpoint for the page, since it'll be
% preceded by a whatsit (usually from the \donoderef, or from the
% \writetocentry if there was no node). We don't want to allow that
% break, since then the whatsits could end up on page n while the
% section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
\nobreak
%
% Output the actual section heading.
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
\hangindent=\wd0 % zero if no section number
\unhbox0 #1}%
}%
% Add extra space after the heading -- half of whatever came above it.
% Don't allow stretch, though.
\kern .5 \csname #2headingskip\endcsname
%
% Do not let the kern be a potential breakpoint, as it would be if it
% was followed by glue.
\nobreak
%
% We'll almost certainly start a paragraph next, so don't let that
% glue accumulate. (Not a breakpoint because it's preceded by a
% discardable item.) However, when a paragraph is not started next
% (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
% or the negative glue will cause weirdly wrong output, typically
% obscuring the section heading with something else.
\vskip-\parskip
%
% This is so the last item on the main vertical list is a known
% \penalty > 10000, so \startdefun, etc., can recognize the situation
% and do the needful.
\penalty 10001
}
\message{toc,}
% Table of contents.
\newwrite\tocfile
% Write an entry to the toc file, opening it if necessary.
% Called from @chapter, etc.
%
% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
% We append the current node name (if any) and page number as additional
% arguments for the \{chap,sec,...}entry macros which will eventually
% read this. The node name is used in the pdf outlines as the
% destination to jump to.
%
% We open the .toc file for writing here instead of at @setfilename (or
% any other fixed time) so that @contents can be anywhere in the document.
% But if #1 is `omit', then we don't do anything. This is used for the
% table of contents chapter openings themselves.
%
\newif\iftocfileopened
\def\omitkeyword{omit}%
%
\def\writetocentry#1#2#3{%
\edef\writetoctype{#1}%
\ifx\writetoctype\omitkeyword \else
\iftocfileopened\else
\immediate\openout\tocfile = \jobname.toc
\global\tocfileopenedtrue
\fi
%
\iflinks
{\atdummies
\edef\temp{%
\write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
\temp
}%
\fi
\fi
%
% Tell \shipout to create a pdf destination on each page, if we're
% writing pdf. These are used in the table of contents. We can't
% just write one on every page because the title pages are numbered
% 1 and 2 (the page numbers aren't printed), and so are the first
% two pages of the document. Thus, we'd have two destinations named
% `1', and two named `2'.
\ifpdf \global\pdfmakepagedesttrue \fi
}
% These characters do not print properly in the Computer Modern roman
% fonts, so we must take special care. This is more or less redundant
% with the Texinfo input format setup at the end of this file.
%
\def\activecatcodes{%
\catcode`\"=\active
\catcode`\$=\active
\catcode`\<=\active
\catcode`\>=\active
\catcode`\\=\active
\catcode`\^=\active
\catcode`\_=\active
\catcode`\|=\active
\catcode`\~=\active
}
% Read the toc file, which is essentially Texinfo input.
\def\readtocfile{%
\setupdatafile
\activecatcodes
\input \tocreadfilename
}
\newskip\contentsrightmargin \contentsrightmargin=1in
\newcount\savepageno
\newcount\lastnegativepageno \lastnegativepageno = -1
% Prepare to read what we've written to \tocfile.
%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
% \contentsalignmacro in parallel with \pagealignmacro.
% From: Torbjorn Granlund
\contentsalignmacro
\immediate\closeout\tocfile
%
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\chapmacro{#1}{Yomitfromtoc}{}%
%
\savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
%
% Roman numerals for page numbers.
\ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
% redefined for the two-volume lispref. We always output on
% \jobname.toc even if this is redefined.
%
\def\tocreadfilename{\jobname.toc}
% Normal (long) toc.
%
\def\contents{%
\startcontents{\putwordTOC}%
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\readtocfile
\fi
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\ifeof 1 \else
\pdfmakeoutlines
\fi
\closein 1
\endgroup
\lastnegativepageno = \pageno
\global\pageno = \savepageno
}
% And just the chapters.
\def\summarycontents{%
\startcontents{\putwordShortTOC}%
%
\let\partentry = \shortpartentry
\let\numchapentry = \shortchapentry
\let\appentry = \shortchapentry
\let\unnchapentry = \shortunnchapentry
% We want a true roman here for the page numbers.
\secfonts
\let\rm=\shortcontrm \let\bf=\shortcontbf
\let\sl=\shortcontsl \let\tt=\shortconttt
\rm
\hyphenpenalty = 10000
\advance\baselineskip by 1pt % Open it up a little.
\def\numsecentry##1##2##3##4{}
\let\appsecentry = \numsecentry
\let\unnsecentry = \numsecentry
\let\numsubsecentry = \numsecentry
\let\appsubsecentry = \numsecentry
\let\unnsubsecentry = \numsecentry
\let\numsubsubsecentry = \numsecentry
\let\appsubsubsecentry = \numsecentry
\let\unnsubsubsecentry = \numsecentry
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\readtocfile
\fi
\closein 1
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
\lastnegativepageno = \pageno
\global\pageno = \savepageno
}
\let\shortcontents = \summarycontents
% Typeset the label for a chapter or appendix for the short contents.
% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
%
\def\shortchaplabel#1{%
% This space should be enough, since a single number is .5em, and the
% widest letter (M) is 1em, at least in the Computer Modern fonts.
% But use \hss just in case.
% (This space doesn't include the extra space that gets added after
% the label; that gets put in by \shortchapentry above.)
%
% We'd like to right-justify chapter numbers, but that looks strange
% with appendix letters. And right-justifying numbers and
% left-justifying letters looks strange when there is less than 10
% chapters. Have to read the whole toc once to know how many chapters
% there are before deciding ...
\hbox to 1em{#1\hss}%
}
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
% The arguments in between are the chapter number, section number, ...
% Parts, in the main contents. Replace the part number, which doesn't
% exist, with an empty box. Let's hope all the numbers have the same width.
% Also ignore the page number, which is conventionally not printed.
\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
%
% Parts, in the short toc.
\def\shortpartentry#1#2#3#4{%
\penalty-300
\vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
\shortchapentry{{\bf #1}}{\numeralbox}{}{}%
}
% Chapters, in the main contents.
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
%
% Chapters, in the short toc.
% See comments in \dochapentry re vbox and related settings.
\def\shortchapentry#1#2#3#4{%
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
}
% Appendices, in the main contents.
% Need the word Appendix, and a fixed-size box.
%
\def\appendixbox#1{%
% We use M since it's probably the widest letter.
\setbox0 = \hbox{\putwordAppendix{} M}%
\hbox to \wd0{\putwordAppendix{} #1\hss}}
%
\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
% Unnumbered chapters.
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
% Sections.
\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
\let\appsecentry=\numsecentry
\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
% Subsections.
\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
\let\appsubsecentry=\numsubsecentry
\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
% And subsubsections.
\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
\let\appsubsubsecentry=\numsubsubsecentry
\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
% This parameter controls the indentation of the various levels.
% Same as \defaultparindent.
\newdimen\tocindent \tocindent = 15pt
% Now for the actual typesetting. In all these, #1 is the text and #2 is the
% page number.
%
% If the toc has to be broken over pages, we want it to be at chapters
% if at all possible; hence the \penalty.
\def\dochapentry#1#2{%
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
\chapentryfonts
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% We use the same \entry macro as for the index entries.
\let\tocentry = \entry
% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}
\def\dopageno#1{{\rm #1}}
\def\doshortpageno#1{{\rm #1}}
\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
\def\subsecentryfonts{\textfonts}
\def\subsubsecentryfonts{\textfonts}
\message{environments,}
% @foo ... @end foo.
% @tex ... @end tex escapes into raw TeX temporarily.
% One exception: @ is still an escape character, so that @end tex works.
% But \@ or @@ will get a plain @ character.
\envdef\tex{%
\setupmarkupstyle{tex}%
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14
\catcode `\+=\other
\catcode `\"=\other
\catcode `\|=\other
\catcode `\<=\other
\catcode `\>=\other
\catcode`\`=\other
\catcode`\'=\other
\escapechar=`\\
%
% ' is active in math mode (mathcode"8000). So reset it, and all our
% other math active characters (just in case), to plain's definitions.
\mathactive
%
\let\b=\ptexb
\let\bullet=\ptexbullet
\let\c=\ptexc
\let\,=\ptexcomma
\let\.=\ptexdot
\let\dots=\ptexdots
\let\equiv=\ptexequiv
\let\!=\ptexexclam
\let\i=\ptexi
\let\indent=\ptexindent
\let\noindent=\ptexnoindent
\let\{=\ptexlbrace
\let\+=\tabalign
\let\}=\ptexrbrace
\let\/=\ptexslash
\let\*=\ptexstar
\let\t=\ptext
\expandafter \let\csname top\endcsname=\ptextop % outer
\let\frenchspacing=\plainfrenchspacing
%
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
\def\@{@}%
}
% There is no need to define \Etex.
% Define @lisp ... @end lisp.
% @lisp environment forms a group so it can rebind things,
% including the definition of @end lisp (which normally is erroneous).
% Amount to narrow the margins by for @lisp.
\newskip\lispnarrowing \lispnarrowing=0.4in
% This is the definition that ^^M gets inside @lisp, @example, and other
% such environments. \null is better than a space, since it doesn't
% have any width.
\def\lisppar{\null\endgraf}
% This space is always present above and below environments.
\newskip\envskipamount \envskipamount = 0pt
% Make spacing and below environment symmetrical. We use \parskip here
% to help in doing that, since in @example-like environments \parskip
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
% start of the next paragraph will insert \parskip.
%
\def\aboveenvbreak{{%
% =10000 instead of <10000 because of a special case in \itemzzz and
% \sectionheading, q.v.
\ifnum \lastpenalty=10000 \else
\advance\envskipamount by \parskip
\endgraf
\ifdim\lastskip<\envskipamount
\removelastskip
% it's not a good place to break if the last penalty was \nobreak
% or better ...
\ifnum\lastpenalty<10000 \penalty-50 \fi
\vskip\envskipamount
\fi
\fi
}}
\let\afterenvbreak = \aboveenvbreak
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
% also clear it, so that its embedded environments do the narrowing again.
\let\nonarrowing=\relax
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\circthick=\fontdimen8\circle
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
\def\cbl{{\circle\char'012\hskip -6pt}}
\def\cbr{{\hskip 6pt\circle\char'011}}
\def\carttop{\hbox to \cartouter{\hskip\lskip
\ctl\leaders\hrule height\circthick\hfil\ctr
\hskip\rskip}}
\def\cartbot{\hbox to \cartouter{\hskip\lskip
\cbl\leaders\hrule height\circthick\hfil\cbr
\hskip\rskip}}
%
\newskip\lskip\newskip\rskip
\envdef\cartouche{%
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt % we want these *outside*.
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
\advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing = t%
%
% If this cartouche directly follows a sectioning command, we need the
% \parskip glue (backspaced over by default) or the cartouche can
% collide with the section heading.
\ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
%
\vbox\bgroup
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
\hbox\bgroup
\hskip\lskip
\vrule\kern3pt
\vbox\bgroup
\kern3pt
\hsize=\cartinner
\baselineskip=\normbskip
\lineskip=\normlskip
\parskip=\normpskip
\vskip -\parskip
\comment % For explanation, see the end of def\group.
}
\def\Ecartouche{%
\ifhmode\par\fi
\kern3pt
\egroup
\kern3pt\vrule
\hskip\rskip
\egroup
\cartbot
\egroup
\checkinserts
}
% This macro is called at the beginning of all the @example variants,
% inside a group.
\newdimen\nonfillparindent
\def\nonfillstart{%
\aboveenvbreak
\hfuzz = 12pt % Don't be fussy
\sepspaces % Make spaces be word-separators rather than space tokens.
\let\par = \lisppar % don't ignore blank lines
\obeylines % each line of input is a line of output
\parskip = 0pt
% Turn off paragraph indentation but redefine \indent to emulate
% the normal \indent.
\nonfillparindent=\parindent
\parindent = 0pt
\let\indent\nonfillindent
%
\emergencystretch = 0pt % don't try to avoid overfull boxes
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
\else
\let\nonarrowing = \relax
\fi
\let\exdent=\nofillexdent
}
\begingroup
\obeyspaces
% We want to swallow spaces (but not other tokens) after the fake
% @indent in our nonfill-environments, where spaces are normally
% active and set to @tie, resulting in them not being ignored after
% @indent.
\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
\gdef\nonfillindentcheck{%
\ifx\temp %
\expandafter\nonfillindentgobble%
\else%
\leavevmode\nonfillindentbox%
\fi%
}%
\endgroup
\def\nonfillindentgobble#1{\nonfillindent}
\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
% If you want all examples etc. small: @set dispenvsize small.
% If you want even small examples the full size: @set dispenvsize nosmall.
% This affects the following displayed environments:
% @example, @display, @format, @lisp
%
\def\smallword{small}
\def\nosmallword{nosmall}
\let\SETdispenvsize\relax
\def\setnormaldispenv{%
\ifx\SETdispenvsize\smallword
% end paragraph for sake of leading, in case document has no blank
% line. This is redundant with what happens in \aboveenvbreak, but
% we need to do it before changing the fonts, and it's inconvenient
% to change the fonts afterward.
\ifnum \lastpenalty=10000 \else \endgraf \fi
\smallexamplefonts \rm
\fi
}
\def\setsmalldispenv{%
\ifx\SETdispenvsize\nosmallword
\else
\ifnum \lastpenalty=10000 \else \endgraf \fi
\smallexamplefonts \rm
\fi
}
% We often define two environments, @foo and @smallfoo.
% Let's do it in one command. #1 is the env name, #2 the definition.
\def\makedispenvdef#1#2{%
\expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
\expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
\expandafter\let\csname E#1\endcsname \afterenvbreak
\expandafter\let\csname Esmall#1\endcsname \afterenvbreak
}
% Define two environment synonyms (#1 and #2) for an environment.
\def\maketwodispenvdef#1#2#3{%
\makedispenvdef{#1}{#3}%
\makedispenvdef{#2}{#3}%
}
%
% @lisp: indented, narrowed, typewriter font;
% @example: same as @lisp.
%
% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
%
\maketwodispenvdef{lisp}{example}{%
\nonfillstart
\tt\setupmarkupstyle{example}%
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
\gobble % eat return
}
% @display/@smalldisplay: same as @lisp except keep current font.
%
\makedispenvdef{display}{%
\nonfillstart
\gobble
}
% @format/@smallformat: same as @display except don't narrow margins.
%
\makedispenvdef{format}{%
\let\nonarrowing = t%
\nonfillstart
\gobble
}
% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
\envdef\flushleft{%
\let\nonarrowing = t%
\nonfillstart
\gobble
}
\let\Eflushleft = \afterenvbreak
% @flushright.
%
\envdef\flushright{%
\let\nonarrowing = t%
\nonfillstart
\advance\leftskip by 0pt plus 1fill\relax
\gobble
}
\let\Eflushright = \afterenvbreak
% @raggedright does more-or-less normal line breaking but no right
% justification. From plain.tex.
\envdef\raggedright{%
\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
}
\let\Eraggedright\par
\envdef\raggedleft{%
\parindent=0pt \leftskip0pt plus2em
\spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
\hbadness=10000 % Last line will usually be underfull, so turn off
% badness reporting.
}
\let\Eraggedleft\par
\envdef\raggedcenter{%
\parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
\spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
\hbadness=10000 % Last line will usually be underfull, so turn off
% badness reporting.
}
\let\Eraggedcenter\par
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins. We keep \parskip nonzero in general, since
% we're doing normal filling. So, when using \aboveenvbreak and
% \afterenvbreak, temporarily make \parskip 0.
%
\makedispenvdef{quotation}{\quotationstart}
%
\def\quotationstart{%
\indentedblockstart % same as \indentedblock, but increase right margin too.
\ifx\nonarrowing\relax
\advance\rightskip by \lispnarrowing
\fi
\parsearg\quotationlabel
}
% We have retained a nonzero parskip for the environment, since we're
% doing normal filling.
%
\def\Equotation{%
\par
\ifx\quotationauthor\thisisundefined\else
% indent a bit.
\leftline{\kern 2\leftskip \sl ---\quotationauthor}%
\fi
{\parskip=0pt \afterenvbreak}%
}
\def\Esmallquotation{\Equotation}
% If we're given an argument, typeset it in bold with a colon after.
\def\quotationlabel#1{%
\def\temp{#1}%
\ifx\temp\empty \else
{\bf #1: }%
\fi
}
% @indentedblock is like @quotation, but indents only on the left and
% has no optional argument.
%
\makedispenvdef{indentedblock}{\indentedblockstart}
%
\def\indentedblockstart{%
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
\parindent=0pt
%
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
\ifx\nonarrowing\relax
\advance\leftskip by \lispnarrowing
\exdentamount = \lispnarrowing
\else
\let\nonarrowing = \relax
\fi
}
% Keep a nonzero parskip for the environment, since we're doing normal filling.
%
\def\Eindentedblock{%
\par
{\parskip=0pt \afterenvbreak}%
}
\def\Esmallindentedblock{\Eindentedblock}
% LaTeX-like @verbatim...@end verbatim and @verb{...}
% If we want to allow any as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
%
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
%
% [Knuth] p.344; only we need to do the other characters Texinfo sets
% active too. Otherwise, they get lost as the first character on a
% verbatim line.
\def\dospecials{%
\do\ \do\\\do\{\do\}\do\$\do\&%
\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
\do\<\do\>\do\|\do\@\do+\do\"%
% Don't do the quotes -- if we do, @set txicodequoteundirected and
% @set txicodequotebacktick will not have effect on @verb and
% @verbatim, and ?` and !` ligatures won't get disabled.
%\do\`\do\'%
}
%
% [Knuth] p. 380
\def\uncatcodespecials{%
\def\do##1{\catcode`##1=\other}\dospecials}
%
% Setup for the @verb command.
%
% Eight spaces for a tab
\begingroup
\catcode`\^^I=\active
\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
\endgroup
%
\def\setupverb{%
\tt % easiest (and conventionally used) font for verbatim
\def\par{\leavevmode\endgraf}%
\setupmarkupstyle{verb}%
\tabeightspaces
% Respect line breaks,
% print special symbols as themselves, and
% make each space count
% must do in this order:
\obeylines \uncatcodespecials \sepspaces
}
% Setup for the @verbatim environment
%
% Real tab expansion.
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
% We typeset each line of the verbatim in an \hbox, so we can handle
% tabs. The \global is in case the verbatim line starts with an accent,
% or some other command that starts with a begin-group. Otherwise, the
% entire \verbbox would disappear at the corresponding end-group, before
% it is typeset. Meanwhile, we can't have nested verbatim commands
% (can we?), so the \global won't be overwriting itself.
\newbox\verbbox
\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
%
\begingroup
\catcode`\^^I=\active
\gdef\tabexpand{%
\catcode`\^^I=\active
\def^^I{\leavevmode\egroup
\dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
\divide\dimen\verbbox by\tabw
\multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
\advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
\wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
}%
}
\endgroup
% start the verbatim environment.
\def\setupverbatim{%
\let\nonarrowing = t%
\nonfillstart
\tt % easiest (and conventionally used) font for verbatim
% The \leavevmode here is for blank lines. Otherwise, we would
% never \starttabox and the \egroup would end verbatim mode.
\def\par{\leavevmode\egroup\box\verbbox\endgraf}%
\tabexpand
\setupmarkupstyle{verbatim}%
% Respect line breaks,
% print special symbols as themselves, and
% make each space count.
% Must do in this order:
\obeylines \uncatcodespecials \sepspaces
\everypar{\starttabbox}%
}
% Do the @verb magic: verbatim text is quoted by unique
% delimiter characters. Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
%
% \def\doverb'{'#1'}'{#1}
%
% [Knuth] p. 382; only eat outer {}
\begingroup
\catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
\endgroup
%
\def\verb{\begingroup\setupverb\doverb}
%
%
% Do the @verbatim magic: define the macro \doverbatim so that
% the (first) argument ends when '@end verbatim' is reached, ie:
%
% \def\doverbatim#1@end verbatim{#1}
%
% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'.
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
%
\begingroup
\catcode`\ =\active
\obeylines %
% ignore everything up to the first ^^M, that's the newline at the end
% of the @verbatim input line itself. Otherwise we get an extra blank
% line in the output.
\xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
% We really want {...\end verbatim} in the body of the macro, but
% without the active space; thus we have to use \xdef and \gobble.
\endgroup
%
\envdef\verbatim{%
\setupverbatim\doverbatim
}
\let\Everbatim = \afterenvbreak
% @verbatiminclude FILE - insert text of file in verbatim environment.
%
\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
%
\def\doverbatiminclude#1{%
{%
\makevalueexpandable
\setupverbatim
\indexnofonts % Allow `@@' and other weird things in file names.
\wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
\input #1
\afterenvbreak
}%
}
% @copying ... @end copying.
% Save the text away for @insertcopying later.
%
% We save the uninterpreted tokens, rather than creating a box.
% Saving the text in a box would be much easier, but then all the
% typesetting commands (@smallbook, font changes, etc.) have to be done
% beforehand -- and a) we want @copying to be done first in the source
% file; b) letting users define the frontmatter in as flexible order as
% possible is very desirable.
%
\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
%
\def\insertcopying{%
\begingroup
\parindent = 0pt % paragraph indentation looks wrong on title page
\scanexp\copyingtext
\endgroup
}
\message{defuns,}
% @defun etc.
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
\newskip\deflastargmargin \deflastargmargin=18pt
\newcount\defunpenalty
% Start the processing of @deffn:
\def\startdefun{%
\ifnum\lastpenalty<10000
\medbreak
\defunpenalty=10003 % Will keep this @deffn together with the
% following @def command, see below.
\else
% If there are two @def commands in a row, we'll have a \nobreak,
% which is there to keep the function description together with its
% header. But if there's nothing but headers, we need to allow a
% break somewhere. Check specifically for penalty 10002, inserted
% by \printdefunline, instead of 10000, since the sectioning
% commands also insert a nobreak penalty, and we don't want to allow
% a break between a section heading and a defun.
%
% As a further refinement, we avoid "club" headers by signalling
% with penalty of 10003 after the very first @deffn in the
% sequence (see above), and penalty of 10002 after any following
% @def command.
\ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
%
% Similarly, after a section heading, do not allow a break.
% But do insert the glue.
\medskip % preceded by discardable penalty, so not a breakpoint
\fi
%
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
}
\def\dodefunx#1{%
% First, check whether we are in the right environment:
\checkenv#1%
%
% As above, allow line break if we have multiple x headers in a row.
% It's not a great place, though.
\ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
%
% And now, it's time to reuse the body of the original defun:
\expandafter\gobbledefun#1%
}
\def\gobbledefun#1\startdefun{}
% \printdefunline \deffnheader{text}
%
\def\printdefunline#1#2{%
\begingroup
% call \deffnheader:
#1#2 \endheader
% common ending:
\interlinepenalty = 10000
\advance\rightskip by 0pt plus 1fil\relax
\endgraf
\nobreak\vskip -\parskip
\penalty\defunpenalty % signal to \startdefun and \dodefunx
% Some of the @defun-type tags do not enable magic parentheses,
% rendering the following check redundant. But we don't optimize.
\checkparencounts
\endgroup
}
\def\Edefun{\endgraf\medbreak}
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
% the only thing remaining is to define \deffnheader.
%
\def\makedefun#1{%
\expandafter\let\csname E#1\endcsname = \Edefun
\edef\temp{\noexpand\domakedefun
\makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
\temp
}
% \domakedefun \deffn \deffnx \deffnheader
%
% Define \deffn and \deffnx, without parameters.
% \deffnheader has to be defined explicitly.
%
\def\domakedefun#1#2#3{%
\envdef#1{%
\startdefun
\doingtypefnfalse % distinguish typed functions from all else
\parseargusing\activeparens{\printdefunline#3}%
}%
\def#2{\dodefunx#1}%
\def#3%
}
\newif\ifdoingtypefn % doing typed function?
\newif\ifrettypeownline % typeset return type on its own line?
% @deftypefnnewline on|off says whether the return type of typed functions
% are printed on their own line. This affects @deftypefn, @deftypefun,
% @deftypeop, and @deftypemethod.
%
\parseargdef\deftypefnnewline{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxideftypefnnl\endcsname
= \empty
\else\ifx\temp\offword
\expandafter\let\csname SETtxideftypefnnl\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @txideftypefnnl value `\temp',
must be on|off}%
\fi\fi
}
% Untyped functions:
% @deffn category name args
\makedefun{deffn}{\deffngeneral{}}
% @deffn category class name args
\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
% \defopon {category on}class name args
\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
% \deffngeneral {subind}category name args
%
\def\deffngeneral#1#2 #3 #4\endheader{%
% Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
\dosubind{fn}{\code{#3}}{#1}%
\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
% Typed functions:
% @deftypefn category type name args
\makedefun{deftypefn}{\deftypefngeneral{}}
% @deftypeop category class type name args
\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
% \deftypeopon {category on}class type name args
\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
% \deftypefngeneral {subind}category type name args
%
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
\dosubind{fn}{\code{#4}}{#1}%
\doingtypefntrue
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
% Typed variables:
% @deftypevr category type var args
\makedefun{deftypevr}{\deftypecvgeneral{}}
% @deftypecv category class type var args
\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
% \deftypecvof {category of}class type var args
\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
% \deftypecvgeneral {subind}category type var args
%
\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
\dosubind{vr}{\code{#4}}{#1}%
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
% Untyped variables:
% @defvr category var args
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
% @defcv category class var args
\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
% \defcvof {category of}class var args
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
% Types:
% @deftp category name args
\makedefun{deftp}#1 #2 #3\endheader{%
\doind{tp}{\code{#2}}%
\defname{#1}{}{#2}\defunargs{#3\unskip}%
}
% Remaining @defun-like shortcuts:
\makedefun{defun}{\deffnheader{\putwordDeffunc} }
\makedefun{defmac}{\deffnheader{\putwordDefmac} }
\makedefun{defspec}{\deffnheader{\putwordDefspec} }
\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
\makedefun{defvar}{\defvrheader{\putwordDefvar} }
\makedefun{defopt}{\defvrheader{\putwordDefopt} }
\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
\makedefun{defmethod}{\defopon\putwordMethodon}
\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
% \defname, which formats the name of the @def (not the args).
% #1 is the category, such as "Function".
% #2 is the return type, if any.
% #3 is the function name.
%
% We are followed by (but not passed) the arguments, if any.
%
\def\defname#1#2#3{%
\par
% Get the values of \leftskip and \rightskip as they were outside the @def...
\advance\leftskip by -\defbodyindent
%
% Determine if we are typesetting the return type of a typed function
% on a line by itself.
\rettypeownlinefalse
\ifdoingtypefn % doing a typed function specifically?
% then check user option for putting return type on its own line:
\expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
\rettypeownlinetrue
\fi
\fi
%
% How we'll format the category name. Putting it in brackets helps
% distinguish it from the body text that may end up on the next line
% just below it.
\def\temp{#1}%
\setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
%
% Figure out line sizes for the paragraph shape. We'll always have at
% least two.
\tempnum = 2
%
% The first line needs space for \box0; but if \rightskip is nonzero,
% we need only space for the part of \box0 which exceeds it:
\dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
%
% If doing a return type on its own line, we'll have another line.
\ifrettypeownline
\advance\tempnum by 1
\def\maybeshapeline{0in \hsize}%
\else
\def\maybeshapeline{}%
\fi
%
% The continuations:
\dimen2=\hsize \advance\dimen2 by -\defargsindent
%
% The final paragraph shape:
\parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
%
% Put the category name at the right margin.
\noindent
\hbox to 0pt{%
\hfil\box0 \kern-\hsize
% \hsize has to be shortened this way:
\kern\leftskip
% Intentionally do not respect \rightskip, since we need the space.
}%
%
% Allow all lines to be underfull without complaint:
\tolerance=10000 \hbadness=10000
\exdentamount=\defbodyindent
{%
% defun fonts. We use typewriter by default (used to be bold) because:
% . we're printing identifiers, they should be in tt in principle.
% . in languages with many accents, such as Czech or French, it's
% common to leave accents off identifiers. The result looks ok in
% tt, but exceedingly strange in rm.
% . we don't want -- and --- to be treated as ligatures.
% . this still does not fix the ?` and !` ligatures, but so far no
% one has made identifiers using them :).
\df \tt
\def\temp{#2}% text of the return type
\ifx\temp\empty\else
\tclose{\temp}% typeset the return type
\ifrettypeownline
% put return type on its own line; prohibit line break following:
\hfil\vadjust{\nobreak}\break
\else
\space % type on same line, so just followed by a space
\fi
\fi % no return type
#3% output function name
}%
{\rm\enskip}% hskip 0.5 em of \tenrm
%
\boldbrax
% arguments will be output next, if any.
}
% Print arguments in slanted roman (not ttsl), inconsistently with using
% tt for the name. This is because literal text is sometimes needed in
% the argument list (groff manual), and ttsl and tt are not very
% distinguishable. Prevent hyphenation at `-' chars.
%
\def\defunargs#1{%
% use sl by default (not ttsl),
% tt for the names.
\df \sl \hyphenchar\font=0
%
% On the other hand, if an argument has two dashes (for instance), we
% want a way to get ttsl. We used to recommend @var for that, so
% leave the code in, but it's strange for @var to lead to typewriter.
% Nowadays we recommend @code, since the difference between a ttsl hyphen
% and a tt hyphen is pretty tiny. @code also disables ?` !`.
\def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
#1%
\sl\hyphenchar\font=45
}
% We want ()&[] to print specially on the defun line.
%
\def\activeparens{%
\catcode`\(=\active \catcode`\)=\active
\catcode`\[=\active \catcode`\]=\active
\catcode`\&=\active
}
% Make control sequences which act like normal parenthesis chars.
\let\lparen = ( \let\rparen = )
% Be sure that we always have a definition for `(', etc. For example,
% if the fn name has parens in it, \boldbrax will not be in effect yet,
% so TeX would otherwise complain about undefined control sequence.
{
\activeparens
\global\let(=\lparen \global\let)=\rparen
\global\let[=\lbrack \global\let]=\rbrack
\global\let& = \&
\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
\gdef\magicamp{\let&=\amprm}
}
\newcount\parencount
% If we encounter &foo, then turn on ()-hacking afterwards
\newif\ifampseen
\def\amprm#1 {\ampseentrue{\bf\ }}
\def\parenfont{%
\ifampseen
% At the first level, print parens in roman,
% otherwise use the default font.
\ifnum \parencount=1 \rm \fi
\else
% The \sf parens (in \boldbrax) actually are a little bolder than
% the contained text. This is especially needed for [ and ] .
\sf
\fi
}
\def\infirstlevel#1{%
\ifampseen
\ifnum\parencount=1
#1%
\fi
\fi
}
\def\bfafterword#1 {#1 \bf}
\def\opnr{%
\global\advance\parencount by 1
{\parenfont(}%
\infirstlevel \bfafterword
}
\def\clnr{%
{\parenfont)}%
\infirstlevel \sl
\global\advance\parencount by -1
}
\newcount\brackcount
\def\lbrb{%
\global\advance\brackcount by 1
{\bf[}%
}
\def\rbrb{%
{\bf]}%
\global\advance\brackcount by -1
}
\def\checkparencounts{%
\ifnum\parencount=0 \else \badparencount \fi
\ifnum\brackcount=0 \else \badbrackcount \fi
}
% these should not use \errmessage; the glibc manual, at least, actually
% has such constructs (when documenting function pointers).
\def\badparencount{%
\message{Warning: unbalanced parentheses in @def...}%
\global\parencount=0
}
\def\badbrackcount{%
\message{Warning: unbalanced square brackets in @def...}%
\global\brackcount=0
}
\message{macros,}
% @macro.
% To do this right we need a feature of e-TeX, \scantokens,
% which we arrange to emulate with a temporary file in ordinary TeX.
\ifx\eTeXversion\thisisundefined
\newwrite\macscribble
\def\scantokens#1{%
\toks0={#1}%
\immediate\openout\macscribble=\jobname.tmp
\immediate\write\macscribble{\the\toks0}%
\immediate\closeout\macscribble
\input \jobname.tmp
}
\fi
\def\scanmacro#1{\begingroup
\newlinechar`\^^M
\let\xeatspaces\eatspaces
%
% Undo catcode changes of \startcontents and \doprintindex
% When called from @insertcopying or (short)caption, we need active
% backslash to get it printed correctly. Previously, we had
% \catcode`\\=\other instead. We'll see whether a problem appears
% with macro expansion. --kasal, 19aug04
\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
%
% ... and for \example:
\spaceisspace
%
% The \empty here causes a following catcode 5 newline to be eaten as
% part of reading whitespace after a control sequence. It does not
% eat a catcode 13 newline. There's no good way to handle the two
% cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
% would then have different behavior). See the Macro Details node in
% the manual for the workaround we recommend for macros and
% line-oriented commands.
%
\scantokens{#1\empty}%
\endgroup}
\def\scanexp#1{%
\edef\temp{\noexpand\scanmacro{#1}}%
\temp
}
\newcount\paramno % Count of parameters
\newtoks\macname % Macro name
\newif\ifrecursive % Is it recursive?
% List of all defined macros in the form
% \definedummyword\macro1\definedummyword\macro2...
% Currently is also contains all @aliases; the list can be split
% if there is a need.
\def\macrolist{}
% Add the macro to \macrolist
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
\def\addtomacrolistxxx#1{%
\toks0 = \expandafter{\macrolist\definedummyword#1}%
\xdef\macrolist{\the\toks0}%
}
% Utility routines.
% This does \let #1 = #2, with \csnames; that is,
% \let \csname#1\endcsname = \csname#2\endcsname
% (except of course we have to play expansion games).
%
\def\cslet#1#2{%
\expandafter\let
\csname#1\expandafter\endcsname
\csname#2\endcsname
}
% Trim leading and trailing spaces off a string.
% Concepts from aro-bend problem 15 (see CTAN).
{\catcode`\@=11
\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
\def\unbrace#1{#1}
\unbrace{\gdef\trim@@@ #1 } #2@{#1}
}
% Trim a single trailing ^^M off a string.
{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}%
}
% Macro bodies are absorbed as an argument in a context where
% all characters are catcode 10, 11 or 12, except \ which is active
% (as in normal texinfo). It is necessary to change the definition of \
% to recognize macro arguments; this is the job of \mbodybackslash.
%
% Non-ASCII encodings make 8-bit characters active, so un-activate
% them to avoid their expansion. Must do this non-globally, to
% confine the change to the current group.
%
% It's necessary to have hard CRs when the macro is executed. This is
% done by making ^^M (\endlinechar) catcode 12 when reading the macro
% body, and then making it the \newlinechar in \scanmacro.
%
\def\scanctxt{% used as subroutine
\catcode`\"=\other
\catcode`\+=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\@=\other
\catcode`\^=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\~=\other
\ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
}
\def\scanargctxt{% used for copying and captions, not macros.
\scanctxt
\catcode`\\=\other
\catcode`\^^M=\other
}
\def\macrobodyctxt{% used for @macro definitions
\scanctxt
\catcode`\{=\other
\catcode`\}=\other
\catcode`\^^M=\other
\usembodybackslash
}
\def\macroargctxt{% used when scanning invocations
\scanctxt
\catcode`\\=0
}
% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
% for the single characters \ { }. Thus, we end up with the "commands"
% that would be written @\ @{ @} in a Texinfo document.
%
% We already have @{ and @}. For @\, we define it here, and only for
% this purpose, to produce a typewriter backslash (so, the @\ that we
% define for @math can't be used with @macro calls):
%
\def\\{\normalbackslash}%
%
% We would like to do this for \, too, since that is what makeinfo does.
% But it is not possible, because Texinfo already has a command @, for a
% cedilla accent. Documents must use @comma{} instead.
%
% \anythingelse will almost certainly be an error of some kind.
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
% where N is the macro parameter number.
% We define \csname macarg.\endcsname to be \realbackslash, so
% \\ in macro replacement text gets you a backslash.
%
{\catcode`@=0 @catcode`@\=@active
@gdef@usembodybackslash{@let\=@mbodybackslash}
@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
}
\expandafter\def\csname macarg.\endcsname{\realbackslash}
\def\margbackslash#1{\char`\#1 }
\def\macro{\recursivefalse\parsearg\macroxxx}
\def\rmacro{\recursivetrue\parsearg\macroxxx}
\def\macroxxx#1{%
\getargs{#1}% now \macname is the macname and \argl the arglist
\ifx\argl\empty % no arguments
\paramno=0\relax
\else
\expandafter\parsemargdef \argl;%
\if\paramno>256\relax
\ifx\eTeXversion\thisisundefined
\errhelp = \EMsimple
\errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
\fi
\fi
\fi
\if1\csname ismacro.\the\macname\endcsname
\message{Warning: redefining \the\macname}%
\else
\expandafter\ifx\csname \the\macname\endcsname \relax
\else \errmessage{Macro name \the\macname\space already defined}\fi
\global\cslet{macsave.\the\macname}{\the\macname}%
\global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
\addtomacrolist{\the\macname}%
\fi
\begingroup \macrobodyctxt
\ifrecursive \expandafter\parsermacbody
\else \expandafter\parsemacbody
\fi}
\parseargdef\unmacro{%
\if1\csname ismacro.#1\endcsname
\global\cslet{#1}{macsave.#1}%
\global\expandafter\let \csname ismacro.#1\endcsname=0%
% Remove the macro name from \macrolist:
\begingroup
\expandafter\let\csname#1\endcsname \relax
\let\definedummyword\unmacrodo
\xdef\macrolist{\macrolist}%
\endgroup
\else
\errmessage{Macro #1 not defined}%
\fi
}
% Called by \do from \dounmacro on each macro. The idea is to omit any
% macro definitions that have been changed to \relax.
%
\def\unmacrodo#1{%
\ifx #1\relax
% remove this
\else
\noexpand\definedummyword \noexpand#1%
\fi
}
% This makes use of the obscure feature that if the last token of a
% is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed.
\def\getargs#1{\getargsxxx#1{}}
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
\def\getmacname#1 #2\relax{\macname={#1}}
\def\getmacargs#1{\def\argl{#1}}
% For macro processing make @ a letter so that we can make Texinfo private macro names.
\edef\texiatcatcode{\the\catcode`\@}
\catcode `@=11\relax
% Parse the optional {params} list. Set up \paramno and \paramlist
% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
% in the params list to some hook where the argument si to be expanded. If
% there are less than 10 arguments that hook is to be replaced by ##N where N
% is the position in that list, that is to say the macro arguments are to be
% defined `a la TeX in the macro body.
%
% That gets used by \mbodybackslash (above).
%
% We need to get `macro parameter char #' into several definitions.
% The technique used is stolen from LaTeX: let \hash be something
% unexpandable, insert that wherever you need a #, and then redefine
% it to # just before using the token list produced.
%
% The same technique is used to protect \eatspaces till just before
% the macro is used.
%
% If there are 10 or more arguments, a different technique is used, where the
% hook remains in the body, and when macro is to be expanded the body is
% processed again to replace the arguments.
%
% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
% argument N value and then \edef the body (nothing else will expand because of
% the catcode regime underwhich the body was input).
%
% If you compile with TeX (not eTeX), and you have macros with 10 or more
% arguments, you need that no macro has more than 256 arguments, otherwise an
% error is produced.
\def\parsemargdef#1;{%
\paramno=0\def\paramlist{}%
\let\hash\relax
\let\xeatspaces\relax
\parsemargdefxxx#1,;,%
% In case that there are 10 or more arguments we parse again the arguments
% list to set new definitions for the \macarg.BLAH macros corresponding to
% each BLAH argument. It was anyhow needed to parse already once this list
% in order to count the arguments, and as macros with at most 9 arguments
% are by far more frequent than macro with 10 or more arguments, defining
% twice the \macarg.BLAH macros does not cost too much processing power.
\ifnum\paramno<10\relax\else
\paramno0\relax
\parsemmanyargdef@@#1,;,% 10 or more arguments
\fi
}
\def\parsemargdefxxx#1,{%
\if#1;\let\next=\relax
\else \let\next=\parsemargdefxxx
\advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
{\xeatspaces{\hash\the\paramno}}%
\edef\paramlist{\paramlist\hash\the\paramno,}%
\fi\next}
\def\parsemmanyargdef@@#1,{%
\if#1;\let\next=\relax
\else
\let\next=\parsemmanyargdef@@
\edef\tempb{\eatspaces{#1}}%
\expandafter\def\expandafter\tempa
\expandafter{\csname macarg.\tempb\endcsname}%
% Note that we need some extra \noexpand\noexpand, this is because we
% don't want \the to be expanded in the \parsermacbody as it uses an
% \xdef .
\expandafter\edef\tempa
{\noexpand\noexpand\noexpand\the\toks\the\paramno}%
\advance\paramno by 1\relax
\fi\next}
% These two commands read recursive and nonrecursive macro bodies.
% (They're different since rec and nonrec macros end differently.)
%
\catcode `\@\texiatcatcode
\long\def\parsemacbody#1@end macro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
\long\def\parsermacbody#1@end rmacro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
\catcode `\@=11\relax
\let\endargs@\relax
\let\nil@\relax
\def\nilm@{\nil@}%
\long\def\nillm@{\nil@}%
% This macro is expanded during the Texinfo macro expansion, not during its
% definition. It gets all the arguments values and assigns them to macros
% macarg.ARGNAME
%
% #1 is the macro name
% #2 is the list of argument names
% #3 is the list of argument values
\def\getargvals@#1#2#3{%
\def\macargdeflist@{}%
\def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
\def\paramlist{#2,\nil@}%
\def\macroname{#1}%
\begingroup
\macroargctxt
\def\argvaluelist{#3,\nil@}%
\def\@tempa{#3}%
\ifx\@tempa\empty
\setemptyargvalues@
\else
\getargvals@@
\fi
}
%
\def\getargvals@@{%
\ifx\paramlist\nilm@
% Some sanity check needed here that \argvaluelist is also empty.
\ifx\argvaluelist\nillm@
\else
\errhelp = \EMsimple
\errmessage{Too many arguments in macro `\macroname'!}%
\fi
\let\next\macargexpandinbody@
\else
\ifx\argvaluelist\nillm@
% No more arguments values passed to macro. Set remaining named-arg
% macros to empty.
\let\next\setemptyargvalues@
\else
% pop current arg name into \@tempb
\def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
\expandafter\@tempa\expandafter{\paramlist}%
% pop current argument value into \@tempc
\def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
\expandafter\@tempa\expandafter{\argvaluelist}%
% Here \@tempb is the current arg name and \@tempc is the current arg value.
% First place the new argument macro definition into \@tempd
\expandafter\macname\expandafter{\@tempc}%
\expandafter\let\csname macarg.\@tempb\endcsname\relax
\expandafter\def\expandafter\@tempe\expandafter{%
\csname macarg.\@tempb\endcsname}%
\edef\@tempd{\long\def\@tempe{\the\macname}}%
\push@\@tempd\macargdeflist@
\let\next\getargvals@@
\fi
\fi
\next
}
\def\push@#1#2{%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter#2%
\expandafter\expandafter\expandafter{%
\expandafter#1#2}%
}
% Replace arguments by their values in the macro body, and place the result
% in macro \@tempa
\def\macvalstoargs@{%
% To do this we use the property that token registers that are \the'ed
% within an \edef expand only once. So we are going to place all argument
% values into respective token registers.
%
% First we save the token context, and initialize argument numbering.
\begingroup
\paramno0\relax
% Then, for each argument number #N, we place the corresponding argument
% value into a new token list register \toks#N
\expandafter\putargsintokens@\saveparamlist@,;,%
% Then, we expand the body so that argument are replaced by their
% values. The trick for values not to be expanded themselves is that they
% are within tokens and that tokens expand only once in an \edef .
\edef\@tempc{\csname mac.\macroname .body\endcsname}%
% Now we restore the token stack pointer to free the token list registers
% which we have used, but we make sure that expanded body is saved after
% group.
\expandafter
\endgroup
\expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
}
\def\macargexpandinbody@{%
%% Define the named-macro outside of this group and then close this group.
\expandafter
\endgroup
\macargdeflist@
% First the replace in body the macro arguments by their values, the result
% is in \@tempa .
\macvalstoargs@
% Then we point at the \norecurse or \gobble (for recursive) macro value
% with \@tempb .
\expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
% Depending on whether it is recursive or not, we need some tailing
% \egroup .
\ifx\@tempb\gobble
\let\@tempc\relax
\else
\let\@tempc\egroup
\fi
% And now we do the real job:
\edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
\@tempd
}
\def\putargsintokens@#1,{%
\if#1;\let\next\relax
\else
\let\next\putargsintokens@
% First we allocate the new token list register, and give it a temporary
% alias \@tempb .
\toksdef\@tempb\the\paramno
% Then we place the argument value into that token list register.
\expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
\expandafter\@tempb\expandafter{\@tempa}%
\advance\paramno by 1\relax
\fi
\next
}
% Save the token stack pointer into macro #1
\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
% Restore the token stack pointer from number in macro #1
\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
% newtoks that can be used non \outer .
\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
% Tailing missing arguments are set to empty
\def\setemptyargvalues@{%
\ifx\paramlist\nilm@
\let\next\macargexpandinbody@
\else
\expandafter\setemptyargvaluesparser@\paramlist\endargs@
\let\next\setemptyargvalues@
\fi
\next
}
\def\setemptyargvaluesparser@#1,#2\endargs@{%
\expandafter\def\expandafter\@tempa\expandafter{%
\expandafter\def\csname macarg.#1\endcsname{}}%
\push@\@tempa\macargdeflist@
\def\paramlist{#2}%
}
% #1 is the element target macro
% #2 is the list macro
% #3,#4\endargs@ is the list value
\def\pop@#1#2#3,#4\endargs@{%
\def#1{#3}%
\def#2{#4}%
}
\long\def\longpop@#1#2#3,#4\endargs@{%
\long\def#1{#3}%
\long\def#2{#4}%
}
% This defines a Texinfo @macro. There are eight cases: recursive and
% nonrecursive macros of zero, one, up to nine, and many arguments.
% Much magic with \expandafter here.
% \xdef is used so that macro definitions will survive the file
% they're defined in; @include reads the file inside a group.
%
\def\defmacro{%
\let\hash=##% convert placeholders to macro parameter chars
\ifrecursive
\ifcase\paramno
% 0
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\scanmacro{\temp}}%
\or % 1
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup\noexpand\macroargctxt
\noexpand\braceorline
\expandafter\noexpand\csname\the\macname xxx\endcsname}%
\expandafter\xdef\csname\the\macname xxx\endcsname##1{%
\egroup\noexpand\scanmacro{\temp}}%
\else
\ifnum\paramno<10\relax % at most 9
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup\noexpand\macroargctxt
\noexpand\csname\the\macname xx\endcsname}%
\expandafter\xdef\csname\the\macname xx\endcsname##1{%
\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
\expandafter\expandafter
\expandafter\xdef
\expandafter\expandafter
\csname\the\macname xxx\endcsname
\paramlist{\egroup\noexpand\scanmacro{\temp}}%
\else % 10 or more
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\getargvals@{\the\macname}{\argl}%
}%
\global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
\global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
\fi
\fi
\else
\ifcase\paramno
% 0
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\norecurse{\the\macname}%
\noexpand\scanmacro{\temp}\egroup}%
\or % 1
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup\noexpand\macroargctxt
\noexpand\braceorline
\expandafter\noexpand\csname\the\macname xxx\endcsname}%
\expandafter\xdef\csname\the\macname xxx\endcsname##1{%
\egroup
\noexpand\norecurse{\the\macname}%
\noexpand\scanmacro{\temp}\egroup}%
\else % at most 9
\ifnum\paramno<10\relax
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup\noexpand\macroargctxt
\expandafter\noexpand\csname\the\macname xx\endcsname}%
\expandafter\xdef\csname\the\macname xx\endcsname##1{%
\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
\expandafter\expandafter
\expandafter\xdef
\expandafter\expandafter
\csname\the\macname xxx\endcsname
\paramlist{%
\egroup
\noexpand\norecurse{\the\macname}%
\noexpand\scanmacro{\temp}\egroup}%
\else % 10 or more:
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\getargvals@{\the\macname}{\argl}%
}%
\global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
\global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
\fi
\fi
\fi}
\catcode `\@\texiatcatcode\relax
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
% \braceorline decides whether the next nonwhitespace character is a
% {. If so it reads up to the closing }, if not, it reads the whole
% line. Whatever was read is then fed to the next control sequence
% as an argument (by \parsebrace or \parsearg).
%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\ifx\nchar\bgroup\else
\expandafter\parsearg
\fi \macnamexxx}
% @alias.
% We need some trickery to remove the optional spaces around the equal
% sign. Make them active and then expand them all to nothing.
%
\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasyyy #1=#2\relax{%
{%
\expandafter\let\obeyedspace=\empty
\addtomacrolist{#1}%
\xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
}%
\next
}
\message{cross references,}
\newwrite\auxfile
\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{%
\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
% @node's only job in TeX is to define \lastnode, which is used in
% cross-references. The @node line might or might not have commas, and
% might or might not have spaces before the first comma, like:
% @node foo , bar , ...
% We don't want such trailing spaces in the node name.
%
\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
%
% also remove a trailing comma, in case of something like this:
% @node Help-Cross, , , Cross-refs
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
\let\nwnode=\node
\let\lastnode=\empty
% Write a cross-reference definition for the current node. #1 is the
% type (Ynumbered, Yappendix, Ynothing).
%
\def\donoderef#1{%
\ifx\lastnode\empty\else
\setref{\lastnode}{#1}%
\global\let\lastnode=\empty
\fi
}
% @anchor{NAME} -- define xref target at arbitrary point.
%
\newcount\savesfregister
%
\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% anchor), which consists of three parts:
% 1) NAME-title - the current sectioning name taken from \lastsection,
% or the anchor name.
% 2) NAME-snt - section number and type, passed as the SNT arg, or
% empty for anchors.
% 3) NAME-pg - the page number.
%
% This is called from \donoderef, \anchor, and \dofloat. In the case of
% floats, there is an additional part, which is not written here:
% 4) NAME-lof - the text as it should appear in a @listoffloats.
%
\def\setref#1#2{%
\pdfmkdest{#1}%
\iflinks
{%
\atdummies % preserve commands, but don't expand them
\edef\writexrdef##1##2{%
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
}%
\toks0 = \expandafter{\lastsection}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
\safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
}%
\fi
}
% @xrefautosectiontitle on|off says whether @section(ing) names are used
% automatically in xrefs, if the third arg is not explicitly specified.
% This was provided as a "secret" @set xref-automatic-section-title
% variable, now it's official.
%
\parseargdef\xrefautomaticsectiontitle{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETxref-automatic-section-title\endcsname
= \empty
\else\ifx\temp\offword
\expandafter\let\csname SETxref-automatic-section-title\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
must be on|off}%
\fi\fi
}
%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
% manual. All but the node name can be omitted.
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
%
\newbox\toprefbox
\newbox\printedrefnamebox
\newbox\infofilenamebox
\newbox\printedmanualbox
%
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces
%
% Get args without leading/trailing spaces.
\def\printedrefname{\ignorespaces #3}%
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
%
\def\infofilename{\ignorespaces #4}%
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
%
\def\printedmanual{\ignorespaces #5}%
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
%
% If the printed reference name (arg #3) was not explicitly given in
% the @xref, figure out what we want to use.
\ifdim \wd\printedrefnamebox = 0pt
% No printed node name was explicitly given.
\expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
% Not auto section-title: use node name inside the square brackets.
\def\printedrefname{\ignorespaces #1}%
\else
% Auto section-title: use chapter/section title inside
% the square brackets if we have it.
\ifdim \wd\printedmanualbox > 0pt
% It is in another manual, so we don't have it; use node name.
\def\printedrefname{\ignorespaces #1}%
\else
\ifhavexrefs
% We (should) know the real title if we have the xref values.
\def\printedrefname{\refx{#1-title}{}}%
\else
% Otherwise just copy the Info node name.
\def\printedrefname{\ignorespaces #1}%
\fi%
\fi
\fi
\fi
%
% Make link in pdf output.
\ifpdf
{\indexnofonts
\turnoffactive
\makevalueexpandable
% This expands tokens, so do it after making catcode changes, so _
% etc. don't get their TeX definitions. This ignores all spaces in
% #4, including (wrongly) those in the middle of the filename.
\getfilename{#4}%
%
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
\edef\pdfxrefdest{#1}%
\ifx\pdfxrefdest\empty
\def\pdfxrefdest{Top}% no empty targets
\else
\txiescapepdf\pdfxrefdest % escape PDF special chars
\fi
%
\leavevmode
\startlink attr{/Border [0 0 0]}%
\ifnum\filenamelength>0
goto file{\the\filename.pdf} name{\pdfxrefdest}%
\else
goto name{\pdfmkpgn{\pdfxrefdest}}%
\fi
}%
\setcolor{\linkcolor}%
\fi
%
% Float references are printed completely differently: "Figure 1.2"
% instead of "[somenode], p.3". We distinguish them by the
% LABEL-title being set to a magic string.
{%
% Have to otherify everything special to allow the \csname to
% include an _ in the xref name, etc.
\indexnofonts
\turnoffactive
\expandafter\global\expandafter\let\expandafter\Xthisreftitle
\csname XR#1-title\endcsname
}%
\iffloat\Xthisreftitle
% If the user specified the print name (third arg) to the ref,
% print it instead of our usual "Figure 1.2".
\ifdim\wd\printedrefnamebox = 0pt
\refx{#1-snt}{}%
\else
\printedrefname
\fi
%
% If the user also gave the printed manual name (fifth arg), append
% "in MANUALNAME".
\ifdim \wd\printedmanualbox > 0pt
\space \putwordin{} \cite{\printedmanual}%
\fi
\else
% node/anchor (non-float) references.
%
% If we use \unhbox to print the node names, TeX does not insert
% empty discretionaries after hyphens, which means that it will not
% find a line break at a hyphen in a node names. Since some manuals
% are best written with fairly long node names, containing hyphens,
% this is a loss. Therefore, we give the text of the node name
% again, so it is as if TeX is seeing it for the first time.
%
\ifdim \wd\printedmanualbox > 0pt
% Cross-manual reference with a printed manual name.
%
\crossmanualxref{\cite{\printedmanual\unskip}}%
%
\else\ifdim \wd\infofilenamebox > 0pt
% Cross-manual reference with only an info filename (arg 4), no
% printed manual name (arg 5). This is essentially the same as
% the case above; we output the filename, since we have nothing else.
%
\crossmanualxref{\code{\infofilename\unskip}}%
%
\else
% Reference within this manual.
%
% _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
{\turnoffactive
% Only output a following space if the -snt ref is nonempty; for
% @unnumbered and @anchor, it won't be.
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
}%
% output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
%
% But we always want a comma and a space:
,\space
%
% output the `page 3'.
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi\fi
\fi
\endlink
\endgroup}
% Output a cross-manual xref to #1. Used just above (twice).
%
% Only include the text "Section ``foo'' in" if the foo is neither
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
% "see The Foo Manual", the idea being to refer to the whole manual.
%
% But, this being TeX, we can't easily compare our node name against the
% string "Top" while ignoring the possible spaces before and after in
% the input. By adding the arbitrary 7sp below, we make it much less
% likely that a real node name would have the same width as "Top" (e.g.,
% in a monospaced font). Hopefully it will never happen in practice.
%
% For the same basic reason, we retypeset the "Top" at every
% reference, since the current font is indeterminate.
%
\def\crossmanualxref#1{%
\setbox\toprefbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
\ifdim \wd2 > 7sp % nonempty?
\ifdim \wd2 = \wd\toprefbox \else % same as Top?
\putwordSection{} ``\printedrefname'' \putwordin{}\space
\fi
\fi
#1%
}
% This macro is called from \xrefX for the `[nodename]' part of xref
% output. It's a separate macro only so it can be changed more easily,
% since square brackets don't work well in some documents. Particularly
% one that Bob is working on :).
%
\def\xrefprintnodename#1{[#1]}
% Things referred to by \setref.
%
\def\Ynothing{}
\def\Yomitfromtoc{}
\def\Ynumbered{%
\ifnum\secno=0
\putwordChapter@tie \the\chapno
\else \ifnum\subsecno=0
\putwordSection@tie \the\chapno.\the\secno
\else \ifnum\subsubsecno=0
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno
\else
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
\def\Yappendix{%
\ifnum\secno=0
\putwordAppendix@tie @char\the\appendixno{}%
\else \ifnum\subsecno=0
\putwordSection@tie @char\the\appendixno.\the\secno
\else \ifnum\subsubsecno=0
\putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
\else
\putwordSection@tie
@char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.
%
\def\refx#1#2{%
{%
\indexnofonts
\otherbackslash
\expandafter\global\expandafter\let\expandafter\thisrefX
\csname XR#1\endcsname
}%
\ifx\thisrefX\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
\iflinks
\ifhavexrefs
{\toks0 = {#1}% avoid expansion of possibly-complex value
\message{\linenumber Undefined cross reference `\the\toks0'.}}%
\else
\ifwarnedxrefs\else
\global\warnedxrefstrue
\message{Cross reference values unknown; you must run TeX again.}%
\fi
\fi
\fi
\else
% It's defined, so just use it.
\thisrefX
\fi
#2% Output the suffix in any case.
}
% This is the macro invoked by entries in the aux file. Usually it's
% just a \def (we prepend XR to the control sequence name to avoid
% collisions). But if this is a float type, we have more work to do.
%
\def\xrdef#1#2{%
{% The node name might contain 8-bit characters, which in our current
% implementation are changed to commands like @'e. Don't let these
% mess up the control sequence name.
\indexnofonts
\turnoffactive
\xdef\safexrefname{#1}%
}%
%
\expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
%
% Was that xref control sequence that we just defined for a float?
\expandafter\iffloat\csname XR\safexrefname\endcsname
% it was a float, and we have the (safe) float type in \iffloattype.
\expandafter\let\expandafter\floatlist
\csname floatlist\iffloattype\endcsname
%
% Is this the first time we've seen this float type?
\expandafter\ifx\floatlist\relax
\toks0 = {\do}% yes, so just \do
\else
% had it before, so preserve previous elements in list.
\toks0 = \expandafter{\floatlist\do}%
\fi
%
% Remember this xref in the control sequence \floatlistFLOATTYPE,
% for later use in \listoffloats.
\expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
{\safexrefname}}%
\fi
}
% Read the last existing aux file, if any. No error if none exists.
%
\def\tryauxfile{%
\openin 1 \jobname.aux
\ifeof 1 \else
\readdatafile{aux}%
\global\havexrefstrue
\fi
\closein 1
}
\def\setupdatafile{%
\catcode`\^^@=\other
\catcode`\^^A=\other
\catcode`\^^B=\other
\catcode`\^^C=\other
\catcode`\^^D=\other
\catcode`\^^E=\other
\catcode`\^^F=\other
\catcode`\^^G=\other
\catcode`\^^H=\other
\catcode`\^^K=\other
\catcode`\^^L=\other
\catcode`\^^N=\other
\catcode`\^^P=\other
\catcode`\^^Q=\other
\catcode`\^^R=\other
\catcode`\^^S=\other
\catcode`\^^T=\other
\catcode`\^^U=\other
\catcode`\^^V=\other
\catcode`\^^W=\other
\catcode`\^^X=\other
\catcode`\^^Z=\other
\catcode`\^^[=\other
\catcode`\^^\=\other
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
% It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
% in xref tags, i.e., node names. But since ^^e4 notation isn't
% supported in the main text, it doesn't seem desirable. Furthermore,
% that is not enough: for node names that actually contain a ^
% character, we would end up writing a line like this: 'xrdef {'hat
% b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
% argument, and \hat is not an expandable control sequence. It could
% all be worked out, but why? Either we support ^^ or we don't.
%
% The other change necessary for this was to define \auxhat:
% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
% and then to call \auxhat in \setq.
%
\catcode`\^=\other
%
% Special characters. Should be turned off anyway, but...
\catcode`\~=\other
\catcode`\[=\other
\catcode`\]=\other
\catcode`\"=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
% This is to support \ in node names and titles, since the \
% characters end up in a \csname. It's easier than
% leaving it active and making its active definition an actual \
% character. What I don't understand is why it works in the *value*
% of the xrdef. Seems like it should be a catcode12 \, and that
% should not typeset properly. But it works, so I'm moving on for
% now. --karl, 15jan04.
\catcode`\\=\other
%
% Make the characters 128-255 be printing characters.
{%
\count1=128
\def\loop{%
\catcode\count1=\other
\advance\count1 by 1
\ifnum \count1<256 \loop \fi
}%
}%
%
% @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
\catcode`\}=2
\catcode`\@=0
}
\def\readdatafile#1{%
\begingroup
\setupdatafile
\input\jobname.#1
\endgroup}
\message{insertions,}
% including footnotes.
\newcount \footnoteno
% The trailing space in the following definition for supereject is
% vital for proper filling; pages come out unaligned when you do a
% pagealignmacro call if that space before the closing brace is
% removed. (Generally, numeric constants should always be followed by a
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
% @footnotestyle is meaningful for Info output only.
\let\footnotestyle=\comment
{\catcode `\@=11
%
% Auto-number footnotes. Otherwise like plain.
\gdef\footnote{%
\let\indent=\ptexindent
\let\noindent=\ptexnoindent
\global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}%
%
% In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number.
\let\@sf\empty
\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
%
% Remove inadvertent blank space before typesetting the footnote number.
\unskip
\thisfootno\@sf
\dofootnote
}%
% Don't bother with the trickery in plain.tex to not require the
% footnote text as a parameter. Our footnotes don't need to be so general.
%
% Oh yes, they do; otherwise, @ifset (and anything else that uses
% \parseargline) fails inside footnotes because the tokens are fixed when
% the footnote is read. --karl, 16nov96.
%
\gdef\dofootnote{%
\insert\footins\bgroup
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
\hsize=\pagewidth
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox
\floatingpenalty\@MM
\leftskip\z@skip
\rightskip\z@skip
\spaceskip\z@skip
\xspaceskip\z@skip
\parindent\defaultparindent
%
\smallfonts \rm
%
% Because we use hanging indentation in footnotes, a @noindent appears
% to exdent this text, so make it be a no-op. makeinfo does not use
% hanging indentation so @noindent can still be needed within footnote
% text after an @example or the like (not that this is good style).
\let\noindent = \relax
%
% Hang the footnote text off the number. Use \everypar in case the
% footnote extends for more than one paragraph.
\everypar = {\hang}%
\textindent{\thisfootno}%
%
% Don't crash into the line above the footnote text. Since this
% expands into a box, it must come within the paragraph, lest it
% provide a place where TeX can split the footnote.
\footstrut
%
% Invoke rest of plain TeX footnote routine.
\futurelet\next\fo@t
}
}%end \catcode `\@=11
% In case a @footnote appears in a vbox, save the footnote text and create
% the real \insert just after the vbox finished. Otherwise, the insertion
% would be lost.
% Similarly, if a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is finished.
% And the same can be done for other insert classes. --kasal, 16nov03.
% Replace the \insert primitive by a cheating macro.
% Deeper inside, just make sure that the saved insertions are not spilled
% out prematurely.
%
\def\startsavinginserts{%
\ifx \insert\ptexinsert
\let\insert\saveinsert
\else
\let\checkinserts\relax
\fi
}
% This \insert replacement works for both \insert\footins{foo} and
% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
%
\def\saveinsert#1{%
\edef\next{\noexpand\savetobox \makeSAVEname#1}%
\afterassignment\next
% swallow the left brace
\let\temp =
}
\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
\def\placesaveins#1{%
\ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
{\box#1}%
}
% eat @SAVE -- beware, all of them have catcode \other:
{
\def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
\gdef\gobblesave @SAVE{}
}
% initialization:
\def\newsaveins #1{%
\edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
\next
}
\def\newsaveinsX #1{%
\csname newbox\endcsname #1%
\expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
\checksaveins #1}%
}
% initialize:
\let\checkinserts\empty
\newsaveins\footins
\newsaveins\margin
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
%
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
\openin 1 = epsf.tex
\ifeof 1 \else
% Do not bother showing banner with epsf.tex v2.7k (available in
% doc/epsf.tex and on ctan).
\def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
\closein 1
%
% We will only complain once about lack of epsf.tex.
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get
it from ftp://tug.org/tex/epsf.tex.}
%
\def\image#1{%
\ifx\epsfbox\thisisundefined
\ifwarnednoepsf \else
\errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}%
\global\warnednoepsftrue
\fi
\else
\imagexxx #1,,,,,\finish
\fi
}
%
% Arguments to @image:
% #1 is (mandatory) image filename; we tack on .eps extension.
% #2 is (optional) width, #3 is (optional) height.
% #4 is (ignored optional) html alt text.
% #5 is (ignored optional) extension.
% #6 is just the usual extra ignored arg for parsing stuff.
\newif\ifimagevmode
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
\catcode`\^^M = 5 % in case we're inside an example
\normalturnoffactive % allow _ et al. in names
% If the image is by itself, center it.
\ifvmode
\imagevmodetrue
\else \ifx\centersub\centerV
% for @center @image, we need a vbox so we can have our vertical space
\imagevmodetrue
\vbox\bgroup % vbox has better behavior than vtop herev
\fi\fi
%
\ifimagevmode
\nobreak\medskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
% above and below.
\nobreak\vskip\parskip
\nobreak
\fi
%
% Leave vertical mode so that indentation from an enclosing
% environment such as @quotation is respected.
% However, if we're at the top level, we don't want the
% normal paragraph indentation.
% On the other hand, if we are in the case of @center @image, we don't
% want to start a paragraph, which will create a hsize-width box and
% eradicate the centering.
\ifx\centersub\centerV\else \noindent \fi
%
% Output the image.
\ifpdf
\dopdfimage{#1}{#2}{#3}%
\else
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
\epsfbox{#1.eps}%
\fi
%
\ifimagevmode
\medskip % space after a standalone image
\fi
\ifx\centersub\centerV \egroup \fi
\endgroup}
% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
% etc. We don't actually implement floating yet, we always include the
% float "here". But it seemed the best name for the future.
%
\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
% There may be a space before second and/or third parameter; delete it.
\def\eatcommaspace#1, {#1,}
% #1 is the optional FLOATTYPE, the text label for this float, typically
% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
% this float will not be numbered and cannot be referred to.
%
% #2 is the optional xref label. Also must be present for the float to
% be referable.
%
% #3 is the optional positioning argument; for now, it is ignored. It
% will somehow specify the positions allowed to float to (here, top, bottom).
%
% We keep a separate counter for each FLOATTYPE, which we reset at each
% chapter-level command.
\let\resetallfloatnos=\empty
%
\def\dofloat#1,#2,#3,#4\finish{%
\let\thiscaption=\empty
\let\thisshortcaption=\empty
%
% don't lose footnotes inside @float.
%
% BEWARE: when the floats start float, we have to issue warning whenever an
% insert appears inside a float which could possibly float. --kasal, 26may04
%
\startsavinginserts
%
% We can't be used inside a paragraph.
\par
%
\vtop\bgroup
\def\floattype{#1}%
\def\floatlabel{#2}%
\def\floatloc{#3}% we do nothing with this yet.
%
\ifx\floattype\empty
\let\safefloattype=\empty
\else
{%
% the floattype might have accents or other special characters,
% but we need to use it in a control sequence name.
\indexnofonts
\turnoffactive
\xdef\safefloattype{\floattype}%
}%
\fi
%
% If label is given but no type, we handle that as the empty type.
\ifx\floatlabel\empty \else
% We want each FLOATTYPE to be numbered separately (Figure 1,
% Table 1, Figure 2, ...). (And if no label, no number.)
%
\expandafter\getfloatno\csname\safefloattype floatno\endcsname
\global\advance\floatno by 1
%
{%
% This magic value for \lastsection is output by \setref as the
% XREFLABEL-title value. \xrefX uses it to distinguish float
% labels (which have a completely different output format) from
% node and anchor labels. And \xrdef uses it to construct the
% lists of floats.
%
\edef\lastsection{\floatmagic=\safefloattype}%
\setref{\floatlabel}{Yfloat}%
}%
\fi
%
% start with \parskip glue, I guess.
\vskip\parskip
%
% Don't suppress indentation if a float happens to start a section.
\restorefirstparagraphindent
}
% we have these possibilities:
% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
% @float Foo,lbl & no caption: Foo 1.1
% @float Foo & @caption{Cap}: Foo: Cap
% @float Foo & no caption: Foo
% @float ,lbl & Caption{Cap}: 1.1: Cap
% @float ,lbl & no caption: 1.1
% @float & @caption{Cap}: Cap
% @float & no caption:
%
\def\Efloat{%
\let\floatident = \empty
%
% In all cases, if we have a float type, it comes first.
\ifx\floattype\empty \else \def\floatident{\floattype}\fi
%
% If we have an xref label, the number comes next.
\ifx\floatlabel\empty \else
\ifx\floattype\empty \else % if also had float type, need tie first.
\appendtomacro\floatident{\tie}%
\fi
% the number.
\appendtomacro\floatident{\chaplevelprefix\the\floatno}%
\fi
%
% Start the printed caption with what we've constructed in
% \floatident, but keep it separate; we need \floatident again.
\let\captionline = \floatident
%
\ifx\thiscaption\empty \else
\ifx\floatident\empty \else
\appendtomacro\captionline{: }% had ident, so need a colon between
\fi
%
% caption text.
\appendtomacro\captionline{\scanexp\thiscaption}%
\fi
%
% If we have anything to print, print it, with space before.
% Eventually this needs to become an \insert.
\ifx\captionline\empty \else
\vskip.5\parskip
\captionline
%
% Space below caption.
\vskip\parskip
\fi
%
% If have an xref label, write the list of floats info. Do this
% after the caption, to avoid chance of it being a breakpoint.
\ifx\floatlabel\empty \else
% Write the text that goes in the lof to the aux file as
% \floatlabel-lof. Besides \floatident, we include the short
% caption if specified, else the full caption if specified, else nothing.
{%
\atdummies
%
% since we read the caption text in the macro world, where ^^M
% is turned into a normal character, we have to scan it back, so
% we don't write the literal three characters "^^M" into the aux file.
\scanexp{%
\xdef\noexpand\gtemp{%
\ifx\thisshortcaption\empty
\thiscaption
\else
\thisshortcaption
\fi
}%
}%
\immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
\ifx\gtemp\empty \else : \gtemp \fi}}%
}%
\fi
\egroup % end of \vtop
%
% place the captured inserts
%
% BEWARE: when the floats start floating, we have to issue warning
% whenever an insert appears inside a float which could possibly
% float. --kasal, 26may04
%
\checkinserts
}
% Append the tokens #2 to the definition of macro #1, not expanding either.
%
\def\appendtomacro#1#2{%
\expandafter\def\expandafter#1\expandafter{#1#2}%
}
% @caption, @shortcaption
%
\def\caption{\docaption\thiscaption}
\def\shortcaption{\docaption\thisshortcaption}
\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
\def\defcaption#1#2{\egroup \def#1{#2}}
% The parameter is the control sequence identifying the counter we are
% going to use. Create it if it doesn't exist and assign it to \floatno.
\def\getfloatno#1{%
\ifx#1\relax
% Haven't seen this figure type before.
\csname newcount\endcsname #1%
%
% Remember to reset this floatno at the next chap.
\expandafter\gdef\expandafter\resetallfloatnos
\expandafter{\resetallfloatnos #1=0 }%
\fi
\let\floatno#1%
}
% \setref calls this to get the XREFLABEL-snt value. We want an @xref
% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
% first read the @float command.
%
\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
% Magic string used for the XREFLABEL-title value, so \xrefX can
% distinguish floats from other xref types.
\def\floatmagic{!!float!!}
% #1 is the control sequence we are passed; we expand into a conditional
% which is true if #1 represents a float ref. That is, the magic
% \lastsection value which we \setref above.
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
% #1 is (maybe) the \floatmagic string. If so, #2 will be the
% (safe) float type for this float. We set \iffloattype to #2.
%
\def\doiffloat#1=#2=#3\finish{%
\def\temp{#1}%
\def\iffloattype{#2}%
\ifx\temp\floatmagic
}
% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
%
\parseargdef\listoffloats{%
\def\floattype{#1}% floattype
{%
% the floattype might have accents or other special characters,
% but we need to use it in a control sequence name.
\indexnofonts
\turnoffactive
\xdef\safefloattype{\floattype}%
}%
%
% \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
\expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
\ifhavexrefs
% if the user said @listoffloats foo but never @float foo.
\message{\linenumber No `\safefloattype' floats to list.}%
\fi
\else
\begingroup
\leftskip=\tocindent % indent these entries like a toc
\let\do=\listoffloatsdo
\csname floatlist\safefloattype\endcsname
\endgroup
\fi
}
% This is called on each entry in a list of floats. We're passed the
% xref label, in the form LABEL-title, which is how we save it in the
% aux file. We strip off the -title and look up \XRLABEL-lof, which
% has the text we're supposed to typeset here.
%
% Figures without xref labels will not be included in the list (since
% they won't appear in the aux file).
%
\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
\def\listoffloatsdoentry#1-title\finish{{%
% Can't fully expand XR#1-lof because it can contain anything. Just
% pass the control sequence. On the other hand, XR#1-pg is just the
% page number, and we want to fully expand that so we can get a link
% in pdf output.
\toksA = \expandafter{\csname XR#1-lof\endcsname}%
%
% use the same \entry macro we use to generate the TOC and index.
\edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
\writeentry
}}
\message{localization,}
% For single-language documents, @documentlanguage is usually given very
% early, just after @documentencoding. Single argument is the language
% (de) or locale (de_DE) abbreviation.
%
{
\catcode`\_ = \active
\globaldefs=1
\parseargdef\documentlanguage{\begingroup
\let_=\normalunderscore % normal _ character for filenames
\tex % read txi-??.tex file in plain TeX.
% Read the file by the name they passed if it exists.
\openin 1 txi-#1.tex
\ifeof 1
\documentlanguagetrywithoutunderscore{#1_\finish}%
\else
\globaldefs = 1 % everything in the txi-LL files needs to persist
\input txi-#1.tex
\fi
\closein 1
\endgroup % end raw TeX
\endgroup}
%
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% try txi-de.tex.
%
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
\openin 1 txi-#1.tex
\ifeof 1
\errhelp = \nolanghelp
\errmessage{Cannot read language file txi-#1.tex}%
\else
\globaldefs = 1 % everything in the txi-LL files needs to persist
\input txi-#1.tex
\fi
\closein 1
}
}% end of special _ catcode
%
\newhelp\nolanghelp{The given language definition file cannot be found or
is empty. Maybe you need to install it? Putting it in the current
directory should work if nowhere else does.}
% This macro is called from txi-??.tex files; the first argument is the
% \language name to set (without the "\lang@" prefix), the second and
% third args are \{left,right}hyphenmin.
%
% The language names to pass are determined when the format is built.
% See the etex.log file created at that time, e.g.,
% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
%
% With TeX Live 2008, etex now includes hyphenation patterns for all
% available languages. This means we can support hyphenation in
% Texinfo, at least to some extent. (This still doesn't solve the
% accented characters problem.)
%
\catcode`@=11
\def\txisetlanguage#1#2#3{%
% do not set the language if the name is undefined in the current TeX.
\expandafter\ifx\csname lang@#1\endcsname \relax
\message{no patterns for #1}%
\else
\global\language = \csname lang@#1\endcsname
\fi
% but there is no harm in adjusting the hyphenmin values regardless.
\global\lefthyphenmin = #2\relax
\global\righthyphenmin = #3\relax
}
% Helpers for encodings.
% Set the catcode of characters 128 through 255 to the specified number.
%
\def\setnonasciicharscatcode#1{%
\count255=128
\loop\ifnum\count255<256
\global\catcode\count255=#1\relax
\advance\count255 by 1
\repeat
}
\def\setnonasciicharscatcodenonglobal#1{%
\count255=128
\loop\ifnum\count255<256
\catcode\count255=#1\relax
\advance\count255 by 1
\repeat
}
% @documentencoding sets the definition of non-ASCII characters
% according to the specified encoding.
%
\parseargdef\documentencoding{%
% Encoding being declared for the document.
\def\declaredencoding{\csname #1.enc\endcsname}%
%
% Supported encodings: names converted to tokens in order to be able
% to compare them with \ifx.
\def\ascii{\csname US-ASCII.enc\endcsname}%
\def\latnine{\csname ISO-8859-15.enc\endcsname}%
\def\latone{\csname ISO-8859-1.enc\endcsname}%
\def\lattwo{\csname ISO-8859-2.enc\endcsname}%
\def\utfeight{\csname UTF-8.enc\endcsname}%
%
\ifx \declaredencoding \ascii
\asciichardefs
%
\else \ifx \declaredencoding \lattwo
\setnonasciicharscatcode\active
\lattwochardefs
%
\else \ifx \declaredencoding \latone
\setnonasciicharscatcode\active
\latonechardefs
%
\else \ifx \declaredencoding \latnine
\setnonasciicharscatcode\active
\latninechardefs
%
\else \ifx \declaredencoding \utfeight
\setnonasciicharscatcode\active
\utfeightchardefs
%
\else
\message{Unknown document encoding #1, ignoring.}%
%
\fi % utfeight
\fi % latnine
\fi % latone
\fi % lattwo
\fi % ascii
}
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
%
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
% Take account of \c (plain) vs. \, (Texinfo) difference.
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
% First, make active non-ASCII characters in order for them to be
% correctly categorized when TeX reads the replacement text of
% macros containing the character definitions.
\setnonasciicharscatcode\active
%
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
\gdef^^a0{\tie}
\gdef^^a1{\exclamdown}
\gdef^^a2{\missingcharmsg{CENT SIGN}}
\gdef^^a3{{\pounds}}
\gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
\gdef^^a5{\missingcharmsg{YEN SIGN}}
\gdef^^a6{\missingcharmsg{BROKEN BAR}}
\gdef^^a7{\S}
\gdef^^a8{\"{}}
\gdef^^a9{\copyright}
\gdef^^aa{\ordf}
\gdef^^ab{\guillemetleft}
\gdef^^ac{$\lnot$}
\gdef^^ad{\-}
\gdef^^ae{\registeredsymbol}
\gdef^^af{\={}}
%
\gdef^^b0{\textdegree}
\gdef^^b1{$\pm$}
\gdef^^b2{$^2$}
\gdef^^b3{$^3$}
\gdef^^b4{\'{}}
\gdef^^b5{$\mu$}
\gdef^^b6{\P}
%
\gdef^^b7{$^.$}
\gdef^^b8{\cedilla\ }
\gdef^^b9{$^1$}
\gdef^^ba{\ordm}
%
\gdef^^bb{\guillemetright}
\gdef^^bc{$1\over4$}
\gdef^^bd{$1\over2$}
\gdef^^be{$3\over4$}
\gdef^^bf{\questiondown}
%
\gdef^^c0{\`A}
\gdef^^c1{\'A}
\gdef^^c2{\^A}
\gdef^^c3{\~A}
\gdef^^c4{\"A}
\gdef^^c5{\ringaccent A}
\gdef^^c6{\AE}
\gdef^^c7{\cedilla C}
\gdef^^c8{\`E}
\gdef^^c9{\'E}
\gdef^^ca{\^E}
\gdef^^cb{\"E}
\gdef^^cc{\`I}
\gdef^^cd{\'I}
\gdef^^ce{\^I}
\gdef^^cf{\"I}
%
\gdef^^d0{\DH}
\gdef^^d1{\~N}
\gdef^^d2{\`O}
\gdef^^d3{\'O}
\gdef^^d4{\^O}
\gdef^^d5{\~O}
\gdef^^d6{\"O}
\gdef^^d7{$\times$}
\gdef^^d8{\O}
\gdef^^d9{\`U}
\gdef^^da{\'U}
\gdef^^db{\^U}
\gdef^^dc{\"U}
\gdef^^dd{\'Y}
\gdef^^de{\TH}
\gdef^^df{\ss}
%
\gdef^^e0{\`a}
\gdef^^e1{\'a}
\gdef^^e2{\^a}
\gdef^^e3{\~a}
\gdef^^e4{\"a}
\gdef^^e5{\ringaccent a}
\gdef^^e6{\ae}
\gdef^^e7{\cedilla c}
\gdef^^e8{\`e}
\gdef^^e9{\'e}
\gdef^^ea{\^e}
\gdef^^eb{\"e}
\gdef^^ec{\`{\dotless i}}
\gdef^^ed{\'{\dotless i}}
\gdef^^ee{\^{\dotless i}}
\gdef^^ef{\"{\dotless i}}
%
\gdef^^f0{\dh}
\gdef^^f1{\~n}
\gdef^^f2{\`o}
\gdef^^f3{\'o}
\gdef^^f4{\^o}
\gdef^^f5{\~o}
\gdef^^f6{\"o}
\gdef^^f7{$\div$}
\gdef^^f8{\o}
\gdef^^f9{\`u}
\gdef^^fa{\'u}
\gdef^^fb{\^u}
\gdef^^fc{\"u}
\gdef^^fd{\'y}
\gdef^^fe{\th}
\gdef^^ff{\"y}
}
% Latin9 (ISO-8859-15) encoding character definitions.
\def\latninechardefs{%
% Encoding is almost identical to Latin1.
\latonechardefs
%
\gdef^^a4{\euro}
\gdef^^a6{\v S}
\gdef^^a8{\v s}
\gdef^^b4{\v Z}
\gdef^^b8{\v z}
\gdef^^bc{\OE}
\gdef^^bd{\oe}
\gdef^^be{\"Y}
}
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
\gdef^^a0{\tie}
\gdef^^a1{\ogonek{A}}
\gdef^^a2{\u{}}
\gdef^^a3{\L}
\gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
\gdef^^a5{\v L}
\gdef^^a6{\'S}
\gdef^^a7{\S}
\gdef^^a8{\"{}}
\gdef^^a9{\v S}
\gdef^^aa{\cedilla S}
\gdef^^ab{\v T}
\gdef^^ac{\'Z}
\gdef^^ad{\-}
\gdef^^ae{\v Z}
\gdef^^af{\dotaccent Z}
%
\gdef^^b0{\textdegree}
\gdef^^b1{\ogonek{a}}
\gdef^^b2{\ogonek{ }}
\gdef^^b3{\l}
\gdef^^b4{\'{}}
\gdef^^b5{\v l}
\gdef^^b6{\'s}
\gdef^^b7{\v{}}
\gdef^^b8{\cedilla\ }
\gdef^^b9{\v s}
\gdef^^ba{\cedilla s}
\gdef^^bb{\v t}
\gdef^^bc{\'z}
\gdef^^bd{\H{}}
\gdef^^be{\v z}
\gdef^^bf{\dotaccent z}
%
\gdef^^c0{\'R}
\gdef^^c1{\'A}
\gdef^^c2{\^A}
\gdef^^c3{\u A}
\gdef^^c4{\"A}
\gdef^^c5{\'L}
\gdef^^c6{\'C}
\gdef^^c7{\cedilla C}
\gdef^^c8{\v C}
\gdef^^c9{\'E}
\gdef^^ca{\ogonek{E}}
\gdef^^cb{\"E}
\gdef^^cc{\v E}
\gdef^^cd{\'I}
\gdef^^ce{\^I}
\gdef^^cf{\v D}
%
\gdef^^d0{\DH}
\gdef^^d1{\'N}
\gdef^^d2{\v N}
\gdef^^d3{\'O}
\gdef^^d4{\^O}
\gdef^^d5{\H O}
\gdef^^d6{\"O}
\gdef^^d7{$\times$}
\gdef^^d8{\v R}
\gdef^^d9{\ringaccent U}
\gdef^^da{\'U}
\gdef^^db{\H U}
\gdef^^dc{\"U}
\gdef^^dd{\'Y}
\gdef^^de{\cedilla T}
\gdef^^df{\ss}
%
\gdef^^e0{\'r}
\gdef^^e1{\'a}
\gdef^^e2{\^a}
\gdef^^e3{\u a}
\gdef^^e4{\"a}
\gdef^^e5{\'l}
\gdef^^e6{\'c}
\gdef^^e7{\cedilla c}
\gdef^^e8{\v c}
\gdef^^e9{\'e}
\gdef^^ea{\ogonek{e}}
\gdef^^eb{\"e}
\gdef^^ec{\v e}
\gdef^^ed{\'{\dotless{i}}}
\gdef^^ee{\^{\dotless{i}}}
\gdef^^ef{\v d}
%
\gdef^^f0{\dh}
\gdef^^f1{\'n}
\gdef^^f2{\v n}
\gdef^^f3{\'o}
\gdef^^f4{\^o}
\gdef^^f5{\H o}
\gdef^^f6{\"o}
\gdef^^f7{$\div$}
\gdef^^f8{\v r}
\gdef^^f9{\ringaccent u}
\gdef^^fa{\'u}
\gdef^^fb{\H u}
\gdef^^fc{\"u}
\gdef^^fd{\'y}
\gdef^^fe{\cedilla t}
\gdef^^ff{\dotaccent{}}
}
% UTF-8 character definitions.
%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
% changes for Texinfo conventions. It is included here under the GPL by
% permission from Frank Mittelbach and the LaTeX team.
%
\newcount\countUTFx
\newcount\countUTFy
\newcount\countUTFz
\gdef\UTFviiiTwoOctets#1#2{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\endcsname}
%
\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
%
\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
\gdef\UTFviiiDefined#1{%
\ifx #1\relax
\message{\linenumber Unicode char \string #1 not defined for Texinfo}%
\else
\expandafter #1%
\fi
}
\begingroup
\catcode`\~13
\catcode`\"12
\def\UTFviiiLoop{%
\global\catcode\countUTFx\active
\uccode`\~\countUTFx
\uppercase\expandafter{\UTFviiiTmp}%
\advance\countUTFx by 1
\ifnum\countUTFx < \countUTFy
\expandafter\UTFviiiLoop
\fi}
\countUTFx = "C2
\countUTFy = "E0
\def\UTFviiiTmp{%
\xdef~{\noexpand\UTFviiiTwoOctets\string~}}
\UTFviiiLoop
\countUTFx = "E0
\countUTFy = "F0
\def\UTFviiiTmp{%
\xdef~{\noexpand\UTFviiiThreeOctets\string~}}
\UTFviiiLoop
\countUTFx = "F0
\countUTFy = "F4
\def\UTFviiiTmp{%
\xdef~{\noexpand\UTFviiiFourOctets\string~}}
\UTFviiiLoop
\endgroup
\begingroup
\catcode`\"=12
\catcode`\<=12
\catcode`\.=12
\catcode`\,=12
\catcode`\;=12
\catcode`\!=12
\catcode`\~=13
\gdef\DeclareUnicodeCharacter#1#2{%
\countUTFz = "#1\relax
%\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
\begingroup
\parseXMLCharref
\def\UTFviiiTwoOctets##1##2{%
\csname u8:##1\string ##2\endcsname}%
\def\UTFviiiThreeOctets##1##2##3{%
\csname u8:##1\string ##2\string ##3\endcsname}%
\def\UTFviiiFourOctets##1##2##3##4{%
\csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
\expandafter\expandafter\expandafter\expandafter
\expandafter\expandafter\expandafter
\gdef\UTFviiiTmp{#2}%
\endgroup}
\gdef\parseXMLCharref{%
\ifnum\countUTFz < "A0\relax
\errhelp = \EMsimple
\errmessage{Cannot define Unicode char value < 00A0}%
\else\ifnum\countUTFz < "800\relax
\parseUTFviiiA,%
\parseUTFviiiB C\UTFviiiTwoOctets.,%
\else\ifnum\countUTFz < "10000\relax
\parseUTFviiiA;%
\parseUTFviiiA,%
\parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
\else
\parseUTFviiiA;%
\parseUTFviiiA,%
\parseUTFviiiA!%
\parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
\fi\fi\fi
}
\gdef\parseUTFviiiA#1{%
\countUTFx = \countUTFz
\divide\countUTFz by 64
\countUTFy = \countUTFz
\multiply\countUTFz by 64
\advance\countUTFx by -\countUTFz
\advance\countUTFx by 128
\uccode `#1\countUTFx
\countUTFz = \countUTFy}
\gdef\parseUTFviiiB#1#2#3#4{%
\advance\countUTFz by "#10\relax
\uccode `#3\countUTFz
\uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
\endgroup
\def\utfeightchardefs{%
\DeclareUnicodeCharacter{00A0}{\tie}
\DeclareUnicodeCharacter{00A1}{\exclamdown}
\DeclareUnicodeCharacter{00A3}{\pounds}
\DeclareUnicodeCharacter{00A8}{\"{ }}
\DeclareUnicodeCharacter{00A9}{\copyright}
\DeclareUnicodeCharacter{00AA}{\ordf}
\DeclareUnicodeCharacter{00AB}{\guillemetleft}
\DeclareUnicodeCharacter{00AD}{\-}
\DeclareUnicodeCharacter{00AE}{\registeredsymbol}
\DeclareUnicodeCharacter{00AF}{\={ }}
\DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
\DeclareUnicodeCharacter{00B4}{\'{ }}
\DeclareUnicodeCharacter{00B8}{\cedilla{ }}
\DeclareUnicodeCharacter{00BA}{\ordm}
\DeclareUnicodeCharacter{00BB}{\guillemetright}
\DeclareUnicodeCharacter{00BF}{\questiondown}
\DeclareUnicodeCharacter{00C0}{\`A}
\DeclareUnicodeCharacter{00C1}{\'A}
\DeclareUnicodeCharacter{00C2}{\^A}
\DeclareUnicodeCharacter{00C3}{\~A}
\DeclareUnicodeCharacter{00C4}{\"A}
\DeclareUnicodeCharacter{00C5}{\AA}
\DeclareUnicodeCharacter{00C6}{\AE}
\DeclareUnicodeCharacter{00C7}{\cedilla{C}}
\DeclareUnicodeCharacter{00C8}{\`E}
\DeclareUnicodeCharacter{00C9}{\'E}
\DeclareUnicodeCharacter{00CA}{\^E}
\DeclareUnicodeCharacter{00CB}{\"E}
\DeclareUnicodeCharacter{00CC}{\`I}
\DeclareUnicodeCharacter{00CD}{\'I}
\DeclareUnicodeCharacter{00CE}{\^I}
\DeclareUnicodeCharacter{00CF}{\"I}
\DeclareUnicodeCharacter{00D0}{\DH}
\DeclareUnicodeCharacter{00D1}{\~N}
\DeclareUnicodeCharacter{00D2}{\`O}
\DeclareUnicodeCharacter{00D3}{\'O}
\DeclareUnicodeCharacter{00D4}{\^O}
\DeclareUnicodeCharacter{00D5}{\~O}
\DeclareUnicodeCharacter{00D6}{\"O}
\DeclareUnicodeCharacter{00D8}{\O}
\DeclareUnicodeCharacter{00D9}{\`U}
\DeclareUnicodeCharacter{00DA}{\'U}
\DeclareUnicodeCharacter{00DB}{\^U}
\DeclareUnicodeCharacter{00DC}{\"U}
\DeclareUnicodeCharacter{00DD}{\'Y}
\DeclareUnicodeCharacter{00DE}{\TH}
\DeclareUnicodeCharacter{00DF}{\ss}
\DeclareUnicodeCharacter{00E0}{\`a}
\DeclareUnicodeCharacter{00E1}{\'a}
\DeclareUnicodeCharacter{00E2}{\^a}
\DeclareUnicodeCharacter{00E3}{\~a}
\DeclareUnicodeCharacter{00E4}{\"a}
\DeclareUnicodeCharacter{00E5}{\aa}
\DeclareUnicodeCharacter{00E6}{\ae}
\DeclareUnicodeCharacter{00E7}{\cedilla{c}}
\DeclareUnicodeCharacter{00E8}{\`e}
\DeclareUnicodeCharacter{00E9}{\'e}
\DeclareUnicodeCharacter{00EA}{\^e}
\DeclareUnicodeCharacter{00EB}{\"e}
\DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
\DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
\DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
\DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
\DeclareUnicodeCharacter{00F0}{\dh}
\DeclareUnicodeCharacter{00F1}{\~n}
\DeclareUnicodeCharacter{00F2}{\`o}
\DeclareUnicodeCharacter{00F3}{\'o}
\DeclareUnicodeCharacter{00F4}{\^o}
\DeclareUnicodeCharacter{00F5}{\~o}
\DeclareUnicodeCharacter{00F6}{\"o}
\DeclareUnicodeCharacter{00F8}{\o}
\DeclareUnicodeCharacter{00F9}{\`u}
\DeclareUnicodeCharacter{00FA}{\'u}
\DeclareUnicodeCharacter{00FB}{\^u}
\DeclareUnicodeCharacter{00FC}{\"u}
\DeclareUnicodeCharacter{00FD}{\'y}
\DeclareUnicodeCharacter{00FE}{\th}
\DeclareUnicodeCharacter{00FF}{\"y}
\DeclareUnicodeCharacter{0100}{\=A}
\DeclareUnicodeCharacter{0101}{\=a}
\DeclareUnicodeCharacter{0102}{\u{A}}
\DeclareUnicodeCharacter{0103}{\u{a}}
\DeclareUnicodeCharacter{0104}{\ogonek{A}}
\DeclareUnicodeCharacter{0105}{\ogonek{a}}
\DeclareUnicodeCharacter{0106}{\'C}
\DeclareUnicodeCharacter{0107}{\'c}
\DeclareUnicodeCharacter{0108}{\^C}
\DeclareUnicodeCharacter{0109}{\^c}
\DeclareUnicodeCharacter{0118}{\ogonek{E}}
\DeclareUnicodeCharacter{0119}{\ogonek{e}}
\DeclareUnicodeCharacter{010A}{\dotaccent{C}}
\DeclareUnicodeCharacter{010B}{\dotaccent{c}}
\DeclareUnicodeCharacter{010C}{\v{C}}
\DeclareUnicodeCharacter{010D}{\v{c}}
\DeclareUnicodeCharacter{010E}{\v{D}}
\DeclareUnicodeCharacter{0112}{\=E}
\DeclareUnicodeCharacter{0113}{\=e}
\DeclareUnicodeCharacter{0114}{\u{E}}
\DeclareUnicodeCharacter{0115}{\u{e}}
\DeclareUnicodeCharacter{0116}{\dotaccent{E}}
\DeclareUnicodeCharacter{0117}{\dotaccent{e}}
\DeclareUnicodeCharacter{011A}{\v{E}}
\DeclareUnicodeCharacter{011B}{\v{e}}
\DeclareUnicodeCharacter{011C}{\^G}
\DeclareUnicodeCharacter{011D}{\^g}
\DeclareUnicodeCharacter{011E}{\u{G}}
\DeclareUnicodeCharacter{011F}{\u{g}}
\DeclareUnicodeCharacter{0120}{\dotaccent{G}}
\DeclareUnicodeCharacter{0121}{\dotaccent{g}}
\DeclareUnicodeCharacter{0124}{\^H}
\DeclareUnicodeCharacter{0125}{\^h}
\DeclareUnicodeCharacter{0128}{\~I}
\DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
\DeclareUnicodeCharacter{012A}{\=I}
\DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
\DeclareUnicodeCharacter{012C}{\u{I}}
\DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
\DeclareUnicodeCharacter{0130}{\dotaccent{I}}
\DeclareUnicodeCharacter{0131}{\dotless{i}}
\DeclareUnicodeCharacter{0132}{IJ}
\DeclareUnicodeCharacter{0133}{ij}
\DeclareUnicodeCharacter{0134}{\^J}
\DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
\DeclareUnicodeCharacter{0139}{\'L}
\DeclareUnicodeCharacter{013A}{\'l}
\DeclareUnicodeCharacter{0141}{\L}
\DeclareUnicodeCharacter{0142}{\l}
\DeclareUnicodeCharacter{0143}{\'N}
\DeclareUnicodeCharacter{0144}{\'n}
\DeclareUnicodeCharacter{0147}{\v{N}}
\DeclareUnicodeCharacter{0148}{\v{n}}
\DeclareUnicodeCharacter{014C}{\=O}
\DeclareUnicodeCharacter{014D}{\=o}
\DeclareUnicodeCharacter{014E}{\u{O}}
\DeclareUnicodeCharacter{014F}{\u{o}}
\DeclareUnicodeCharacter{0150}{\H{O}}
\DeclareUnicodeCharacter{0151}{\H{o}}
\DeclareUnicodeCharacter{0152}{\OE}
\DeclareUnicodeCharacter{0153}{\oe}
\DeclareUnicodeCharacter{0154}{\'R}
\DeclareUnicodeCharacter{0155}{\'r}
\DeclareUnicodeCharacter{0158}{\v{R}}
\DeclareUnicodeCharacter{0159}{\v{r}}
\DeclareUnicodeCharacter{015A}{\'S}
\DeclareUnicodeCharacter{015B}{\'s}
\DeclareUnicodeCharacter{015C}{\^S}
\DeclareUnicodeCharacter{015D}{\^s}
\DeclareUnicodeCharacter{015E}{\cedilla{S}}
\DeclareUnicodeCharacter{015F}{\cedilla{s}}
\DeclareUnicodeCharacter{0160}{\v{S}}
\DeclareUnicodeCharacter{0161}{\v{s}}
\DeclareUnicodeCharacter{0162}{\cedilla{t}}
\DeclareUnicodeCharacter{0163}{\cedilla{T}}
\DeclareUnicodeCharacter{0164}{\v{T}}
\DeclareUnicodeCharacter{0168}{\~U}
\DeclareUnicodeCharacter{0169}{\~u}
\DeclareUnicodeCharacter{016A}{\=U}
\DeclareUnicodeCharacter{016B}{\=u}
\DeclareUnicodeCharacter{016C}{\u{U}}
\DeclareUnicodeCharacter{016D}{\u{u}}
\DeclareUnicodeCharacter{016E}{\ringaccent{U}}
\DeclareUnicodeCharacter{016F}{\ringaccent{u}}
\DeclareUnicodeCharacter{0170}{\H{U}}
\DeclareUnicodeCharacter{0171}{\H{u}}
\DeclareUnicodeCharacter{0174}{\^W}
\DeclareUnicodeCharacter{0175}{\^w}
\DeclareUnicodeCharacter{0176}{\^Y}
\DeclareUnicodeCharacter{0177}{\^y}
\DeclareUnicodeCharacter{0178}{\"Y}
\DeclareUnicodeCharacter{0179}{\'Z}
\DeclareUnicodeCharacter{017A}{\'z}
\DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
\DeclareUnicodeCharacter{017C}{\dotaccent{z}}
\DeclareUnicodeCharacter{017D}{\v{Z}}
\DeclareUnicodeCharacter{017E}{\v{z}}
\DeclareUnicodeCharacter{01C4}{D\v{Z}}
\DeclareUnicodeCharacter{01C5}{D\v{z}}
\DeclareUnicodeCharacter{01C6}{d\v{z}}
\DeclareUnicodeCharacter{01C7}{LJ}
\DeclareUnicodeCharacter{01C8}{Lj}
\DeclareUnicodeCharacter{01C9}{lj}
\DeclareUnicodeCharacter{01CA}{NJ}
\DeclareUnicodeCharacter{01CB}{Nj}
\DeclareUnicodeCharacter{01CC}{nj}
\DeclareUnicodeCharacter{01CD}{\v{A}}
\DeclareUnicodeCharacter{01CE}{\v{a}}
\DeclareUnicodeCharacter{01CF}{\v{I}}
\DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
\DeclareUnicodeCharacter{01D1}{\v{O}}
\DeclareUnicodeCharacter{01D2}{\v{o}}
\DeclareUnicodeCharacter{01D3}{\v{U}}
\DeclareUnicodeCharacter{01D4}{\v{u}}
\DeclareUnicodeCharacter{01E2}{\={\AE}}
\DeclareUnicodeCharacter{01E3}{\={\ae}}
\DeclareUnicodeCharacter{01E6}{\v{G}}
\DeclareUnicodeCharacter{01E7}{\v{g}}
\DeclareUnicodeCharacter{01E8}{\v{K}}
\DeclareUnicodeCharacter{01E9}{\v{k}}
\DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
\DeclareUnicodeCharacter{01F1}{DZ}
\DeclareUnicodeCharacter{01F2}{Dz}
\DeclareUnicodeCharacter{01F3}{dz}
\DeclareUnicodeCharacter{01F4}{\'G}
\DeclareUnicodeCharacter{01F5}{\'g}
\DeclareUnicodeCharacter{01F8}{\`N}
\DeclareUnicodeCharacter{01F9}{\`n}
\DeclareUnicodeCharacter{01FC}{\'{\AE}}
\DeclareUnicodeCharacter{01FD}{\'{\ae}}
\DeclareUnicodeCharacter{01FE}{\'{\O}}
\DeclareUnicodeCharacter{01FF}{\'{\o}}
\DeclareUnicodeCharacter{021E}{\v{H}}
\DeclareUnicodeCharacter{021F}{\v{h}}
\DeclareUnicodeCharacter{0226}{\dotaccent{A}}
\DeclareUnicodeCharacter{0227}{\dotaccent{a}}
\DeclareUnicodeCharacter{0228}{\cedilla{E}}
\DeclareUnicodeCharacter{0229}{\cedilla{e}}
\DeclareUnicodeCharacter{022E}{\dotaccent{O}}
\DeclareUnicodeCharacter{022F}{\dotaccent{o}}
\DeclareUnicodeCharacter{0232}{\=Y}
\DeclareUnicodeCharacter{0233}{\=y}
\DeclareUnicodeCharacter{0237}{\dotless{j}}
\DeclareUnicodeCharacter{02DB}{\ogonek{ }}
\DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
\DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
\DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
\DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
\DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
\DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
\DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
\DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
\DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
\DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
\DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
\DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
\DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
\DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
\DeclareUnicodeCharacter{1E20}{\=G}
\DeclareUnicodeCharacter{1E21}{\=g}
\DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
\DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
\DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
\DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
\DeclareUnicodeCharacter{1E26}{\"H}
\DeclareUnicodeCharacter{1E27}{\"h}
\DeclareUnicodeCharacter{1E30}{\'K}
\DeclareUnicodeCharacter{1E31}{\'k}
\DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
\DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
\DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
\DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
\DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
\DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
\DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
\DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
\DeclareUnicodeCharacter{1E3E}{\'M}
\DeclareUnicodeCharacter{1E3F}{\'m}
\DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
\DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
\DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
\DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
\DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
\DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
\DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
\DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
\DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
\DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
\DeclareUnicodeCharacter{1E54}{\'P}
\DeclareUnicodeCharacter{1E55}{\'p}
\DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
\DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
\DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
\DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
\DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
\DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
\DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
\DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
\DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
\DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
\DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
\DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
\DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
\DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
\DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
\DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
\DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
\DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
\DeclareUnicodeCharacter{1E7C}{\~V}
\DeclareUnicodeCharacter{1E7D}{\~v}
\DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
\DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
\DeclareUnicodeCharacter{1E80}{\`W}
\DeclareUnicodeCharacter{1E81}{\`w}
\DeclareUnicodeCharacter{1E82}{\'W}
\DeclareUnicodeCharacter{1E83}{\'w}
\DeclareUnicodeCharacter{1E84}{\"W}
\DeclareUnicodeCharacter{1E85}{\"w}
\DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
\DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
\DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
\DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
\DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
\DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
\DeclareUnicodeCharacter{1E8C}{\"X}
\DeclareUnicodeCharacter{1E8D}{\"x}
\DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
\DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
\DeclareUnicodeCharacter{1E90}{\^Z}
\DeclareUnicodeCharacter{1E91}{\^z}
\DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
\DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
\DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
\DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
\DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
\DeclareUnicodeCharacter{1E97}{\"t}
\DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
\DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
\DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
\DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
\DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
\DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
\DeclareUnicodeCharacter{1EBC}{\~E}
\DeclareUnicodeCharacter{1EBD}{\~e}
\DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
\DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
\DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
\DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
\DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
\DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
\DeclareUnicodeCharacter{1EF2}{\`Y}
\DeclareUnicodeCharacter{1EF3}{\`y}
\DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
\DeclareUnicodeCharacter{1EF8}{\~Y}
\DeclareUnicodeCharacter{1EF9}{\~y}
\DeclareUnicodeCharacter{2013}{--}
\DeclareUnicodeCharacter{2014}{---}
\DeclareUnicodeCharacter{2018}{\quoteleft}
\DeclareUnicodeCharacter{2019}{\quoteright}
\DeclareUnicodeCharacter{201A}{\quotesinglbase}
\DeclareUnicodeCharacter{201C}{\quotedblleft}
\DeclareUnicodeCharacter{201D}{\quotedblright}
\DeclareUnicodeCharacter{201E}{\quotedblbase}
\DeclareUnicodeCharacter{2022}{\bullet}
\DeclareUnicodeCharacter{2026}{\dots}
\DeclareUnicodeCharacter{2039}{\guilsinglleft}
\DeclareUnicodeCharacter{203A}{\guilsinglright}
\DeclareUnicodeCharacter{20AC}{\euro}
\DeclareUnicodeCharacter{2192}{\expansion}
\DeclareUnicodeCharacter{21D2}{\result}
\DeclareUnicodeCharacter{2212}{\minus}
\DeclareUnicodeCharacter{2217}{\point}
\DeclareUnicodeCharacter{2261}{\equiv}
}% end of \utfeightchardefs
% US-ASCII character definitions.
\def\asciichardefs{% nothing need be done
\relax
}
% Make non-ASCII characters printable again for compatibility with
% existing Texinfo documents that may use them, even without declaring a
% document encoding.
%
\setnonasciicharscatcode \other
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
\vbadness = 10000
% Don't be very finicky about underfull hboxes, either.
\hbadness = 6666
% Following George Bush, get rid of widows and orphans.
\widowpenalty=10000
\clubpenalty=10000
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
% \hsize. We call this whenever the paper size is set.
%
\def\setemergencystretch{%
\ifx\emergencystretch\thisisundefined
% Allow us to assign to \emergencystretch anyway.
\def\emergencystretch{\dimen0}%
\else
\emergencystretch = .15\hsize
\fi
}
% Parameters in order: 1) textheight; 2) textwidth;
% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
% 7) physical page height; 8) physical page width.
%
% We also call \setleading{\textleading}, so the caller should define
% \textleading. The caller should also set \parskip.
%
\def\internalpagesizes#1#2#3#4#5#6#7#8{%
\voffset = #3\relax
\topskip = #6\relax
\splittopskip = \topskip
%
\vsize = #1\relax
\advance\vsize by \topskip
\outervsize = \vsize
\advance\outervsize by 2\topandbottommargin
\pageheight = \vsize
%
\hsize = #2\relax
\outerhsize = \hsize
\advance\outerhsize by 0.5in
\pagewidth = \hsize
%
\normaloffset = #4\relax
\bindingoffset = #5\relax
%
\ifpdf
\pdfpageheight #7\relax
\pdfpagewidth #8\relax
% if we don't reset these, they will remain at "1 true in" of
% whatever layout pdftex was dumped with.
\pdfhorigin = 1 true in
\pdfvorigin = 1 true in
\fi
%
\setleading{\textleading}
%
\parindent = \defaultparindent
\setemergencystretch
}
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
% If page is nothing but text, make it come out even.
\internalpagesizes{607.2pt}{6in}% that's 46 lines
{\voffset}{.25in}%
{\bindingoffset}{36pt}%
{11in}{8.5in}%
}}
% Use @smallbook to reset parameters for 7x9.25 trim size.
\def\smallbook{{\globaldefs = 1
\parskip = 2pt plus 1pt
\textleading = 12pt
%
\internalpagesizes{7.5in}{5in}%
{-.2in}{0in}%
{\bindingoffset}{16pt}%
{9.25in}{7in}%
%
\lispnarrowing = 0.3in
\tolerance = 700
\hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = .5cm
}}
% Use @smallerbook to reset parameters for 6x9 trim size.
% (Just testing, parameters still in flux.)
\def\smallerbook{{\globaldefs = 1
\parskip = 1.5pt plus 1pt
\textleading = 12pt
%
\internalpagesizes{7.4in}{4.8in}%
{-.2in}{-.4in}%
{0pt}{14pt}%
{9in}{6in}%
%
\lispnarrowing = 0.25in
\tolerance = 700
\hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = .4cm
}}
% Use @afourpaper to print on European A4 paper.
\def\afourpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
% Double-side printing via postscript on Laserjet 4050
% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
% To change the settings for a different printer or situation, adjust
% \normaloffset until the front-side and back-side texts align. Then
% do the same for \bindingoffset. You can set these for testing in
% your texinfo source file like this:
% @tex
% \global\normaloffset = -6mm
% \global\bindingoffset = 10mm
% @end tex
\internalpagesizes{673.2pt}{160mm}% that's 51 lines
{\voffset}{\hoffset}%
{\bindingoffset}{44pt}%
{297mm}{210mm}%
%
\tolerance = 700
\hfuzz = 1pt
\contentsrightmargin = 0pt
\defbodyindent = 5mm
}}
% Use @afivepaper to print on European A5 paper.
% From romildo@urano.iceb.ufop.br, 2 July 2000.
% He also recommends making @example and @lisp be small.
\def\afivepaper{{\globaldefs = 1
\parskip = 2pt plus 1pt minus 0.1pt
\textleading = 12.5pt
%
\internalpagesizes{160mm}{120mm}%
{\voffset}{\hoffset}%
{\bindingoffset}{8pt}%
{210mm}{148mm}%
%
\lispnarrowing = 0.2in
\tolerance = 800
\hfuzz = 1.2pt
\contentsrightmargin = 0pt
\defbodyindent = 2mm
\tableindent = 12mm
}}
% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
\afourpaper
\internalpagesizes{237mm}{150mm}%
{\voffset}{4.6mm}%
{\bindingoffset}{7mm}%
{297mm}{210mm}%
%
% Must explicitly reset to 0 because we call \afourpaper.
\globaldefs = 0
}}
% Use @afourwide to print on A4 paper in landscape format.
\def\afourwide{{\globaldefs = 1
\afourpaper
\internalpagesizes{241mm}{165mm}%
{\voffset}{-2.95mm}%
{\bindingoffset}{7mm}%
{297mm}{210mm}%
\globaldefs = 0
}}
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
% Perhaps we should allow setting the margins, \topskip, \parskip,
% and/or leading, also. Or perhaps we should compute them somehow.
%
\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
\def\pagesizesyyy#1,#2,#3\finish{{%
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
\globaldefs = 1
%
\parskip = 3pt plus 2pt minus 1pt
\setleading{\textleading}%
%
\dimen0 = #1\relax
\advance\dimen0 by \voffset
%
\dimen2 = \hsize
\advance\dimen2 by \normaloffset
%
\internalpagesizes{#1}{\hsize}%
{\voffset}{\normaloffset}%
{\bindingoffset}{44pt}%
{\dimen0}{\dimen2}%
}}
% Set default to letter.
%
\letterpaper
\message{and turning on texinfo input format.}
\def^^L{\par} % remove \outer, so ^L can appear in an @comment
% DEL is a comment character, in case @c does not suffice.
\catcode`\^^? = 14
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other \def\normaldoublequote{"}
\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
\catcode`\+=\other \def\normalplus{+}
\catcode`\<=\other \def\normalless{<}
\catcode`\>=\other \def\normalgreater{>}
\catcode`\^=\other \def\normalcaret{^}
\catcode`\_=\other \def\normalunderscore{_}
\catcode`\|=\other \def\normalverticalbar{|}
\catcode`\~=\other \def\normaltilde{~}
% This macro is used to make a character print one way in \tt
% (where it can probably be output as-is), and another way in other fonts,
% where something hairier probably needs to be done.
%
% #1 is what to print if we are indeed using \tt; #2 is what to print
% otherwise. Since all the Computer Modern typewriter fonts have zero
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
% Same as above, but check for italic font. Actually this also catches
% non-italic slanted fonts since it is impossible to distinguish them from
% italic fonts. But since this is only used by $ and it uses \sl anyway
% this is not a problem.
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
% Most of these we simply print from the \tt font, but for some, we can
% use math or other variants that look better in normal text.
\catcode`\"=\active
\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active
\def~{{\tt\char126}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}
\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
\let\realunder=_
% Subroutine for the previous macro.
\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\catcode`\|=\active
\def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
\chardef \gtr=`\>
\catcode`\>=\active
\def>{{\tt \gtr}}
\catcode`\+=\active
\def+{{\tt \char 43}}
\catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% So turn them off again, and have \everyjob (or @setfilename) turn them on.
% \otherifyactive is called near the end of this file.
\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
% Used sometimes to turn off (effectively) the active characters even after
% parsing them.
\def\turnoffactive{%
\normalturnoffactive
\otherbackslash
}
\catcode`\@=0
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
% \realbackslash is an actual character `\' with catcode other, and
% \doublebackslash is two of them (for the pdf outlines).
{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
% In texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
\catcode`\\=\active % @ for escape char from now on.
% The story here is that in math mode, the \char of \backslashcurfont
% ends up printing the roman \ from the math symbol font (because \char
% in math mode uses the \mathcode, and plain.tex sets
% \mathcode`\\="026E). It seems better for @backslashchar{} to always
% print a typewriter backslash, hence we use an explicit \mathchar,
% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
% ignored family value; char position "5C). We can't use " for the
% usual hex value because it has already been made active.
@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
% On startup, @fixbackslash assigns:
% @let \ = @normalbackslash
% \rawbackslash defines an active \ to do \backslashcurfont.
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other. We switch back and forth between these.
@gdef@rawbackslash{@let\=@backslashcurfont}
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'. Also revert - to its normal character, in
% case the active - from code has slipped in.
%
{@catcode`- = @active
@gdef@normalturnoffactive{%
@let-=@normaldash
@let"=@normaldoublequote
@let$=@normaldollar %$ font-lock fix
@let+=@normalplus
@let<=@normalless
@let>=@normalgreater
@let\=@normalbackslash
@let^=@normalcaret
@let_=@normalunderscore
@let|=@normalverticalbar
@let~=@normaltilde
@markupsetuplqdefault
@markupsetuprqdefault
@unsepspaces
}
}
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
@otherifyactive
% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% That is what \eatinput is for; after that, the `\' should revert to printing
% a backslash.
%
@gdef@eatinput input texinfo{@fixbackslash}
@global@let\ = @eatinput
% On the other hand, perhaps the file did not have a `\input texinfo'. Then
% the first `\' in the file would cause an error. This macro tries to fix
% that, assuming it is called before the first `\' could plausibly occur.
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
%
@gdef@fixbackslash{%
@ifx\@eatinput @let\ = @normalbackslash @fi
@catcode`+=@active
@catcode`@_=@active
}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
% These (along with & and #) are made active for url-breaking, so need
% active definitions as the normal characters.
@def@normaldot{.}
@def@normalquest{?}
@def@normalslash{/}
% These look ok in all fonts, so just make them not special.
% @hashchar{} gets its own user-level command, because of #line.
@catcode`@& = @other @def@normalamp{&}
@catcode`@# = @other @def@normalhash{#}
@catcode`@% = @other @def@normalpercent{%}
@let @hashchar = @normalhash
@c Finally, make ` and ' active, so that txicodequoteundirected and
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
@c don't make ` and ' active, @code will not get them as active chars.
@c Do this last of all since we use ` in the previous @catcode assignments.
@catcode`@'=@active
@catcode`@`=@active
@markupsetuplqdefault
@markupsetuprqdefault
@c Local variables:
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-end: "}"
@c End:
@c vim:sw=2:
@ignore
arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
@end ignore
07070100024f73000081a400000000000000000000000153157ab50000894b000001000001014cffffffffffffffff0000002b00000000root/usr/local/share/automake-1.13/COPYING GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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. But first, please read
.
07070100024fab000081ed00000000000000000000000153157ab600001b5e000001000001014cffffffffffffffff0000002a00000000root/usr/local/share/automake-1.13/ylwrap #! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
scriptversion=2012-12-21.17; # UTC
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# Written by Tom Tromey .
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
get_dirname ()
{
case $1 in
*/*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
# Otherwise, we want the empty string (not ".").
esac
}
# guard FILE
# ----------
# The CPP macro used to guard inclusion of FILE.
guard()
{
printf '%s\n' "$1" \
| sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
-e 's/__*/_/g'
}
# quote_for_sed [STRING]
# ----------------------
# Return STRING (or stdin) quoted to be used as a sed pattern.
quote_for_sed ()
{
case $# in
0) cat;;
1) printf '%s\n' "$1";;
esac \
| sed -e 's|[][\\.*]|\\&|g'
}
case "$1" in
'')
echo "$0: No files given. Try '$0 --help' for more information." 1>&2
exit 1
;;
--basedir)
basedir=$2
shift 2
;;
-h|--h*)
cat <<\EOF
Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
Wrapper for lex/yacc invocations, renaming files as desired.
INPUT is the input file
OUTPUT is one file PROG generates
DESIRED is the file we actually want instead of OUTPUT
PROGRAM is program to run
ARGS are passed to PROG
Any number of OUTPUT,DESIRED pairs may be used.
Report bugs to .
EOF
exit $?
;;
-v|--v*)
echo "ylwrap $scriptversion"
exit $?
;;
esac
# The input.
input="$1"
shift
# We'll later need for a correct munging of "#line" directives.
input_sub_rx=`get_dirname "$input" | quote_for_sed`
case "$input" in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
input="`pwd`/$input"
;;
esac
input_rx=`get_dirname "$input" | quote_for_sed`
# Since DOS filename conventions don't allow two dots,
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
y_tab_nodot=false
if test -f y_tab.c || test -f y_tab.h; then
y_tab_nodot=true
fi
# The parser itself, the first file, is the destination of the .y.c
# rule in the Makefile.
parser=$1
# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
# instance, we rename #include "y.tab.h" into #include "parse.h"
# during the conversion from y.tab.c to parse.c.
sed_fix_filenames=
# Also rename header guards, as Bison 2.7 for instance uses its header
# guard in its implementation file.
sed_fix_header_guards=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
break
fi
from=$1
# Handle y_tab.c and y_tab.h output by DOS
if $y_tab_nodot; then
case $from in
"y.tab.c") from=y_tab.c;;
"y.tab.h") from=y_tab.h;;
esac
fi
shift
to=$1
shift
sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
done
# The program to run.
prog="$1"
shift
# Make any relative path in $prog absolute.
case "$prog" in
[\\/]* | ?:[\\/]*) ;;
*[\\/]*) prog="`pwd`/$prog" ;;
esac
# FIXME: add hostname here for parallel makes that run commands on
# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
mkdir $dirname || exit 1
cd $dirname
case $# in
0) "$prog" "$input" ;;
*) "$prog" "$@" "$input" ;;
esac
ret=$?
if test $ret -eq 0; then
for from in *
do
to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend '../'.
case $to in
[\\/]* | ?:[\\/]*) target=$to;;
*) target="../$to";;
esac
# Do not overwrite unchanged header files to avoid useless
# recompilations. Always update the parser itself: it is the
# destination of the .y.c rule in the Makefile. Divert the
# output of all other files to a temporary file so we can
# compare them to existing versions.
if test $from != $parser; then
realtarget="$target"
target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
# Munge "#line" or "#" directives. Don't let the resulting
# debug information point at an absolute srcdir. Use the real
# output file name, not yy.lex.c for instance. Adjust the
# include guards too.
sed -e "/^#/!b" \
-e "s|$input_rx|$input_sub_rx|" \
-e "$sed_fix_filenames" \
-e "$sed_fix_header_guards" \
"$from" >"$target" || ret=$?
# Check whether files must be updated.
if test "$from" != "$parser"; then
if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
echo "$to is unchanged"
rm -f "$target"
else
echo "updating $to"
mv -f "$target" "$realtarget"
fi
fi
else
# A missing file is only an error for the parser. This is a
# blatant hack to let us support using "yacc -d". If -d is not
# specified, don't fail when the header file is "missing".
if test "$from" = "$parser"; then
ret=1
fi
fi
done
fi
# Remove the directory.
cd ..
rm -rf $dirname
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024f75000041ed00000000000000000000000253157abd00000000000001000001014cffffffffffffffff0000002600000000root/usr/local/share/automake-1.13/am 07070100024f9a000081a400000000000000000000000153157aaf0000347d000001000001014cffffffffffffffff0000003200000000root/usr/local/share/automake-1.13/am/texinfos.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## ----------- ##
## Variables. ##
## ----------- ##
if %?LOCAL-TEXIS%
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
endif %?LOCAL-TEXIS%
## ---------- ##
## Building. ##
## ---------- ##
## The way to make PostScript, for those who want it.
if %?LOCAL-TEXIS%
DVIPS = dvips
.dvi.ps:
%AM_V_DVIPS%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) %TEXIQUIET% -o $@ $<
endif %?LOCAL-TEXIS%
.PHONY: dvi dvi-am html html-am info info-am pdf pdf-am ps ps-am
if %?SUBDIRS%
RECURSIVE_TARGETS += dvi-recursive html-recursive info-recursive
RECURSIVE_TARGETS += pdf-recursive ps-recursive
dvi: dvi-recursive
html: html-recursive
info: info-recursive
pdf: pdf-recursive
ps: ps-recursive
else !%?SUBDIRS%
dvi: dvi-am
html: html-am
info: info-am
pdf: pdf-am
ps: ps-am
endif !%?SUBDIRS%
if %?LOCAL-TEXIS%
dvi-am: $(DVIS)
html-am: $(HTMLS)
info-am: $(INFO_DEPS)
pdf-am: $(PDFS)
ps-am: $(PSS)
else ! %?LOCAL-TEXIS%
dvi-am:
html-am:
info-am:
pdf-am:
ps-am:
endif ! %?LOCAL-TEXIS%
## ------------ ##
## Installing. ##
## ------------ ##
## Some code should be run only if install-info actually exists, and
## if the user doesn't request it not to be run (through the
## 'AM_UPDATE_INFO_DIR' environment variable). See automake bug#9773
## and Debian Bug#543992.
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
## Look in both . and srcdir because the info pages might have been
## rebuilt in the build directory. Can't cd to srcdir; that might
## break a possible install-sh reference.
##
## Funny name due to --cygnus influence; we want to reserve
## 'install-info' for the user.
##
## TEXINFOS primary are always installed in infodir, hence install-data
## is hard coded.
if %?INSTALL-INFO%
if %?LOCAL-TEXIS%
am__installdirs += "$(DESTDIR)$(infodir)"
install-data-am: install-info-am
endif %?LOCAL-TEXIS%
endif %?INSTALL-INFO%
.PHONY: \
install-dvi install-dvi-am \
install-html install-html-am \
install-info install-info-am \
install-pdf install-pdf-am \
install-ps install-ps-am
if %?SUBDIRS%
RECURSIVE_TARGETS += \
install-dvi-recursive \
install-html-recursive \
install-info-recursive \
install-pdf-recursive \
install-ps-recursive
install-dvi: install-dvi-recursive
install-html: install-html-recursive
install-info: install-info-recursive
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
else !%?SUBDIRS%
install-dvi: install-dvi-am
install-html: install-html-am
install-info: install-info-am
install-pdf: install-pdf-am
install-ps: install-ps-am
endif !%?SUBDIRS%
if %?LOCAL-TEXIS%
include inst-vars.am
install-dvi-am: $(DVIS)
@$(NORMAL_INSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
$(MKDIR_P) "$(DESTDIR)$(dvidir)" || 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)$(dvidir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
done
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__strip_dir) \
## This indirection is required to work around a bug of the Solaris 10
## shell /usr/xpg4/bin/sh. The description of the bug can be found at
##
## and the report of the original failure can be found at automake
## bug#10026
d2=$$d$$p; \
if test -d "$$d2"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
else \
list2="$$list2 $$d2"; \
fi; \
done; \
test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
done; }
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
$(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
fi; \
for file in $$list; do \
## Strip possible $(srcdir) prefix.
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
## 8+3 filesystems cannot deal with foo.info-N filenames: they all
## conflict. DJGPP comes with a tool, DJTAR, that will rename these
## files to foo.iNN while extracting the archive. DJGPP's makeinfo
## is patched to grok these filenames. However we have to account
## for the renaming when installing the info files.
##
## If $file == foo.info, then $file_i == foo.i. The reason we use two
## shell commands instead of one ('s|\.info$$|.i|') is so that a suffix-less
## 'foo' becomes 'foo.i' too.
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
echo "$$ifile"; \
else : ; fi; \
done; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
@if $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
## Strip directory
relfile=`echo "$$file" | sed 's|^.*/||'`; \
## Run ":" after install-info in case install-info fails. We really
## don't care about failures here, because they can be spurious. For
## instance if you don't have a dir file, install-info will fail. I
## think instead it should create a new dir file for you. This bug
## causes the "make distcheck" target to fail reliably.
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
## Use "|| :" here because Sun make passes -e to sh; if install-info
## fails then we'd fail if we used ";".
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-pdf-am: $(PDFS)
@$(NORMAL_INSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pdfdir)" || 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)$(pdfdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
install-ps-am: $(PSS)
@$(NORMAL_INSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(psdir)" || 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)$(psdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
else ! %?LOCAL-TEXIS%
install-dvi-am:
install-html-am:
install-info-am:
install-pdf-am:
install-ps-am:
endif ! %?LOCAL-TEXIS%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?LOCAL-TEXIS%
.PHONY uninstall-am: \
uninstall-dvi-am \
uninstall-html-am \
uninstall-info-am \
uninstall-ps-am \
uninstall-pdf-am
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
rm -f "$(DESTDIR)$(dvidir)/$$f"; \
done
uninstall-html-am:
@$(NORMAL_UNINSTALL)
@list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
## $f can be a directory, hence the -r.
echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
done
uninstall-info-am:
@$(PRE_UNINSTALL)
## Run two loops here so that we can handle PRE_UNINSTALL and
## NORMAL_UNINSTALL correctly.
@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
## install-info needs the actual info file. We use the installed one,
## rather than relying on one still being in srcdir or builddir.
## However, "make uninstall && make uninstall" should not fail,
## so we ignore failure if the file did not exist.
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
## DJGPP-style info files. See comment in install-info-am.
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
uninstall-pdf-am:
@$(NORMAL_UNINSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
done
uninstall-ps-am:
@$(NORMAL_UNINSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
rm -f "$(DESTDIR)$(psdir)/$$f"; \
done
endif %?LOCAL-TEXIS%
if %?LOCAL-TEXIS%
.PHONY: dist-info
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
## Strip possible $(srcdir) prefix.
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
if test -f $$file; then \
## Strip leading '$$d/'.
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f "$(distdir)/$$relfile" || \
cp -p $$file "$(distdir)/$$relfile"; \
else :; fi; \
done; \
done
endif %?LOCAL-TEXIS%
## ---------- ##
## Cleaning. ##
## ---------- ##
## The funny name is due to --cygnus influence; in Cygnus mode,
## 'clean-info' is a target that users can use.
if %?LOCAL-TEXIS%
.PHONY mostlyclean-am: mostlyclean-aminfo
.PHONY: mostlyclean-aminfo
mostlyclean-aminfo:
## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
## contain any directory created by "makeinfo --html", as well as the
## '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
-rm -rf %MOSTLYCLEAN%
.PHONY clean-am: clean-aminfo
clean-aminfo:
## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
## above for details.
?TEXICLEAN? -test -z "%TEXICLEAN%" \
?TEXICLEAN? || rm -rf %TEXICLEAN%
.PHONY maintainer-clean-am: maintainer-clean-aminfo
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
## .iNN files are DJGPP-style info files.
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
## above for details.
?MAINTCLEAN? -test -z "%MAINTCLEAN%" \
?MAINTCLEAN? || rm -rf %MAINTCLEAN%
endif %?LOCAL-TEXIS%
07070100024f80000081a400000000000000000000000153157aad00005139000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/distdir.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
if %?TOPDIR_P%
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)" \
## On MSYS (1.0.17) it is not possible to remove a directory that is in
## use; so, if the first rm fails, we sleep some seconds and retry, to
## give pending processes some time to exit and "release" the directory
## before we remove it. The value of "some seconds" is 5 for the moment,
## which is mostly an arbitrary value, but seems high enough in practice.
## See automake bug#10470.
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
endif %?TOPDIR_P%
if %?SUBDIRS%
## computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
## Input:
## - DIR1 relative pathname, relative to the current directory
## - DIR2 relative pathname, relative to the current directory
## Output:
## - reldir relative pathname of DIR2, relative to DIR1
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
endif %?SUBDIRS%
.PHONY: distdir
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += distdir
endif %?SUBDIRS%
distdir: $(DISTFILES)
##
## For Gnits users, this is pretty handy. Look at 15 lines
## in case some explanatory text is desirable.
##
if %?TOPDIR_P%
if %?CK-NEWS%
@case `sed 15q $(srcdir)/NEWS` in \
*"$(VERSION)"*) : ;; \
*) \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1;; \
esac
endif %?CK-NEWS%
endif %?TOPDIR_P%
##
## Only for the top dir.
##
if %?TOPDIR_P%
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
endif %?TOPDIR_P%
##
##
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
##
## Yet another hack to support SUN make.
##
## Let's assume 'foo' appears in DISTFILES and is not a built file.
## When building with VPATH=$(srcdir), SUN make and OSF1/Tru64 will
## rewrite 'foo' as '$(srcdir)/foo'. An attempt to install the file
## with
## cp $file $(distdir)/$file
## will thus install $(srcdir)/foo as $(distdir)/$(srcdir)/foo
## instead of $(distdir)/foo.
##
## So let's strip this leading $(srcdir)/ when it exists. (As far we
## know, only SUN make and OSF1/Tru64 make add it.) Searching whether
## the file is to be found in the source or build directory will be
## done later.
##
## In case we are _not_ using SUN or OSF1/Tru64 make, how can we be sure
## we are not stripping a legitimate filename that starts with the
## same pattern as $(srcdir)?
## Well, it can't happen without the Makefile author distributing
## something out of the distribution (which is bad). As an example,
## consider "EXTRA_DIST = ../bar". This is an issue if $srcdir is
## '..', however getting this value for srcdir is impossible:
## "EXTRA_DIST = ../bar" implies we are in a subdirectory (so '../bar'
## is within the package), hence '$srcdir' is something like
## '../../subdir'.
##
## There is more to say about files which are above the current directory,
## like '../bar' in the previous example. The OSF1/Tru64 make
## implementation can simplify filenames resulting from a VPATH lookup.
## For instance if "VPATH = ../../subdir" and '../bar' is found in that
## VPATH directory, then occurrences of '../bar' will be replaced by
## '../../bar' (instead of '../../subdir/../bar'). This obviously defeats
## any attempt to strip a leading $srcdir. Presently we have no workaround
## for this. We avoid this issue by writing "EXTRA_DIST = $(srcdir)/../bar"
## instead of "EXTRA_DIST = ../bar". This prefixing is needed only for files
## above the current directory. Fortunately, apart from auxdir files which
## can be located in .. or ../.., this situation hardly occurs in practice.
##
## Also rewrite $(top_srcdir) (which sometimes appears in DISTFILES, and can
## be absolute) by $(top_builddir) (which is always relative). $(srcdir) will
## be prepended later.
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
## (The second 't' command clears the flag for the next round.)
##
## Make the subdirectories for the files.
##
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
##
##
for file in $$dist_files; do \
##
## Always look for the file in the build directory first. That way
## for something like yacc output we will correctly pick up the latest
## version. Also check for directories in the build directory first,
## so one can ship generated directories.
##
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
##
## Use cp, not ln. There are situations in which "ln" can fail. For
## instance a file to distribute could actually be a cross-filesystem
## symlink -- this can easily happen if "gettextize" was run on the
## distribution.
##
if test -d $$d/$$file; then \
## Don't mention $$file in the destination argument, since this fails if
## the destination directory already exists. Also, use '-R' and not '-r'.
## '-r' is almost always incorrect.
##
## If a directory exists both in '.' and $(srcdir), then we copy the
## files from $(srcdir) first and then install those from '.'. This
## can help people who distribute directories made of source files
## *and* generated files. It is also important when the directory
## exists only in $(srcdir), because some vendor Make (such as Tru64)
## will magically create an empty directory in '.'.
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
## If the destination directory already exists, it may contain read-only
## files, e.g., during "make distcheck".
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 for file existence because sometimes a file gets included in
## DISTFILES twice. For example this happens when a single source
## file is used in building more than one program.
## See also test 'dist-repeated.test'.
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
##
## Test for directory existence here because previous automake
## invocation might have created some directories. Note that we
## explicitly set distdir for the subdir make; that lets us mix-n-match
## many automake-using packages into one large package, and have "dist"
## at the top level do the right thing. If we're in the topmost
## directory, then we use 'distdir' instead of 'top_distdir'; this lets
## us work correctly with an enclosing package.
if %?SUBDIRS%
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
## Disable am__remove_distdir so that sub-packages do not clear a
## directory we have already cleared and might even have populated
## (e.g. shared AUX dir in the sub-package).
am__remove_distdir=: \
## Disable filename length check:
am__skip_length_check=: \
## No need to fix modes more than once:
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
endif %?SUBDIRS%
##
## We might have to perform some last second updates, such as updating
## info files.
## We must explicitly set distdir and top_distdir for these sub-makes.
##
if %?DIST-TARGETS%
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
%DIST-TARGETS%
endif %?DIST-TARGETS%
##
## This complex find command will try to avoid changing the modes of
## links into the source tree, in case they're hard-linked.
##
## Ignore return result from chmod, because it might give an error
## if we chmod a symlink.
##
## Another nastiness: if the file is unreadable by us, we make it
## readable regardless of the number of links to it. This only
## happens in perverse cases.
##
## We use $(install_sh) because that is a known-portable way to modify
## the file in place in the source tree.
##
## If we are being invoked recursively, then there is no need to walk
## the whole subtree again. This is a complexity reduction for a deep
## hierarchy of subpackages.
##
if %?TOPDIR_P%
-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)"
if %?FILENAME_FILTER%
@if test -z "$(am__skip_length_check)" && find "$(distdir)" -type f -print | \
grep '^%FILENAME_FILTER%' 1>&2; then \
echo 'error: the above filenames are too long' 1>&2; \
exit 1; \
else :; fi
endif %?FILENAME_FILTER%
endif %?TOPDIR_P%
## --------------------------------------- ##
## Building various distribution flavors. ##
## --------------------------------------- ##
## Note that we don't use GNU tar's '-z' option. One reason (but not
## the only reason) is that some versions of tar (e.g., OSF1)
## interpret '-z' differently.
##
## The -o option of GNU tar used to exclude empty directories. This
## behavior was fixed in tar 1.12 (released on 1997-04-25). But older
## versions of tar are still used (for instance NetBSD 1.6.1 ships
## with tar 1.11.2). We do not do anything specific w.r.t. this
## incompatibility since packages where empty directories need to be
## present in the archive are really unusual.
##
## We order DIST_TARGETS by expected duration of the compressors,
## slowest first, for better parallelism in "make dist". Do not
## reorder DIST_ARCHIVES, users may expect gzip to be first.
if %?TOPDIR_P%
?GZIP?DIST_ARCHIVES += $(distdir).tar.gz
GZIP_ENV = --best
.PHONY: dist-gzip
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
.PHONY: dist-bzip2
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
.PHONY: dist-lzip
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
?XZ?DIST_ARCHIVES += $(distdir).tar.xz
.PHONY: dist-xz
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
.PHONY: dist-tarZ
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
?SHAR?DIST_ARCHIVES += $(distdir).shar.gz
.PHONY: dist-shar
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
?ZIP?DIST_ARCHIVES += $(distdir).zip
.PHONY: dist-zip
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
?LZIP?DIST_TARGETS += dist-lzip
?XZ?DIST_TARGETS += dist-xz
?SHAR?DIST_TARGETS += dist-shar
?BZIP2?DIST_TARGETS += dist-bzip2
?GZIP?DIST_TARGETS += dist-gzip
?ZIP?DIST_TARGETS += dist-zip
?COMPRESS?DIST_TARGETS += dist-tarZ
endif %?TOPDIR_P%
## ------------------------------------------------- ##
## Building all the requested distribution flavors. ##
## ------------------------------------------------- ##
## Currently we cannot use if/endif inside a rule. The file_contents
## parser needs work.
if %?TOPDIR_P%
.PHONY: dist dist-all
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += dist dist-all
endif %?SUBDIRS%
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
endif %?TOPDIR_P%
## ------------------------- ##
## Checking a distribution. ##
## ------------------------- ##
if %?TOPDIR_P%
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += distcheck
endif %?SUBDIRS%
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
.PHONY: distcheck
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
## Make the new source tree read-only. Distributions ought to work in
## this case. However, make the top-level directory writable so we
## can make our new subdirs.
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
## Undo the write access.
chmod a-w $(distdir)
## With GNU make, the following command will be executed even with "make -n",
## due to the presence of '$(MAKE)'. That is normally all well (and '$(MAKE)'
## is necessary for things like parallel distcheck), but here we don't want
## execution. To avoid MAKEFLAGS parsing hassles, use a witness file that a
## non-'-n' run would have just created.
test -d $(distdir)/_build || exit 0; \
## Compute the absolute path of '_inst'. Strip any leading DOS drive
## to allow DESTDIR installations. Otherwise "$(DESTDIR)$(prefix)" would
## expand to "c:/temp/am-dc-5668/c:/src/package/package-1.0/_inst".
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
## We will attempt a DESTDIR install in $dc_destdir. We don't
## create this directory under $dc_install_base, because it would
## create very long directory names.
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
?DISTCHECK-HOOK? && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
## Parallel BSD make may not start a new shell for each command in a recipe,
## so be sure to 'cd' back to the original directory after this.
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
?GETTEXT? --with-included-gettext \
## Additional flags for configure. Keep this last in the configure
## invocation so the developer and user can override previous options,
## and let the user's flags take precedence over the developer's ones.
$(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 \
## Make sure the package has proper DESTDIR support (we could not test this
## in the previous install/installcheck/uninstall test, because it's reasonable
## for installcheck to fail in a DESTDIR install).
## We make the '$dc_install_base' read-only because this is where files
## with missing DESTDIR support are likely to be installed.
&& chmod -R a-w "$$dc_install_base" \
## The logic here is quite convoluted because we must clean $dc_destdir
## whatever happens (it won't be erased by the next run of distcheck like
## $(distdir) is).
&& ({ \
## Build the directory, so we can cd into it even if "make install"
## didn't create it. Use mkdir, not $(MKDIR_P) because we want to
## fail if the directory already exists (PR/413).
(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 \
## Make sure to remove the dists we created in the test build directory.
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
## Cater to parallel BSD make (see above).
&& 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'
## Define distuninstallcheck_listfiles and distuninstallcheck separately
## from distcheck, so that they can be overridden by the user.
.PHONY: distuninstallcheck
distuninstallcheck_listfiles = find . -type f -print
## The 'dir' file (created by install-info) might still exist after
## uninstall, so we must be prepared to account for it. The following
## check is not 100% strict, but is definitely good enough, and even
## accounts for overridden $(infodir).
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
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
## Define distcleancheck_listfiles and distcleancheck separately
## from distcheck, so that they can be overridden by the user.
.PHONY: distcleancheck
distcleancheck_listfiles = find . -type f -print
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
endif %?TOPDIR_P%
07070100024f79000081a400000000000000000000000153157aac0000091b000001000001014cffffffffffffffff0000002f00000000root/usr/local/share/automake-1.13/am/clean.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## We must test each macro because it might be empty, and an empty "rm
## -rf" command looks disturbing. Also, the Solaris 2.4 "rm" will
## return an error if there are no arguments other than "-f".
mostlyclean-am: mostlyclean-generic
mostlyclean-generic:
%MOSTLYCLEAN_RMS%
clean-am: clean-generic mostlyclean-am
clean-generic:
%CLEAN_RMS%
distclean-am: distclean-generic clean-am
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)
%DISTCLEAN_RMS%
## Makefiles and their dependencies cannot be cleaned by
## an -am dependency, because that would prevent other distclean
## dependencies from calling make recursively. (The multilib
## cleaning rules do this.)
##
## If you change distclean here, you probably also want to change
## maintainer-clean below.
distclean:
-rm -f %MAKEFILE%
maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean-generic:
## FIXME: shouldn't we really print these messages before running
## the dependencies?
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
%MAINTAINER_CLEAN_RMS%
## See comment for distclean.
maintainer-clean:
-rm -f %MAKEFILE%
.PHONY: clean mostlyclean distclean maintainer-clean \
clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
?!SUBDIRS?clean: clean-am
?!SUBDIRS?distclean: distclean-am
?!SUBDIRS?mostlyclean: mostlyclean-am
?!SUBDIRS?maintainer-clean: maintainer-clean-am
07070100024f97000081a400000000000000000000000153157aaf00001429000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/tags.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
# 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 \
## Handle VPATH correctly.
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
## ---- ##
## ID. ##
## ---- ##
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
## ------ ##
## TAGS. ##
## ------ ##
ETAGS = etags
.PHONY: TAGS tags
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += TAGS
RECURSIVE_TARGETS += tags-recursive
tags: tags-recursive
else !%?SUBDIRS%
tags: tags-am
endif !%?SUBDIRS%
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
## We use the positional parameters to build the subdir list with
## absolute names, without the need to worry about white space in `pwd`.
set x; \
here=`pwd`; \
## Exuberant Ctags wants --etags-include,
## GNU Etags --include
## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files
## when no files are supplied, despite any --etags-include option.
## A workaround is to pass '.' as a file. This is what $empty_fix is for.
?SUBDIRS? if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
?SUBDIRS? include_option=--etags-include; \
?SUBDIRS? empty_fix=.; \
?SUBDIRS? else \
?SUBDIRS? include_option=--include; \
?SUBDIRS? empty_fix=; \
?SUBDIRS? fi; \
?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \
## Do nothing if we're trying to look in '.'.
?SUBDIRS? if test "$$subdir" = .; then :; else \
?SUBDIRS? test ! -f $$subdir/TAGS || \
## Note that the = is mandatory for --etags-include.
?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
?SUBDIRS? fi; \
?SUBDIRS? done; \
$(am__define_uniq_tagged_files); \
## Remove the 'x' we added first:
shift; \
## Make sure we have something to run etags on.
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
## --------------- ##
## vi-style tags. ##
## --------------- ##
CTAGS = ctags
.PHONY: CTAGS ctags
if %?SUBDIRS%
AM_RECURSIVE_TARGETS += CTAGS
RECURSIVE_TARGETS += ctags-recursive
ctags: ctags-recursive
else !%?SUBDIRS%
ctags: ctags-am
endif !%?SUBDIRS%
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
## Make sure we have something to run ctags on.
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
## --------------- ##
## "Global tags". ##
## --------------- ##
.PHONY: GTAGS
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
## ------- ##
## cscope ##
## ------- ##
if %?TOPDIR_P%
CSCOPE = cscope
.PHONY: cscope clean-cscope
AM_RECURSIVE_TARGETS += cscope
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
endif %?TOPDIR_P%
if %?SUBDIRS%
RECURSIVE_TARGETS += cscopelist-recursive
cscopelist: cscopelist-recursive
else !%?SUBDIRS%
cscopelist: cscopelist-am
endif !%?SUBDIRS%
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
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY distclean-am: distclean-tags
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
if %?TOPDIR_P%
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
endif %?TOPDIR_P%
07070100024f89000081a400000000000000000000000153157aad000003d0000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/library.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
%LIBRARY%: $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_DEPENDENCIES) $(EXTRA_%XLIBRARY%_DEPENDENCIES) %DIRSTAMP%
%SILENT%-rm -f %LIBRARY%
%VERBOSE%$(%XLIBRARY%_AR) %LIBRARY% $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_LIBADD)
%SILENT%$(RANLIB) %LIBRARY%
07070100024f87000081a400000000000000000000000153157aad000004ad000001000001014cffffffffffffffff0000003600000000root/usr/local/share/automake-1.13/am/lang-compile.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
## This file is read once per *language*, not per extension.
## ------------------------- ##
## Preprocessed Fortran 77. ##
## ------------------------- ##
## We also handle the case of preprocessing '.F' files into '.f' files.
if %?PPF77%
.F.f:
$(F77COMPILE) -F $<
endif %?PPF77%
## -------- ##
## Ratfor. ##
## -------- ##
## We also handle the case of preprocessing `.r' files into `.f' files.
if %?RATFOR%
.r.f:
$(RCOMPILE) -F $<
endif %?RATFOR%
07070100024f90000081a400000000000000000000000153157aae0000195d000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/mans.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1998-2013 Free Software Foundation, Inc.
## 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, 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, see .
include inst-vars.am
man%SECTION%dir = $(mandir)/man%SECTION%
## ------------ ##
## Installing. ##
## ------------ ##
## MANS primary are always installed in mandir, hence install-data
## is hard coded.
.PHONY: install-man
?INSTALL-MAN?install-data-am: install-man
?INSTALL-MAN?am__installdirs += "$(DESTDIR)$(man%SECTION%dir)"
.PHONY install-man: install-man%SECTION%
install-man%SECTION%: %DEPS%
@$(NORMAL_INSTALL)
if %?NOTRANS_MANS%
## Handle MANS with notrans_ prefix
@list1='%NOTRANS_SECT_LIST%'; \
?!HAVE_NOTRANS? list2=''; \
?HAVE_NOTRANS? list2='%NOTRANS_LIST%'; \
test -n "$(man%SECTION%dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
## Extract all items from notrans_man_MANS that should go in this section.
## This must be done dynamically to support conditionals.
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
## Accept for 'man1' files like 'foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'.
| sed -n '/\.%SECTION%[a-z]*$$/p'; \
fi; \
## Extract basename of manpage, change the extension if needed.
} | while read p; do \
## Find the file.
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
## Extract the basename of the man page and change the extension if needed.
sed 'n;s,.*/,,;p;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,' | \
sed 'N;N;s,\n, ,g' | { \
## We now have a list "sourcefile basename installed-name".
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man%SECTION%dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man%SECTION%dir)" || exit $$?; }; \
done; }
endif %?NOTRANS_MANS%
if %?TRANS_MANS%
## Handle MANS without notrans_ prefix
@list1='%TRANS_SECT_LIST%'; \
?!HAVE_TRANS? list2=''; \
?HAVE_TRANS? list2='%TRANS_LIST%'; \
test -n "$(man%SECTION%dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man%SECTION%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man%SECTION%dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
## Extract all items from notrans_man_MANS that should go in this section.
## This must be done dynamically to support conditionals.
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
## Accept for 'man1' files like `foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'.
| sed -n '/\.%SECTION%[a-z]*$$/p'; \
fi; \
## Extract basename of manpage, change the extension if needed.
} | while read p; do \
## Find the file.
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
## Extract the basename of the man page and change the extension if needed.
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
## We now have a list "sourcefile basename installed-name".
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man%SECTION%dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man%SECTION%dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man%SECTION%dir)" || exit $$?; }; \
done; }
endif %?TRANS_MANS%
## -------------- ##
## Uninstalling. ##
## -------------- ##
.PHONY: uninstall-man
?INSTALL-MAN?uninstall-am: uninstall-man
.PHONY uninstall-man: uninstall-man%SECTION%
uninstall-man%SECTION%:
@$(NORMAL_UNINSTALL)
if %?NOTRANS_MANS%
## Handle MANS with notrans_ prefix
@list='%NOTRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
## Extract all items from notrans_man_MANS that should go in this section.
## This must be done dynamically to support conditionals.
?HAVE_NOTRANS? l2='%NOTRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
## Accept for 'man1' files like 'foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'.
?HAVE_NOTRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
## Extract basename of manpage, change the extension if needed.
} | sed 's,.*/,,;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,'`; \
dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir)
endif %?NOTRANS_MANS%
if %?TRANS_MANS%
## Handle MANS without notrans_ prefix
@list='%TRANS_SECT_LIST%'; test -n "$(man%SECTION%dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
## Extract all items from man_MANS that should go in this section.
## This must be done dynamically to support conditionals.
?HAVE_TRANS? l2='%TRANS_LIST%'; for i in $$l2; do echo "$$i"; done | \
## Accept for 'man1' files like 'foo.1c' but not 'sub.1/foo.2' or 'foo-2.1.4'.
?HAVE_TRANS? sed -n '/\.%SECTION%[a-z]*$$/p'; \
## Extract basename of manpage, run it through the program rename
## transform, and change the extension if needed.
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir)
endif %?TRANS_MANS%
07070100024f82000081a400000000000000000000000153157aad000015d9000001000001014cffffffffffffffff0000003500000000root/usr/local/share/automake-1.13/am/header-vars.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
VPATH = @srcdir@
@SET_MAKE@
## We used to define this. However, we don't because vendor makes
## (e.g., Solaris, Irix) won't correctly propagate variables that are
## defined in Makefile. This particular variable can't be correctly
## defined by configure (at least, not the current configure), so we
## simply avoid defining it to allow the user to use this feature with
## a vendor make.
## DESTDIR =
## Shell code that determines whether we are running under GNU make.
## This is somewhat of an hack, and might be improved, but is good
## enough for now.
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
## Shell code that determines whether the current make instance is
## running with a given one-letter option (e.g., -k, -n) that takes
## no argument.
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 \
## The format of $(MAKEFLAGS) is quite tricky with GNU make; the
## variable $(MFLAGS) behaves much better in that regard. So use it.
sane_makeflags=$$MFLAGS; \
else \
## Non-GNU make: we must rely on $(MAKEFLAGS). This is tricker and more
## brittle, but is the best we can do.
case $$MAKEFLAGS in \
## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS
## to " TESTS=foo\ nap", so that the simpler loop below (on word-split
## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
## misinterpret that as and indication that make is running in dry mode.
## This has already happened in practice. So we need this hack.
*\\[\ \ ]*) \
## Extra indirection with ${bs} required by FreeBSD 8.x make.
## Not sure why (so sorry for the cargo-cult programming here).
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;; \
##
## GNU make 3.83 has changed the format of $MFLAGS, and removed the space
## between an option and its argument (e.g., from "-I dir" to "-Idir").
## So we need to handle both formats, at least for options valid in GNU
## make. OTOH, BSD make formats $(MAKEFLAGS) by separating all options,
## and separating any option from its argument, so things are easier
## there.
##
## For GNU make and BSD make.
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
## For GNU make >= 3.83.
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
## For GNU make (possibly overkill, this one).
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
## For BSD make.
-[dEDm]) skip_next=yes;; \
## For NetBSD make.
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
## Shell code that determines whether make is running in "dry mode"
## ("make -n") or not. Useful in rules that invoke make recursively,
## and are thus executed also with "make -n" -- either because they
## are declared as dependencies to '.MAKE' (NetBSD make), or because
## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
## Shell code that determines whether make is running in "keep-going mode"
## ("make -k") or not. Useful in rules that must recursively descend into
## subdirectories, and decide whether to stop at the first error or not.
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
## Some derived variables that have been found to be useful.
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)
## These are defined because otherwise make on NetBSD V1.1 will print
## (eg): $(NORMAL_INSTALL) expands to empty string.
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
## dejagnu.am uses these variables. Some users might rely on them too.
?BUILD?build_triplet = @build@
?HOST?host_triplet = @host@
?TARGET?target_triplet = @target@
07070100024f85000081a400000000000000000000000153157aad00000f99000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/install.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
## ----------------------------------------- ##
## installdirs -- Creating the installdirs. ##
## ----------------------------------------- ##
## The reason we loop over %am__installdirs% (instead of simply running
## $(MKDIR_P) %am__installdirs%) is that directories variable such as
## "$(DESTDIR)$(mydir)" can potentially expand to "" if $(mydir) is
## conditionally defined. BTW, those directories are quoted in order
## to support installation paths with spaces.
if %?SUBDIRS%
.PHONY: installdirs installdirs-am
RECURSIVE_TARGETS += installdirs-recursive
installdirs: installdirs-recursive
installdirs-am:%installdirs-local%
?am__installdirs? for dir in %am__installdirs%; do \
?am__installdirs? test -z "$$dir" || $(MKDIR_P) "$$dir"; \
?am__installdirs? done
else !%?SUBDIRS%
.PHONY: installdirs
installdirs:%installdirs-local%
?am__installdirs? for dir in %am__installdirs%; do \
?am__installdirs? test -z "$$dir" || $(MKDIR_P) "$$dir"; \
?am__installdirs? done
endif !%?SUBDIRS%
## ----------------- ##
## Install targets. ##
## ----------------- ##
.PHONY: install install-exec install-data uninstall
.PHONY: install-exec-am install-data-am uninstall-am
if %?SUBDIRS%
RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
install-recursive uninstall-recursive
install:%maybe_BUILT_SOURCES% install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
else !%?SUBDIRS%
install:%maybe_BUILT_SOURCES% install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
endif !%?SUBDIRS%
if %?maybe_BUILT_SOURCES%
.MAKE: install
endif %?maybe_BUILT_SOURCES%
.MAKE .PHONY: install-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
.PHONY: installcheck
?SUBDIRS?installcheck: installcheck-recursive
?!SUBDIRS?installcheck: installcheck-am
?!SUBDIRS?.PHONY: installcheck-am
?!SUBDIRS?installcheck-am:
## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
## in subdirectories, so never set it to a value relative to the top
## directory.
.MAKE .PHONY: install-strip
install-strip:
## Beware that there are two variables used to install programs:
## INSTALL_PROGRAM is used for ordinary *_PROGRAMS
## install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
## creates directories)
## It's OK to override both with INSTALL_STRIP_PROGRAM, because
## INSTALL_STRIP_PROGRAM uses install-sh (see m4/strip.m4 for a rationale).
##
## Use double quotes for the *_PROGRAM settings because we might need to
## interpolate some backquotes at runtime.
##
## The case for empty $(STRIP) is separate so that it is quoted correctly for
## multiple words, but does not expand to an empty words if STRIP is empty.
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
07070100024f7d000081a400000000000000000000000153157aac00000e53000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/dejagnu.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## Name of tool to use. Default is the same as the package.
DEJATOOL = $(PACKAGE)
## Default flags to pass to dejagnu. The user can override this.
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
EXPECT = expect
RUNTEST = runtest
.PHONY: check-DEJAGNU
check-DEJAGNU: site.exp
## Life is easiest with an absolute srcdir, so do that.
srcdir='$(srcdir)'; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
## If runtest can't be found, print a warning but don't die. It is
## pointless to cause a failure if the tests cannot be run at all.
if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
fi; \
exit $$exit_status
## ------------------- ##
## Building site.exp. ##
## ------------------- ##
## Note that in the rule we don't directly generate site.exp to avoid
## the possibility of a corrupted site.exp if make is interrupted.
## Jim Meyering has some useful text on this topic.
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
@echo 'Making a new site.exp file ...'
@echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp
@echo 'set srcdir "$(srcdir)"' >>site.tmp
@echo "set objdir `pwd`" >>site.tmp
## Quote the *_alias variables because they might be empty.
?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp
?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
?HOST? @echo 'set host_alias "$(host_alias)"' >>site.tmp
?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp
?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
## Allow the package author to extend site.exp.
@list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
echo "## Begin content included from file $$f. Do not modify. ##" \
&& cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
&& echo "## End content included from file $$f. ##" \
|| exit 1; \
done >> site.tmp
@echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
@if test -f site.exp; then \
sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
fi
@-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak
@mv site.tmp site.exp
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY distclean-am: distclean-DEJAGNU
distclean-DEJAGNU:
## Any other cleaning must be done by the user or by the test suite
## itself. We can't predict what dejagnu or the test suite might
## generate.
-rm -f site.exp site.bak
-l='$(DEJATOOL)'; for tool in $$l; do \
rm -f $$tool.sum $$tool.log; \
done
07070100024f8c000081a400000000000000000000000153157aae00001010000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/lisp.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1996-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ---------- ##
## Building. ##
## ---------- ##
.el.elc:
## We add $(builddir) and $(srcdir) to load-path, so that any '.el' files
## that $< depends upon can be found (including generated ones).
## We prefer files from the build directory to those from the source
## directory, in true VPATH spirit.
## The destination file is normally determined by appending "c" to the
## input (which would erronously put it in $(srcdir) in VPATH builds),
## so we override that, too.
if test "$(EMACS)" != "no"; then \
am__subdir_includes=''; \
case $@ in */*) \
am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \
am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \
esac; \
## Emacs byte-compilation won't create this automatically, sadly.
test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \
$(EMACS) --batch \
$(AM_ELCFLAGS) $(ELCFLAGS) \
$$am__subdir_includes -L $(builddir) -L $(srcdir) \
--eval "(defun byte-compile-dest-file (f) \"$@\")" \
--eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"; \
else :; fi
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
?EXEC?.PHONY install-exec-am: install-%DIR%LISP
?!EXEC?.PHONY install-data-am: install-%DIR%LISP
install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
@$(NORMAL_INSTALL)
## Do not install anything if EMACS was not found.
@if test "$(EMACS)" != no && test -n "$(%NDIR%dir)"; then \
?!BASE? $(am__vpath_adj_setup) \
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
list='$(%DIR%_LISP)'; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do \
## A lisp file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
?BASE? $(am__strip_dir) \
?!BASE? $(am__vpath_adj) \
echo " $(%DIR%LISP_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
$(%DIR%LISP_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
## Only install .elc file if it exists.
if test -f $${p}c; then \
echo " $(%DIR%LISP_INSTALL) '$${p}c' '$(DESTDIR)$(%NDIR%dir)/$${f}c'"; \
$(%DIR%LISP_INSTALL) "$${p}c" "$(DESTDIR)$(%NDIR%dir)/$${f}c" || exit $$?; \
else : ; fi; \
done; \
else : ; fi
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%LISP
uninstall-%DIR%LISP:
@$(NORMAL_UNINSTALL)
## Do not uninstall anything if EMACS was not found.
@test "$(EMACS)" != no && test -n "$(%NDIR%dir)" || exit 0; \
list='$(%DIR%_LISP)'; \
?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
files="$$files "`echo "$$files" | sed 's|$$|c|'`; \
dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY clean-am: clean-lisp
clean-lisp:
-rm -f $(ELCFILES)
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%
07070100024f76000081a400000000000000000000000153157aac000055cb000001000001014cffffffffffffffff0000002f00000000root/usr/local/share/automake-1.13/am/check.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
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; \
## If stdout is a non-dumb tty, use colors. If test -t is not supported,
## then this check fails; a conservative approach. Of course do not
## redirect stdout here, just stderr.
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='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
fi; \
}
.PHONY: check-TESTS
if !%?SERIAL_TESTS%
include inst-vars.am
## New parallel test driver.
##
## The first version of the code here was adapted from check.mk, which was
## originally written at EPITA/LRDE, further developed at Gostai, then made
## its way from GNU coreutils to end up, largely rewritten, in Automake.
## The current version is an heavy rewrite of that, to allow for support
## of more test metadata, and the use of custom test drivers and protocols
## (among them, TAP).
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) '{ \
## By default, we assume the test is to be re-run.
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
## If we've encountered an I/O error here, there are three possibilities:
##
## [1] The '.log' file exists, but the '.trs' does not; in this case,
## we "gracefully" recover by assuming the corresponding test is
## to be re-run (which will re-create the missing '.trs' file).
##
## [2] Both the '.log' and '.trs' files are missing; this means that
## the corresponding test has not been run, and is thus *not* to
## be re-run.
##
## [3] We have encountered some corner-case problem (e.g., a '.log' or
## '.trs' files somehow made unreadable, or issues with a bad NFS
## connection, or whatever); we don't handle such corner cases.
##
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
## A directive explicitly specifying the test is *not* to be re-run.
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
## A directive explicitly specifying the test *is* to be re-run.
break; \
} \
## else continue with the next iteration.
}; \
if (recheck) \
print $$0; \
## Don't leak open file descriptors, as this could cause serious
## problems when there are many tests (yes, even on Linux).
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"; \
} \
{ \
## By default, we assume the test log is to be copied in the global log,
## and that its result is simply "RUN" (i.e., we still don't know what
## it outcome was, but we know that at least it has run).
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"; \
}; \
## Don't leak open file descriptors, as this could cause serious
## problems when there are many tests (yes, even on Linux).
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; \
## The use of $dir below is required to account for VPATH
## rewriting done by Sun make.
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$$//'`; \
## Trim away any extra whitespace. This has already proved useful
## in avoiding weird bug on lesser make implementations. It also
## works around the GNU make 3.80 bug where trailing whitespace in
## "TESTS = foo.test $(empty)" causes $(TESTS_LOGS) to erroneously
## expand to "foo.log .log".
bases=`echo $$bases`
# 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); \
## Helper shell function, tells whether a path refers to an existing,
## regular, readable file.
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
## We need to ensures that all the required '.trs' and '.log' files will
## be present and readable. The direct dependencies of $(TEST_SUITE_LOG)
## only ensure that all the '.log' files exists; they don't ensure that
## the '.log' files are readable, and worse, they don't ensure that the
## '.trs' files even exist.
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 \
## Uh-oh, either some '.log' files were unreadable, or some '.trs' files
## were missing (or unreadable). We need to re-run the corresponding
## tests in order to re-create them.
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 \
## Break "rm -f" into two calls to minimize the possibility of exceeding
## command line length limits.
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
## Use a trick to to ensure that we don't go into an infinite recursion
## in case a test log in $(TEST_LOGS) is the same as $(TEST_SUITE_LOG).
## Yes, this has already happened in practice. Sigh!
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 \
## Sanity check: each unreadable or non-existent test result file should
## has been properly remade at this point, as should the corresponding log
## file.
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
## We need a new subshell to work portably with "make -n", since the
## previous part of the recipe contained a $(MAKE) invocation.
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
## List of test result files.
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
## Prepare data for the test suite summary. These do not take into account
## unreadable test results, but they'll be appropriately updated later if
## needed.
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`; \
## Whether the testsuite was successful or not.
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
## Make $br a line of exactly 76 '=' characters, that will be used to
## enclose the testsuite summary report when displayed on the console.
br='==================='; br=$$br$$br$$br$$br; \
## When writing the test summary to the console, we want to color a line
## reporting the count of some result *only* if at least one test
## experienced such a result. This function is handy in this regard.
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}"; \
}; \
## A shell function that creates the testsuite summary. We need it
## because we have to create *two* summaries, one for test-suite.log,
## and a possibly-colorized one for console output.
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"; \
}; \
## Write "global" testsuite log.
{ \
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); \
## Emit the test summary on the console.
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
## Multi line coloring is problematic with "less -R", so we really need
## to color each line individually.
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
echo "$${col}$$br$${std}"; \
## This is expected to go to the console, so it might have to be colorized.
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; \
## Be sure to exit with the proper exit status. The use of "exit 1" below
## is required to work around a FreeBSD make bug (present only when running
## in concurrent mode). See automake bug#9245:
##
## and FreeBSD PR bin/159730:
## .
$$success || exit 1
RECHECK_LOGS = $(TEST_LOGS)
## ------------------------------------------ ##
## Running all tests, or rechecking failures. ##
## ------------------------------------------ ##
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
## We always have to remove $(TEST_SUITE_LOG), to ensure its rule is run
## in any case even in lazy mode: otherwise, if no test needs rerunning,
## or a prior run plus reruns all happen within the same timestamp (can
## happen with a prior "make TESTS="), then we get no log output.
## OTOH, this means that, in the rule for '$(TEST_SUITE_LOG)', we
## cannot use '$?' to compute the set of lazily rerun tests, lest
## we rely on .PHONY to work portably.
@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`; \
## Remove newlines and normalize whitespace. Trailing (and possibly
## leading) whitespace is known to cause segmentation faults on
## Solaris 10 XPG4 make.
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
## Be sure to exit with the proper exit status (automake bug#9245). See
## comments in the recipe of $(TEST_SUITE_LOG) above for more information.
exit $$?;
## Recheck must depend on $(check_SCRIPTS), $(check_PROGRAMS), etc.
## It must also depend on the 'all' target. See automake bug#11252.
recheck: all %CHECK_DEPS%
## See comments above in the check-TESTS recipe for why remove
## $(TEST_SUITE_LOG) here.
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
## We must only consider tests that had an unexpected outcome (FAIL
## or XPASS) in the earlier run.
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`; \
## Remove newlines and normalize whitespace. Trailing (and possibly
## leading) whitespace is known to cause segmentation faults on
## Solaris 10 XPG4 make.
log_list=`echo $$log_list`; \
## Move the '.log' and '.trs' files associated with the tests to be
## re-run out of the way, so that those tests will be re-run by the
## "make test-suite.log" recursive invocation below.
## Two tricky requirements:
## - we must avoid extra files removal when running under "make -n";
## - in case the test is a compiled program whose compilation fails,
## we must ensure that any '.log' and '.trs' file referring to such
## test are preserved, so that future "make recheck" invocations
## will still try to re-compile and re-run it (automake bug#11791).
## The tricky recursive make invocation below should cater to such
## requirements.
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
## Be sure to exit with the proper exit status (automake bug#9245). See
## comments in the recipe of $(TEST_SUITE_LOG) above for more information.
exit $$?
AM_RECURSIVE_TARGETS += check recheck
.PHONY: recheck
else %?SERIAL_TESTS%
## Obsolescent serial testsuite driver.
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
## Make sure Solaris VPATH-expands all members of this list, even
## the first and the last one; thus the spaces around $(TESTS)
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
## Note: Solaris 2.7 seems to expand TESTS using VPATH. That's
## why we also try 'dir='.
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
## Success
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
## Failure
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
## Skipped
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
## Prepare the banner
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
## DASHES should contain the largest line of the banner.
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
col="$$grn"; \
else \
col="$$red"; \
fi; \
## Multi line coloring is problematic with "less -R", so we really need
## to color each line individually.
echo "$${col}$$dashes$${std}"; \
echo "$${col}$$banner$${std}"; \
test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
test -z "$$report" || echo "$${col}$$report$${std}"; \
echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
endif %?SERIAL_TESTS%
07070100024f86000081a400000000000000000000000153157aad00000b2c000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/java.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1998-2013 Free Software Foundation, Inc.
## 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, 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, see .
## ---------- ##
## Building. ##
## ---------- ##
if %?FIRST%
JAVAC = javac
CLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT)$${CLASSPATH:+":$$CLASSPATH"}
JAVAROOT = $(top_builddir)
endif %?FIRST%
class%NDIR%.stamp: $(am__java_sources)
@list1='$?'; list2=; if test -n "$$list1"; then \
for p in $$list1; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
list2="$$list2 $$d$$p"; \
done; \
echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) '"$$list2"; \
$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) $$list2; \
else :; fi
echo timestamp > $@
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%JAVA
?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
install-%DIR%JAVA: class%NDIR%.stamp
@$(NORMAL_INSTALL)
## A single .java file can be compiled into multiple .class files. So
## we just install all the .class files that got built into this
## directory. This is not optimal, but will have to do for now.
@test -n "$(%DIR%_JAVA)" && test -n "$(%NDIR%dir)" || exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"; \
set x *.class; shift; test "$$1" != "*.class" || exit 0; \
echo " $(INSTALL_DATA)" "$$@" "'$(DESTDIR)$(%NDIR%dir)/$$p'"; \
$(INSTALL_DATA) "$$@" "$(DESTDIR)$(%NDIR%dir)"
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%JAVA
uninstall-%DIR%JAVA:
@$(NORMAL_UNINSTALL)
@test -n "$(%DIR%_JAVA)" && test -n "$(%NDIR%dir)" || exit 0; \
set x *.class; shift; test "$$1" != "*.class" || exit 0; \
echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" "$$@" ")"; \
cd "$(DESTDIR)$(%NDIR%dir)" && rm -f "$$@"
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY clean-am: clean-%NDIR%JAVA
clean-%NDIR%JAVA:
-rm -f *.class class%NDIR%.stamp
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%
07070100024f8e000081a400000000000000000000000153157aae000003a5000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/ltlibrary.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
%LTLIBRARY%: $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_DEPENDENCIES) $(EXTRA_%XLTLIBRARY%_DEPENDENCIES) %DIRSTAMP%
%VERBOSE%$(%XLINK%) %RPATH% $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_LIBADD) $(LIBS)
07070100024f78000081a400000000000000000000000153157aac00000332000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/clean-hdr.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
.PHONY: distclean-hdr
distclean-am: distclean-hdr
distclean-hdr:
-rm -f %FILES%
07070100024f84000081a400000000000000000000000153157aad00000d90000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/inst-vars.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2004-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?FIRST%
## These variables help stripping any $(VPATH) that some
## Make implementations prepend before VPATH-found files.
## The issue is discussed at length in distdir.am.
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;
## Strip all directories.
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
## Number of files to install concurrently.
am__install_max = 40
## Take a $list of nobase files, strip $(srcdir) from them.
## Split apart in setup variable and an action that can be used
## in backticks or in a pipe.
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/||"
## Take a $list of nobase files, collect them, indexed by their
## srcdir-stripped dirnames. For up to am__install_max files, output
## a line containing the dirname and the files, space-separated.
## The arbitrary limit helps avoid the quadratic scaling exhibited by
## string concatenation in most shells, and should avoid line length
## limitations, while still offering only negligible performance impact
## through spawning more install commands than absolutely needed.
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] }'
## Collect up to 40 files per line from stdin.
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
## A shell code fragment to uninstall files from a given directory.
## It expects the $dir and $files shell variables to be defined respectively
## to the directory where the files to be removed are, and to the list of
## such files.
am__uninstall_files_from_dir = { \
## Some rm implementations complain if 'rm -f' is used without arguments.
test -z "$$files" \
## At least Solaris /bin/sh still lacks 'test -e', so we use the multiple
## tests below instead. We expect $dir to be either non-existent or a
## directory, so the failure we'll experience if it is a regular file
## is indeed desired and welcome (better to fail loudly thasn silently).
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
endif %?FIRST%
07070100024f7f000081a400000000000000000000000153157aac00001cf4000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/depend2.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## This file is read several times:
## - once per *extension* (not per language) for generic compilation rules
## - once for each file which requires specific flags.
## Note it is on purpose we wrote "if %AMDEP%", since:
##
## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
## the "if FALSE" chunk is removed (automake-time conditionals).
##
## - if deps are on, %AMDEP% is mapped onto AMDEP, and therefore
## the "if AMDEP" chunk is prefix with @AMDEP_TRUE@ just like for any
## other configure-time conditional.
##
## We do likewise for %FASTDEP%; this expands to an ordinary
## configure-time conditional. %FASTDEP% is used to speed up the
## common case of building a package with gcc 3.x. In this case we
## can skip the use of depcomp and easily inline the dependency
## tracking.
## Verbosity of FASTDEP rules
## --------------------------
## (1) Some people want to see what happens during make. They think
## @-commands are evil because hiding things hinders debugging.
## (2) Other people want to see only the important commands--those that
## may produce diagnostics, such as compiler invocations. They
## do not care about build details such as dependency generation
## (the if/then/else machinery in FASTDEP rules). Their point is
## that it is hard to spot diagnostics in a verbose output.
## (3) Other people want "make -s" to work as expected: silently.
## This way they can spot any diagnostic really easily.
##
## The second point suggests we hide rules with @ and that we 'echo'
## only the relevant parts. However this goes against the two others.
## There are regular complaints about this on the mailing list, but
## it's hard to please everybody. On April 2003, William Fulton (from
## clan (3)) and Karl Berry (from clan (2)) agreed that folding the
## compile rules so that they are output on a single line (instead of 5)
## would be a good compromise. Actually we use two lines rather than one,
## because this way %SOURCE% is always located at the end of the first
## line and is therefore easier to spot. (We need an extra line when
## depbase is used.)
if %?NONLIBTOOL%
?GENERIC?%EXT%.o:
?!GENERIC?%OBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??!SUBDIROBJ? %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE% &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
if %?GENERIC%
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
else !%?GENERIC%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
endif !%?GENERIC%
endif !%FASTDEP%
?GENERIC?%EXT%.obj:
?!GENERIC?%OBJOBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??!SUBDIROBJ? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
if %?GENERIC%
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
else !%?GENERIC%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?-o? %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
?!-o? %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
endif !%?GENERIC%
endif !%FASTDEP%
endif %?NONLIBTOOL%
if %?LIBTOOL%
?GENERIC?%EXT%.lo:
?!GENERIC?%LTOBJ%: %SOURCE%
if %FASTDEP%
## In fast-dep mode, we can always use -o.
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!GENERIC? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
?GENERIC??!SUBDIROBJ? %VERBOSE%%LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
?GENERIC??!SUBDIROBJ? %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
?GENERIC??SUBDIROBJ? %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
?GENERIC??SUBDIROBJ? $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
else !%FASTDEP%
if %AMDEP%
%VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
## We can always use '-o' with Libtool.
?GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
endif !%FASTDEP%
endif %?LIBTOOL%
07070100024f8b000081a400000000000000000000000153157aae00000406000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/libtool.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
.PHONY: mostlyclean-libtool clean-libtool distclean-libtool
mostlyclean-am: mostlyclean-libtool
mostlyclean-libtool:
-rm -f *.lo
clean-am: clean-libtool
clean-libtool:
?LTRMS?%LTRMS%
?TOPDIR_P?distclean-am: distclean-libtool
?TOPDIR_P?distclean-libtool:
?TOPDIR_P? -rm -f libtool config.lt
07070100024f77000081a400000000000000000000000153157aac00000893000001000001014cffffffffffffffff0000003000000000root/usr/local/share/automake-1.13/am/check2.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2008-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?FIRST%
## When BSD make is run in parallel mode, it apparently strips any
## leading directory component from the automatic variable '$*' (of
## course, against what POSIX mandates). Try to detect and work
## around this incompatibility.
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$//'`; \
esac;; \
*) \
b='$*';; \
esac
endif %?FIRST%
## From a test file to a .log and .trs file.
?GENERIC?%EXT%.log:
?!GENERIC?%OBJ%: %SOURCE%
@p='%SOURCE%'; \
## Another hack to support BSD make in parallel mode.
?!GENERIC? b='%BASE%'; \
?GENERIC? $(am__set_b); \
$(am__check_pre) %DRIVER% --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
"$$tst" $(AM_TESTS_FD_REDIRECT)
## If no programs are built in this package, then this rule is removed
## at automake time. Otherwise, %am__EXEEXT% expands to a configure time
## conditional, true if $(EXEEXT) is nonempty, thus this rule does not
## conflict with the previous one.
if %am__EXEEXT%
?GENERIC?%EXT%$(EXEEXT).log:
@p='%SOURCE%'; \
## Another hack to support BSD make in parallel mode.
?!GENERIC? b='%BASE%'; \
?GENERIC? $(am__set_b); \
$(am__check_pre) %DRIVER% --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
"$$tst" $(AM_TESTS_FD_REDIRECT)
endif %am__EXEEXT%
07070100024f8a000081a400000000000000000000000153157aae00000f31000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/libs.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
@$(NORMAL_INSTALL)
if %?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \
$(INSTALL_DATA) $$list2 "$(DESTDIR)$(%NDIR%dir)" || exit $$?; }
else !%?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for p in $$files; do \
if test -f "$$p"; then xfiles="$$xfiles $$p"; else :; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
done
endif !%?BASE%
## We do two loops here so that $(POST_INSTALL) can be empty. If we
## merge the two loops, we get a syntax error from sh. Anyway, having
## $(POST_INSTALL) in the middle of the loop essentially renders it
## useless; sh never actually executes this command. Read the GNU
## Standards for a little enlightenment on this.
@$(POST_INSTALL)
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
for p in $$list; do \
if test -f $$p; then \
?BASE? $(am__strip_dir) \
?!BASE? f=$$p; \
## Must ranlib after installing because mod time changes.
## cd to target directory because AIX ranlib messes up with whitespace
## in the argument.
echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && $(RANLIB) $$f )"; \
( cd "$(DESTDIR)$(%NDIR%dir)" && $(RANLIB) $$f ) || exit $$?; \
else :; fi; \
done
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%LIBRARIES
uninstall-%DIR%LIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY clean-am: clean-%DIR%LIBRARIES
clean-%DIR%LIBRARIES:
-test -z "$(%DIR%_LIBRARIES)" || rm -f $(%DIR%_LIBRARIES)
07070100024f93000081a400000000000000000000000153157aae00001460000001000001014cffffffffffffffff0000003000000000root/usr/local/share/automake-1.13/am/python.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1999-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON
install-%DIR%PYTHON: $(%DIR%_PYTHON)
@$(NORMAL_INSTALL)
if %?BASE%
@list='$(%DIR%_PYTHON)'; dlist=; list2=; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
## Compute basename of source file. Unless this is a nobase_ target, we
## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.py',
## not '$(DESTDIR)$(%NDIR%dir)/python/foo.py'.
$(am__strip_dir) \
dlist="$$dlist $$f"; \
list2="$$list2 $$b$$p"; \
else :; fi; \
done; \
for file in $$list2; do echo $$file; done | $(am__base_list) | \
while read files; do \
## Don't perform translation, since script name is important.
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(%NDIR%dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \
done || exit $$?; \
## Byte-compile must be done at install time, since file times are
## encoded in the actual files.
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(%NDIR%dir)" $$dlist; \
else :; fi
else !%?BASE%
@list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for p in $$files; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f "$$b$$p"; then xfiles="$$xfiles $$b$$p"; dlist="$$dlist $$p"; \
else :; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
## Don't perform translation, since script name is important.
echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
## Byte-compile must be done at install time, since file times are
## encoded in the actual files.
if test -n "$$dlist"; then \
$(am__py_compile) --destdir "$(DESTDIR)" \
--basedir "$(%NDIR%dir)" $$dlist; \
else :; fi \
done
endif !%?BASE%
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
?FIRST?am__pep3147_tweak = \
?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|'
.PHONY uninstall-am: uninstall-%DIR%PYTHON
uninstall-%DIR%PYTHON:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
?BASE? py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); py_files=`$(am__nobase_strip)`; \
test -n "$$py_files" || exit 0; \
dir='$(DESTDIR)$(%NDIR%dir)'; \
## Also remove the .pyc and .pyo byte compiled versions.
## This is somewhat tricky, because for newer pythons we have to take
## PEP-3147 into account.
pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \
echo "$$py_files_pep3147";\
pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \
pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \
st=0; \
for files in \
"$$py_files" \
"$$pyc_files" \
"$$pyo_files" \
## Installation of '.py' files is not influenced by PEP-3147, so it
## is correct *not* to have $pyfiles_pep3147 here.
"$$pyc_files_pep3147" \
"$$pyo_files_pep3147" \
; do \
$(am__uninstall_files_from_dir) || st=$$?; \
done; \
exit $$st
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
## There is nothing to clean here since files are
## byte-compiled when (and where) they are installed.
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%
07070100024f88000081a400000000000000000000000153157aad0000052b000001000001014cffffffffffffffff0000002d00000000root/usr/local/share/automake-1.13/am/lex.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
## See the comment about am__skipyacc in yacc.am.
if %?MAINTAINER-MODE%
if %?FIRST%
@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||
endif %?FIRST%
endif %?MAINTAINER-MODE%
?GENERIC?%EXT%%DERIVED-EXT%:
?!GENERIC?%OBJ%: %SOURCE%
?GENERIC? %VERBOSE%$(am__skiplex) $(SHELL) $(YLWRAP) %SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
?!GENERIC? %VERBOSE% \
?!GENERIC??DIST_SOURCE? $(am__skiplex) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
07070100024f9c000081a400000000000000000000000153157aaf00000964000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/yacc.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1998-2013 Free Software Foundation, Inc.
## 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, 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, see .
## We want to disable the Yacc rebuild rule when
## 1. AM_MAINTAINER_MODE is used, and
## 2. --enable-maintainer-mode is not specified, and
## 3. parser.c already exist, and
## 4. parser.y and parser.c are distributed.
## Point #3 is because "make maintainer-clean" erases parser.c, yet
## the GNU Coding Standards require that ./configure; make works even
## after that.
## Point #4 is because parsers listed in nodist_*_SOURCES are always
## built on the user's side, so it makes no sense to disable them.
##
## Points #1, #2, #3 are solved by unconditionally prefixing the rule
## with $(am__skipyacc) defined below only when needed.
##
## Point #4 requires a condition on whether parser.y/parser.c are
## distributed or not. We cannot have a generic rule that works in
## both cases, so we ensure in automake that nodist_ parsers always
## use non-generic rules.
if %?FIRST%
if %?MAINTAINER-MODE%
@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
endif %?MAINTAINER-MODE%
## The 's/c$/h/' substitution *must* be the last one.
am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-e s/c++$$/h++/ -e s/c$$/h/
endif %?FIRST%
?GENERIC?%EXT%%DERIVED-EXT%:
?!GENERIC?%OBJ%: %SOURCE%
?GENERIC? %VERBOSE%$(am__skipyacc) $(SHELL) $(YLWRAP) %SOURCE% y.tab.c %OBJ% y.tab.h `echo %OBJ% | $(am__yacc_c2h)` y.output %BASE%.output -- %COMPILE%
?!GENERIC? %VERBOSE% \
?!GENERIC??DIST_SOURCE? $(am__skipyacc) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% y.tab.c %OBJ% y.tab.h `echo %OBJ% | $(am__yacc_c2h)` y.output %BASE%.output -- %COMPILE%
07070100024f9b000081a400000000000000000000000153157aaf00000300000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/vala.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2008-2013 Free Software Foundation, Inc.
## 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, 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, see .
## There is no rule here. :-)
07070100024f91000081a400000000000000000000000153157aae000004cf000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/program.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES) $(EXTRA_%XPROGRAM%_DEPENDENCIES) %DIRSTAMP%
## Remove program before linking. Otherwise the link will fail if the
## program is running somewhere. FIXME: this could be a loss if
## you're using an incremental linker. Maybe we should think twice?
## Or maybe not... sadly, incremental linkers are rarer than losing
## systems.
@rm -f %PROGRAM%%EXEEXT%
%VERBOSE%$(%XLINK%) $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_LDADD) $(LIBS)
07070100024f8d000081a400000000000000000000000153157aae00001381000001000001014cffffffffffffffff0000002f00000000root/usr/local/share/automake-1.13/am/ltlib.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
@$(NORMAL_INSTALL)
if %?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
## Note that we explicitly set the libtool mode. This avoids any lossage
## if the program doesn't have a name that libtool expects.
## Use INSTALL and not INSTALL_DATA because libtool knows the right
## permissions to use.
?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \
?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(%NDIR%dir)"; \
?!LIBTOOL? echo " $(INSTALL) $(INSTALL_STRIP_FLAG) $$list '$(DESTDIR)$(%NDIR%dir)'"; \
?!LIBTOOL? $(INSTALL) $(INSTALL_STRIP_FLAG) $$list "$(DESTDIR)$(%NDIR%dir)"; \
}
else !%?BASE%
@list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do if test -f "$$p"; then echo "$$p $$p"; else :; fi; done | \
sed '/ .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { cur = "." } \
{ if ($$2 == cur) { files = files " " $$1 } \
else { print cur, files; files = $$1; cur = $$2 } } \
END { print cur, files }' | \
while read dir files; do \
test -z "$$files" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
## Note that we explicitly set the libtool mode. This avoids any lossage
## if the program doesn't have a name that libtool expects.
## Use INSTALL and not INSTALL_DATA because libtool knows the right
## permissions to use.
?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$files '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$files "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
?!LIBTOOL? echo " $(INSTALL) $(INSTALL_STRIP_FLAG) $$files '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
?!LIBTOOL? $(INSTALL) $(INSTALL_STRIP_FLAG) $$files "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
}; \
done
endif !%?BASE%
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%LTLIBRARIES
uninstall-%DIR%LTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
for p in $$list; do \
?BASE? $(am__strip_dir) \
?!BASE? f=$$p; \
?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
?!LIBTOOL? echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
?!LIBTOOL? rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
done
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY clean-am: clean-%DIR%LTLIBRARIES
clean-%DIR%LTLIBRARIES:
-test -z "$(%DIR%_LTLIBRARIES)" || rm -f $(%DIR%_LTLIBRARIES)
## 'so_locations' files are created by some linkers (IRIX, OSF) when
## building a shared object. Libtool places these files in the
## directory where the shared object is created.
@list='$(%DIR%_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
07070100024f98000081a400000000000000000000000153157aaf00000966000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/texi-vers.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
DIST_COMMON += %VTEXI% %STAMPVTI%
## Don't give this rule a command (even '@:').
## %STAMPVTI% is always newer than %VTEXI%, so this rule is always
## triggered. If you equip this rule with a command, GNU make will
## assume %VTEXI% has been rebuild in the current directory and
## discard any %VTEXI% file found in a VPATH search.
%VTEXI%: %MAINTAINER-MODE% %STAMPVTI%
## Depend on configure so that version number updates cause a rebuild.
## (Not configure.ac, because not all setups define the version number
## in this file.)
%STAMPVTI%: %TEXI% $(top_srcdir)/configure
## It is wrong to have %STAMPVTI% dependent on %DIRSTAMP%, because
## %STAMPVTI% is distributed and %DIRSTAMP% isn't: a distributed file
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
?DIRSTAMP? test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
@(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > %VTI%.tmp
## Use cp and rm here because some older "mv"s can't move across
## filesystems. Furthermore, GNU "mv" in the AmigaDOS environment
## can't handle this.
@cmp -s %VTI%.tmp %VTEXI% \
|| (echo "Updating %VTEXI%"; \
cp %VTI%.tmp %VTEXI%)
-@rm -f %VTI%.tmp
@cp %VTEXI% $@
mostlyclean-am: mostlyclean-%VTI%
mostlyclean-%VTI%:
-rm -f %VTI%.tmp
maintainer-clean-am: maintainer-clean-%VTI%
maintainer-clean-%VTI%:
%MAINTAINER-MODE% -rm -f %STAMPVTI% %VTEXI%
.PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%
07070100024f81000081a400000000000000000000000153157aad00000371000001000001014cffffffffffffffff0000003000000000root/usr/local/share/automake-1.13/am/footer.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
# 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:
07070100024f99000081a400000000000000000000000153157aaf000019de000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/texibuild.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
## It is wrong to have 'info' files dependent on %DIRSTAMP%, because
## 'info' files are distributed and %DIRSTAMP% isn't: a distributed file
## should never be dependent upon a non-distributed built file.
## Therefore we ensure that %DIRSTAMP% exists in the rule.
?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
## Back up the info files before running makeinfo. This is the cheapest
## way to ensure that
## 1) If the texinfo file shrinks (or if you start using --no-split),
## you'll not be left with some dead info files lying around -- dead
## files which would end up in the distribution.
## 2) If the texinfo file has some minor mistakes which cause makeinfo
## to fail, the info files are not removed. (They are needed by the
## developer while he writes documentation.)
## *.iNN files are used on DJGPP. See the comments in install-info-am
%AM_V_MAKEINFO%restore=: && backupdir="$(am__leading_dot)am$$$$" && \
?INSRC? am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
## If makeinfo is not installed we must not backup the files so
## 'missing' can do its job and touch $@ if it exists.
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
?INSRC? cd "$$am__cwd"; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
?!INSRC? -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
?INSRC??!GENERIC_INFO? -o $@ $(srcdir)/%SOURCE_INFO%; \
?INSRC??GENERIC_INFO? -o $@ $<; \
then \
rc=0; \
?INSRC? $(am__cd) $(srcdir); \
else \
rc=$$?; \
## Beware that backup info files might come from a subdirectory.
?INSRC? $(am__cd) $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
?GENERIC?%SOURCE_SUFFIX%.dvi:
?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
%AM_V_TEXI2DVI%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
## Must set MAKEINFO like this so that version.texi will be found even
## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
## We still want -q (%TEXIQUIET%) because it turns on batch mode.
## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
## by-products are left in there, instead of cluttering the current
## directory (see automake bug#11146). Use a different build-dir for
## each file (and distinct from that of the corresponding PDF file) to
## avoid hitting a Texinfop bug that could cause low-probability racy
## failure when doing parallel builds; see:
## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
$(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
?GENERIC? %SOURCE%
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?GENERIC?%SOURCE_SUFFIX%.pdf:
?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
%AM_V_TEXI2PDF%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
## Must set MAKEINFO like this so that version.texi will be found even
## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
## We still want -q (%TEXIQUIET%) because it turns on batch mode.
## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
## by-products are left in there, instead of cluttering the current
## directory (see automake bug#11146). Use a different build-dir for
## each file (and distinct from that of the corresponding DVI file) to
## avoid hitting a Texinfop bug that could cause low-probability racy
## failure when doing parallel builds; see:
## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
$(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
?GENERIC? %SOURCE%
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?GENERIC?%SOURCE_SUFFIX%.html:
?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
## When --split (the default) is used, makeinfo will output a
## directory. However it will not update the time stamp of a
## previously existing directory, and when the names of the nodes
## in the manual change, it may leave unused pages. Our fix
## is to build under a temporary name, and replace the target on
## success.
%AM_V_MAKEINFO%rm -rf $(@:.html=.htp)
%SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
?GENERIC? -o $(@:.html=.htp) %SOURCE%; \
?!GENERIC? -o $(@:.html=.htp) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
then \
rm -rf $@; \
## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/
## instead of foo.html/).
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
else \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
## If we are using the generic rules, we need separate dependencies.
## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
## rules.)
if %?GENERIC_INFO%
%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
endif %?GENERIC_INFO%
if %?GENERIC%
%DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
%DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
endif %?GENERIC%
07070100024f7e000081a400000000000000000000000153157aac0000040f000001000001014cffffffffffffffff0000003000000000root/usr/local/share/automake-1.13/am/depend.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
am__mv = mv -f
## This Makefile depends on Depdirs' files, so we should never
## erase them in -am or -recursive rules; that would prevent any other
## rules from being recursive (for instance multilib clean rules are
## recursive).
distclean:
-rm -rf %DEPDIRS%
maintainer-clean:
-rm -rf %DEPDIRS%
07070100024f7c000081a400000000000000000000000153157aac00000d46000001000001014cffffffffffffffff0000002e00000000root/usr/local/share/automake-1.13/am/data.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
@$(NORMAL_INSTALL)
if %?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
## If the _%PRIMARY% variable has an entry like foo/bar, install it as
## $(destdir)/bar, not $(destdir)/foo/bar. The user can make a
## new dir variable or use a nobase_ target for the latter case.
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_%ONE_PRIMARY%) $$files '$(DESTDIR)$(%NDIR%dir)'"; \
$(INSTALL_%ONE_PRIMARY%) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \
done
else !%?BASE%
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for file in $$files; do \
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
done
endif !%?BASE%
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%%PRIMARY%
uninstall-%DIR%%PRIMARY%:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
## Nothing.
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%
07070100024f95000081a400000000000000000000000153157aaf00001269000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/scripts.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
if %?INSTALL%
include inst-vars.am
endif %?INSTALL%
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
## if doesn't work properly for Automake variables yet.
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
@$(NORMAL_INSTALL)
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
?!BASE? $(am__nobase_strip_setup); \
for p in $$list; do \
## A file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
## A script may or may not exist.
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
## We now have a list of "sourcefile newline (nobase-)target" pairs.
## Turn that into "sourcefile source_base target_dir xformed_target_base",
## with newlines being turned into spaces in a second step.
sed -e 'p;s,.*/,,;n' \
?BASE? -e 'h;s|.*|.|' \
?!BASE? -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \
-e 'p;x;s,.*/,,;$(transform)' | 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; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
?!BASE? case $$type in \
?!BASE? d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
?!BASE? $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
?!BASE? f) \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
} \
?!BASE? ;; esac \
; done
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%SCRIPTS
uninstall-%DIR%SCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || exit 0; \
?BASE? files=`for p in $$list; do echo "$$p"; done | \
?BASE? sed -e 's,.*/,,;$(transform)'`; \
?!BASE? $(am__nobase_strip_setup); \
?!BASE? files=`$(am__nobase_strip) \
?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \
dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
endif %?INSTALL%
## -------------- ##
## Distributing. ##
## -------------- ##
if %?DIST%
DIST_COMMON += %DISTVAR%
endif %?DIST%
## ---------- ##
## Checking. ##
## ---------- ##
if %?CK-OPTS%
.PHONY installcheck-am: installcheck-%DIR%SCRIPTS
installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
## Strip any leading directory before applying $(transform).
f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
## Insert the directory back if nobase_ is used.
?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
for opt in --help --version; do \
if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err &2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
endif %?CK-OPTS%
07070100024f96000081a400000000000000000000000153157aaf00000b34000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/subdirs.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
## All documented targets which invoke 'make' recursively, or depend
## on targets that do so. GNUmakefile from gnulib depends on this.
AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=)
.PHONY .MAKE: $(am__recursive_targets)
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
## Using $failcom allows "-k" to keep its natural meaning when running a
## recursive rule.
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
## For distclean and maintainer-clean we make sure to use the full
## list of subdirectories. We do this so that 'configure; make
## distclean' really is a no-op, even if SUBDIRS is conditional.
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean: mostlyclean-recursive
clean: clean-recursive
distclean: distclean-recursive
maintainer-clean: maintainer-clean-recursive
07070100024f83000081a400000000000000000000000153157aad00000312000001000001014cffffffffffffffff0000003000000000root/usr/local/share/automake-1.13/am/header.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## Exactly the same as data.am.
include data.am
07070100024f8f000081a400000000000000000000000153157aae00000359000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/mans-vars.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
NROFF = nroff
## We don't really need this, but we use it in case we ever want to
## support noinst_MANS.
MANS = %MANS%
07070100024f7b000081a400000000000000000000000153157aac000019d0000001000001014cffffffffffffffff0000003300000000root/usr/local/share/automake-1.13/am/configure.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 2001-2013 Free Software Foundation, Inc.
## 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, 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, see .
## This dummy rule is called from subdirectories whenever one of the
## top-level Makefile's dependencies must be updated. It does depend
## on %MAKEFILE% for the benefit of non-GNU make implementations (GNU
## make will always make sure %MAKEFILE% is updated before considering
## the am--refresh target anyway).
if %?TOPDIR_P%
.PHONY: am--refresh
am--refresh: %MAKEFILE%
@:
endif %?TOPDIR_P%
## --------------------- ##
## Building Makefile.*. ##
## --------------------- ##
## This rule remakes the Makefile.in.
%MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(am__configure_deps)
## If configure.ac or one of configure's dependencies has changed, all
## Makefile.in are to be updated; it is then more efficient to run
## automake on all the Makefiles at once. It also allow Automake to be
## run for newly added directories.
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
?TOPDIR_P? echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
?TOPDIR_P? && exit 0; \
?!TOPDIR_P? ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
## If on the other hand, subdir/Makefile.in has been removed, then toplevel
## am--refresh will not be aware of any need to run. We still invoke it
## due to $? listing all prerequisites. Fix up for it by running the rebuild
## rule for this file only, below.
?!TOPDIR_P? && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
## Otherwise, rebuild only this file.
echo ' cd $(top_srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%
## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
## is interrupted. Otherwise, the user would need to know to rerun
## ./config.status to recreate the lost Makefile.
.PRECIOUS: %MAKEFILE%
## This rule remakes the Makefile.
%MAKEFILE%: %MAKEFILE-DEPS% $(top_builddir)/config.status
## If Makefile is to be updated because of config.status, then run
## config.status without argument in order to (i) rerun all the
## AC_CONFIG_COMMANDS including those that are not visible to
## Automake, and (ii) to save time by running config.status all with
## all the files, instead of once per file (iii) generate Makefiles
## in newly added directories.
@case '$?' in \
## Don't prefix $(top_builddir), because GNU make will strip it out
## when it's '.'.
*config.status*) \
?TOPDIR_P? echo ' $(SHELL) ./config.status'; \
?TOPDIR_P? $(SHELL) ./config.status;; \
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
## .P files. Ideally we wouldn't have to do this by hand.
echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
esac;
## Avoid the "deleted header file" problem for the dependencies.
?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS%:
DIST_COMMON += %MAKEFILE-AM%
## --------------------------- ##
## config.status & configure. ##
## --------------------------- ##
if %?TOPDIR_P%
## Always require configure.ac and configure at top level, even if they
## don't exist. This is especially important for configure, since it
## won't be created until autoconf is run -- which might be after
## automake is run.
DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
endif %?TOPDIR_P%
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
?TOPDIR_P? $(SHELL) ./config.status --recheck
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF)
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
## ------------ ##
## aclocal.m4. ##
## ------------ ##
## Whenever a configure dependency changes we need to rebuild
## aclocal.m4 too. Changing configure.ac, or any file included by
## aclocal.m4 might require adding more files to aclocal.m4. Hence
## the $(am__configure_deps) dependency.
## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
## we should hopefully be able to get rid of it in a not-so-distant
## future.
if %?REGEN-ACLOCAL-M4%
$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
## Avoid the "deleted header file" problem for the dependencies.
$(am__aclocal_m4_deps):
endif %?REGEN-ACLOCAL-M4%
## --------- ##
## cleanup. ##
## --------- ##
## We special-case config.status here. If we do it as part of the
## normal clean processing for this directory, then it might be
## removed before some subdir is cleaned. However, that subdir's
## Makefile depends on config.status.
if %?TOPDIR_P%
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
distclean:
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
## Note: you might think we should remove Makefile.in, configure, or
## aclocal.m4 here in a maintainer-clean rule. However, the GNU
## Coding Standards explicitly prohibit this.
maintainer-clean:
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
## autom4te.cache is created by Autoconf; the only valid target to
## remove it is maintainer-clean, not distclean.
## If you have an autom4te.cache that cause distcheck to fail, then
## it is good news: you finally discovered that autoconf and/or
## autoheader is needed to use your tarball, which is wrong.
-rm -rf $(top_srcdir)/autom4te.cache
endif %?TOPDIR_P%
07070100024f7a000081a400000000000000000000000153157aac000003f2000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/am/compile.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
DEFAULT_INCLUDES = %DEFAULT_INCLUDES%
mostlyclean-am: mostlyclean-compile
mostlyclean-compile:
-rm -f *.$(OBJEXT)
?MOSTLYRMS?%MOSTLYRMS%
distclean-am: distclean-compile
distclean-compile:
-rm -f *.tab.c
?DISTRMS?%DISTRMS%
.PHONY: mostlyclean-compile distclean-compile
07070100024f92000081a400000000000000000000000153157aae000018f6000001000001014cffffffffffffffff0000002f00000000root/usr/local/share/automake-1.13/am/progs.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
## ------------ ##
## Installing. ##
## ------------ ##
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
@$(NORMAL_INSTALL)
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_PROGRAMS)'; test -n "$(%NDIR%dir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
## On Cygwin with libtool test won't see 'foo.exe' but instead 'foo'.
## So we check for both.
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
?LIBTOOL? || test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
## We now have a list of sourcefile pairs, separated by newline.
## Turn that into "sourcefile source_base target_dir xformed_target_base",
## with newlines being turned into spaces in a second step.
sed -e 'p;s,.*/,,;n;h' \
?BASE? -e 's|.*|.|' \
?!BASE? -e 's|[^/]*$$||; s|^$$|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
## The following awk script turns that into one line containing directories
## and then lines of 'type target_name_or_directory sources ...', with type
## 'd' designating directories, and 'f' files.
$(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 \
?!BASE? case $$type in \
?!BASE? d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
?!BASE? $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
?!BASE? f) \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
?!LIBTOOL? echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
?!LIBTOOL? $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
## Note that we explicitly set the libtool mode. This avoids any
## lossage if the install program doesn't have a name that libtool
## expects.
?LIBTOOL? echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
?LIBTOOL? $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
} \
?!BASE? ;; esac \
; done
endif %?INSTALL%
## -------------- ##
## Uninstalling. ##
## -------------- ##
if %?INSTALL%
.PHONY uninstall-am: uninstall-%DIR%PROGRAMS
uninstall-%DIR%PROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_PROGRAMS)'; test -n "$(%NDIR%dir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
## Remove any leading directory before applying $(transform),
## but keep the directory part in the hold buffer, in order to
## reapply it again afterwards in the nobase case. Append $(EXEEXT).
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
?!BASE? -e 'x;s,[^/]*$$,,;G;s,\n,,' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
endif %?INSTALL%
## ---------- ##
## Cleaning. ##
## ---------- ##
.PHONY clean-am: clean-%DIR%PROGRAMS
clean-%DIR%PROGRAMS:
?!LIBTOOL? -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS)
## Under Cygwin, we build 'program$(EXEEXT)'. However, if this
## program uses a Libtool library, Libtool will move it in
## '_libs/program$(EXEEXT)' and create a 'program' wrapper (without
## '$(EXEEXT)'). Therefore, if Libtool is used, we must try to erase
## both 'program$(EXEEXT)' and 'program'.
## Cleaning the '_libs/' or '.libs/' directory is done from clean-libtool.
## FIXME: In the future (i.e., when it works) it would be nice to delegate
## this task to "libtool --mode=clean".
?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; test -n "$$list" || exit 0; \
?LIBTOOL? echo " rm -f" $$list; \
?LIBTOOL? rm -f $$list || exit $$?; \
?LIBTOOL? test -n "$(EXEEXT)" || exit 0; \
?LIBTOOL? list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
?LIBTOOL? echo " rm -f" $$list; \
?LIBTOOL? rm -f $$list
## ---------- ##
## Checking. ##
## ---------- ##
if %?CK-OPTS%
.PHONY installcheck-am: installcheck-%DIR%PROGRAMS
installcheck-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
bad=0; pid=$$$$; list="$(%DIR%_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
## Strip the directory and $(EXEEXT) before applying $(transform).
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
## Insert the directory back if nobase_ is used.
?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
for opt in --help --version; do \
if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err &2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
endif %?CK-OPTS%
07070100024f94000081a400000000000000000000000153157aae00000cba000001000001014cffffffffffffffff0000003400000000root/usr/local/share/automake-1.13/am/remake-hdr.am ## automake - create Makefile.in from Makefile.am
## Copyright (C) 1994-2013 Free Software Foundation, Inc.
## 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, 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, see .
%CONFIG_H%: %STAMP%
## Recover from removal of CONFIG_HEADER.
@if test ! -f $@; then rm -f %STAMP%; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) %STAMP%; else :; fi
%STAMP%: %CONFIG_H_DEPS% $(top_builddir)/config.status
@rm -f %STAMP%
cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_H_PATH%
## Only the first file of AC_CONFIG_HEADERS is assumed to be generated
## by autoheader.
if %?FIRST-HDR%
%CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
## Cater to parallel BSD make.
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
## Whenever $(AUTOHEADER) has run, we must make sure that
## ./config.status will rebuild config.h. The dependency from %STAMP%
## on %CONFIG_H_DEPS% (which contains config.hin) is not enough to
## express this.
##
## There are some tricky cases where this rule will build a
## config.hin which has the same timestamp as %STAMP%, in which case
## ./config.status will not be rerun (meaning that users will use an
## out-of-date config.h without knowing it). One situation where this
## can occur is the following:
## 1. the user updates some configure dependency (let's say foo.m4)
## and runs 'make';
## 2. the rebuild rules detect that a foo.m4 has changed,
## run aclocal, autoconf, automake, and then run ./config.status.
## (Note that autoheader hasn't been called yet, so ./config.status
## outputs a config.h from an obsolete config.hin);
## 3. once Makefile has been regenerated, make continues, and
## discovers that config.h is a dependency of the 'all' rule.
## Because config.h depends on stamp-h1, stamp-h1 depends on
## config.hin, and config.hin depends on aclocal.m4, make runs
## autoheader to rebuild config.hin.
## Now make ought to call ./config.status once again to rebuild
## config.h from the new config.hin, but if you have a sufficiently
## fast box, steps 2 and 3 will occur within the same second: the
## config.h/stamp-h1 generated from the outdated config.hin will have
## the same mtime as the new config.hin. Hence make will think that
## config.h is up to date.
##
## A solution is to erase %STAMP% here so that the %STAMP% rule
## is always triggered after the this one.
rm -f %STAMP%
## Autoheader has the bad habit of not changing the timestamp if
## config.hin is unchanged, which breaks Make targets. Since what
## must not changed gratuitously is config.h, which is already handled
## by config.status, there is no reason to make things complex for
## config.hin.
touch $@
endif %?FIRST-HDR%
07070100024fa3000081ed00000000000000000000000153157ab50000179f000001000001014cffffffffffffffff0000002c00000000root/usr/local/share/automake-1.13/mdate-sh #!/bin/sh
# Get modification time of a file or directory and pretty-print it.
scriptversion=2010-08-21.06; # UTC
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
# written by Ulrich Drepper , June 1995
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
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
fi
case $1 in
'')
echo "$0: No file. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: mdate-sh [--help] [--version] FILE
Pretty-print the modification day of FILE, in the format:
1 January 1970
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
exit $?
;;
esac
error ()
{
echo "$0: $1" >&2
exit 1
}
# Prevent date giving response in another language.
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LC_TIME=C
export LC_TIME
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
export TIME_STYLE
fi
save_arg1=$1
# Find out how to get the extended ls output of a file or directory.
if ls -L /dev/null 1>/dev/null 2>&1; then
ls_command='ls -L -l -d'
else
ls_command='ls -l -d'
fi
# Avoid user/group names that might have spaces, when possible.
if ls -n /dev/null 1>/dev/null 2>&1; then
ls_command="$ls_command -n"
fi
# A 'ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo
# This differs from Unix, which adds ownership information.
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
#
# To find the date, we split the line on spaces and iterate on words
# until we find a month. This cannot work with files whose owner is a
# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
# will be owned by a user whose name is a month. So we first look at
# the extended ls output of the root directory to decide how many
# words should be skipped to get the date.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
set x`$ls_command /`
# Find which argument is the month.
month=
command=
until test $month
do
test $# -gt 0 || error "failed parsing '$ls_command /' output"
shift
# Add another shift to the command.
command="$command shift;"
case $1 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
done
test -n "$month" || error "failed parsing '$ls_command /' output"
# Get the extended ls output of the file or directory.
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
# Remove all preceding arguments
eval $command
# Because of the dummy argument above, month is in $2.
#
# On a POSIX system, we should have
#
# $# = 5
# $1 = file size
# $2 = month
# $3 = day
# $4 = year or time
# $5 = filename
#
# On Darwin 7.7.0 and 7.6.0, we have
#
# $# = 4
# $1 = day
# $2 = month
# $3 = year or time
# $4 = filename
# Get the month.
case $2 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
case $3 in
???*) day=$1;;
*) day=$3; shift;;
esac
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.
case $3 in
*:*) set `date`; eval year=\$$#
case $2 in
Jan) nummonthtod=1;;
Feb) nummonthtod=2;;
Mar) nummonthtod=3;;
Apr) nummonthtod=4;;
May) nummonthtod=5;;
Jun) nummonthtod=6;;
Jul) nummonthtod=7;;
Aug) nummonthtod=8;;
Sep) nummonthtod=9;;
Oct) nummonthtod=10;;
Nov) nummonthtod=11;;
Dec) nummonthtod=12;;
esac
# For the first six month of the year the time notation can also
# be used for files modified in the last year.
if (expr $nummonth \> $nummonthtod) > /dev/null;
then
year=`expr $year - 1`
fi;;
*) year=$3;;
esac
# The result.
echo $day $month $year
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024fa7000081ed00000000000000000000000153157ab600003bb5000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/tap-driver.pl #! /usr/bin/env perl
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# ---------------------------------- #
# Imports, static data, and setup. #
# ---------------------------------- #
use warnings FATAL => 'all';
use strict;
use Getopt::Long ();
use TAP::Parser;
my $VERSION = '2012-02-01.19'; # UTC
my $ME = "tap-driver.pl";
my $USAGE = <<'END';
Usage:
tap-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--ignore-exit]
[--diagnostic-string=STRING] [--merge|--no-merge]
[--comments|--no-comments] [--] TEST-COMMAND
The `--test-name', `--log-file' and `--trs-file' options are mandatory.
END
my $HELP = "$ME: TAP-aware test driver for Automake testsuite harness." .
"\n" . $USAGE;
# Keep this in sync with `lib/am/check.am:$(am__tty_colors)'.
my %COLOR = (
red => "\e[0;31m",
grn => "\e[0;32m",
lgn => "\e[1;32m",
blu => "\e[1;34m",
mgn => "\e[0;35m",
brg => "\e[1m",
std => "\e[m",
);
# It's important that NO_PLAN evaluates "false" as a boolean.
use constant NO_PLAN => 0;
use constant EARLY_PLAN => 1;
use constant LATE_PLAN => 2;
# ------------------- #
# Global variables. #
# ------------------- #
my $testno = 0; # Number of test results seen so far.
my $bailed_out = 0; # Whether a "Bail out!" directive has been seen.
my $parser; # TAP parser object (will be initialized later).
# Whether the TAP plan has been seen or not, and if yes, which kind
# it is ("early" is seen before any test result, "late" otherwise).
my $plan_seen = NO_PLAN;
# ----------------- #
# Option parsing. #
# ----------------- #
my %cfg = (
"color-tests" => 0,
"expect-failure" => 0,
"merge" => 0,
"comments" => 0,
"ignore-exit" => 0,
);
my $test_script_name = undef;
my $log_file = undef;
my $trs_file = undef;
my $diag_string = "#";
Getopt::Long::GetOptions
(
'help' => sub { print $HELP; exit 0; },
'version' => sub { print "$ME $VERSION\n"; exit 0; },
'test-name=s' => \$test_script_name,
'log-file=s' => \$log_file,
'trs-file=s' => \$trs_file,
'color-tests=s' => \&bool_opt,
'expect-failure=s' => \&bool_opt,
'enable-hard-errors=s' => sub {}, # No-op.
'diagnostic-string=s' => \$diag_string,
'comments' => sub { $cfg{"comments"} = 1; },
'no-comments' => sub { $cfg{"comments"} = 0; },
'merge' => sub { $cfg{"merge"} = 1; },
'no-merge' => sub { $cfg{"merge"} = 0; },
'ignore-exit' => sub { $cfg{"ignore-exit"} = 1; },
) or exit 1;
# ------------- #
# Prototypes. #
# ------------- #
sub add_test_result ($);
sub bool_opt ($$);
sub colored ($$);
sub copy_in_global_log ();
sub decorate_result ($);
sub extract_tap_comment ($);
sub finish ();
sub get_global_test_result ();
sub get_test_exit_message ();
sub get_test_results ();
sub handle_tap_bailout ($);
sub handle_tap_plan ($);
sub handle_tap_result ($);
sub is_null_string ($);
sub main (@);
sub must_recheck ();
sub report ($;$);
sub setup_io ();
sub setup_parser (@);
sub stringify_result_obj ($);
sub testsuite_error ($);
sub trap_perl_warnings_and_errors ();
sub write_test_results ();
sub yn ($);
# -------------- #
# Subroutines. #
# -------------- #
sub bool_opt ($$)
{
my ($opt, $val) = @_;
if ($val =~ /^(?:y|yes)\z/i)
{
$cfg{$opt} = 1;
}
elsif ($val =~ /^(?:n|no)\z/i)
{
$cfg{$opt} = 0;
}
else
{
die "$ME: invalid argument '$val' for option '$opt'\n";
}
}
# If the given string is undefined or empty, return true, otherwise
# return false. This function is useful to avoid pitfalls like:
# if ($message) { print "$message\n"; }
# which wouldn't print anything if $message is the literal "0".
sub is_null_string ($)
{
my $str = shift;
return ! (defined $str and length $str);
}
# Convert a boolean to a "yes"/"no" string.
sub yn ($)
{
my $bool = shift;
return $bool ? "yes" : "no";
}
TEST_RESULTS :
{
my (@test_results_list, %test_results_seen);
sub add_test_result ($)
{
my $res = shift;
push @test_results_list, $res;
$test_results_seen{$res} = 1;
}
sub get_test_results ()
{
return @test_results_list;
}
# Whether the test script should be re-run by "make recheck".
sub must_recheck ()
{
return grep { !/^(?:XFAIL|PASS|SKIP)$/ } (keys %test_results_seen);
}
# Whether the content of the log file associated to this test should
# be copied into the "global" test-suite.log.
sub copy_in_global_log ()
{
return grep { not $_ eq "PASS" } (keys %test_results_seen);
}
# FIXME: this can certainly be improved ...
sub get_global_test_result ()
{
return "ERROR"
if $test_results_seen{"ERROR"};
return "FAIL"
if $test_results_seen{"FAIL"} || $test_results_seen{"XPASS"};
return "SKIP"
if scalar keys %test_results_seen == 1 && $test_results_seen{"SKIP"};
return "PASS";
}
}
sub write_test_results ()
{
open RES, ">", $trs_file or die "$ME: opening $trs_file: $!\n";
print RES ":global-test-result: " . get_global_test_result . "\n";
print RES ":recheck: " . yn (must_recheck) . "\n";
print RES ":copy-in-global-log: " . yn (copy_in_global_log) . "\n";
foreach my $result (get_test_results)
{
print RES ":test-result: $result\n";
}
close RES or die "$ME: closing $trs_file: $!\n";
}
sub trap_perl_warnings_and_errors ()
{
$SIG{__WARN__} = $SIG{__DIE__} = sub
{
# Be sure to send the warning/error message to the original stderr
# (presumably the console), not into the log file.
open STDERR, ">&OLDERR";
die @_;
}
}
sub setup_io ()
{
# Redirect stderr and stdout to a temporary log file. Save the
# original stdout stream, since we need it to print testsuite
# progress output. Save original stderr stream, so that we can
# redirect warning and error messages from perl there.
open LOG, ">", $log_file or die "$ME: opening $log_file: $!\n";
open OLDOUT, ">&STDOUT" or die "$ME: duplicating stdout: $!\n";
open OLDERR, ">&STDERR" or die "$ME: duplicating stdout: $!\n";
*OLDERR = *OLDERR; # To pacify a "used only once" warning.
trap_perl_warnings_and_errors;
open STDOUT, ">&LOG" or die "$ME: redirecting stdout: $!\n";
open STDERR, ">&LOG" or die "$ME: redirecting stderr: $!\n";
}
sub setup_parser (@)
{
local $@ = '';
eval { $parser = TAP::Parser->new ({exec => \@_, merge => $cfg{merge}}) };
if ($@ ne '')
{
# Don't use the error message in $@ as set by TAP::Parser, since
# currently it's both too generic (at the point of being basically
# useless) and quite long.
report "ERROR", "- couldn't execute test script";
finish;
}
}
sub get_test_exit_message ()
{
my $wstatus = $parser->wait;
# Watch out for possible internal errors.
die "$ME: couldn't get the exit status of the TAP producer"
unless defined $wstatus;
# Return an undefined value if the producer exited with success.
return unless $wstatus;
# Otherwise, determine whether it exited with error or was terminated
# by a signal.
use POSIX qw (WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
if (WIFEXITED ($wstatus))
{
return sprintf "exited with status %d", WEXITSTATUS ($wstatus);
}
elsif (WIFSIGNALED ($wstatus))
{
return sprintf "terminated by signal %d", WTERMSIG ($wstatus);
}
else
{
return "terminated abnormally";
}
}
sub stringify_result_obj ($)
{
my $result_obj = shift;
my $COOKED_PASS = $cfg{"expect-failure"} ? "XPASS": "PASS";
my $COOKED_FAIL = $cfg{"expect-failure"} ? "XFAIL": "FAIL";
if ($result_obj->is_unplanned || $result_obj->number != $testno)
{
return "ERROR";
}
elsif ($plan_seen == LATE_PLAN)
{
return "ERROR";
}
elsif (!$result_obj->directive)
{
return $result_obj->is_ok ? $COOKED_PASS: $COOKED_FAIL;
}
elsif ($result_obj->has_todo)
{
return $result_obj->is_actual_ok ? "XPASS" : "XFAIL";
}
elsif ($result_obj->has_skip)
{
return $result_obj->is_ok ? "SKIP" : $COOKED_FAIL;
}
die "$ME: INTERNAL ERROR"; # NOTREACHED
}
sub colored ($$)
{
my ($color_name, $text) = @_;
return $COLOR{$color_name} . $text . $COLOR{'std'};
}
sub decorate_result ($)
{
my $result = shift;
return $result unless $cfg{"color-tests"};
my %color_for_result =
(
"ERROR" => 'mgn',
"PASS" => 'grn',
"XPASS" => 'red',
"FAIL" => 'red',
"XFAIL" => 'lgn',
"SKIP" => 'blu',
);
if (my $color = $color_for_result{$result})
{
return colored ($color, $result);
}
else
{
return $result; # Don't colorize unknown stuff.
}
}
sub report ($;$)
{
my ($msg, $result, $explanation) = (undef, @_);
if ($result =~ /^(?:X?(?:PASS|FAIL)|SKIP|ERROR)/)
{
$msg = ": $test_script_name";
add_test_result $result;
}
elsif ($result eq "#")
{
$msg = " $test_script_name:";
}
else
{
die "$ME: INTERNAL ERROR"; # NOTREACHED
}
$msg .= " $explanation" if defined $explanation;
$msg .= "\n";
# Output on console might be colorized.
print OLDOUT decorate_result ($result) . $msg;
# Log the result in the log file too, to help debugging (this is
# especially true when said result is a TAP error or "Bail out!").
print $result . $msg;
}
sub testsuite_error ($)
{
report "ERROR", "- $_[0]";
}
sub handle_tap_result ($)
{
$testno++;
my $result_obj = shift;
my $test_result = stringify_result_obj $result_obj;
my $string = $result_obj->number;
my $description = $result_obj->description;
$string .= " $description"
unless is_null_string $description;
if ($plan_seen == LATE_PLAN)
{
$string .= " # AFTER LATE PLAN";
}
elsif ($result_obj->is_unplanned)
{
$string .= " # UNPLANNED";
}
elsif ($result_obj->number != $testno)
{
$string .= " # OUT-OF-ORDER (expecting $testno)";
}
elsif (my $directive = $result_obj->directive)
{
$string .= " # $directive";
my $explanation = $result_obj->explanation;
$string .= " $explanation"
unless is_null_string $explanation;
}
report $test_result, $string;
}
sub handle_tap_plan ($)
{
my $plan = shift;
if ($plan_seen)
{
# Error, only one plan per stream is acceptable.
testsuite_error "multiple test plans";
return;
}
# The TAP plan can come before or after *all* the TAP results; we speak
# respectively of an "early" or a "late" plan. If we see the plan line
# after at least one TAP result has been seen, assume we have a late
# plan; in this case, any further test result seen after the plan will
# be flagged as an error.
$plan_seen = ($testno >= 1 ? LATE_PLAN : EARLY_PLAN);
# If $testno > 0, we have an error ("too many tests run") that will be
# automatically dealt with later, so don't worry about it here. If
# $plan_seen is true, we have an error due to a repeated plan, and that
# has already been dealt with above. Otherwise, we have a valid "plan
# with SKIP" specification, and should report it as a particular kind
# of SKIP result.
if ($plan->directive && $testno == 0)
{
my $explanation = is_null_string ($plan->explanation) ?
undef : "- " . $plan->explanation;
report "SKIP", $explanation;
}
}
sub handle_tap_bailout ($)
{
my ($bailout, $msg) = ($_[0], "Bail out!");
$bailed_out = 1;
$msg .= " " . $bailout->explanation
unless is_null_string $bailout->explanation;
testsuite_error $msg;
}
sub extract_tap_comment ($)
{
my $line = shift;
if (index ($line, $diag_string) == 0)
{
# Strip leading `$diag_string' from `$line'.
$line = substr ($line, length ($diag_string));
# And strip any leading and trailing whitespace left.
$line =~ s/(?:^\s*|\s*$)//g;
# Return what is left (if any).
return $line;
}
return "";
}
sub finish ()
{
write_test_results;
close LOG or die "$ME: closing $log_file: $!\n";
exit 0;
}
sub main (@)
{
setup_io;
setup_parser @_;
while (defined (my $cur = $parser->next))
{
# Verbatim copy any input line into the log file.
print $cur->raw . "\n";
# Parsing of TAP input should stop after a "Bail out!" directive.
next if $bailed_out;
if ($cur->is_plan)
{
handle_tap_plan ($cur);
}
elsif ($cur->is_test)
{
handle_tap_result ($cur);
}
elsif ($cur->is_bailout)
{
handle_tap_bailout ($cur);
}
elsif ($cfg{comments})
{
my $comment = extract_tap_comment ($cur->raw);
report "#", "$comment" if length $comment;
}
}
# A "Bail out!" directive should cause us to ignore any following TAP
# error, as well as a non-zero exit status from the TAP producer.
if (!$bailed_out)
{
if (!$plan_seen)
{
testsuite_error "missing test plan";
}
elsif ($parser->tests_planned != $parser->tests_run)
{
my ($planned, $run) = ($parser->tests_planned, $parser->tests_run);
my $bad_amount = $run > $planned ? "many" : "few";
testsuite_error (sprintf "too %s tests run (expected %d, got %d)",
$bad_amount, $planned, $run);
}
if (!$cfg{"ignore-exit"})
{
my $msg = get_test_exit_message ();
testsuite_error $msg if $msg;
}
}
finish;
}
# ----------- #
# Main code. #
# ----------- #
main @ARGV;
# Local Variables:
# perl-indent-level: 2
# perl-continued-statement-offset: 2
# perl-continued-brace-offset: 0
# perl-brace-offset: 0
# perl-brace-imaginary-offset: 0
# perl-label-offset: -2
# cperl-indent-level: 2
# cperl-brace-offset: 0
# cperl-continued-brace-offset: 0
# cperl-label-offset: -2
# cperl-extra-newline-before-brace: t
# cperl-merge-trailing-else: nil
# cperl-continued-statement-offset: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "my $VERSION = "
# time-stamp-format: "'%:y-%02m-%02d.%02H'"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024fa5000081ed00000000000000000000000153157ab500000dd2000001000001014cffffffffffffffff0000003100000000root/usr/local/share/automake-1.13/mkinstalldirs #! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2009-04-28.21; # UTC
# Original author: Noah Friedman
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to ."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024f9e000081ed00000000000000000000000153157ab600001ca5000001000001014cffffffffffffffff0000002b00000000root/usr/local/share/automake-1.13/compile #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
07070100024f9d000081ed00000000000000000000000153157ab6000016c2000001000001014cffffffffffffffff0000002a00000000root/usr/local/share/automake-1.13/ar-lib #! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2013 Free Software Foundation, Inc.
# Written by Peter Rosin .
#
# 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, 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, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <