From b8ed88f8b7b5f8e07527a9dcbeebe41fd3e841b7 Mon Sep 17 00:00:00 2001 From: "Graydon, Tracy" Date: Fri, 31 Aug 2012 11:12:59 -0700 Subject: [PATCH 1/1] TIVI-153: Adding automake14 as dep for iputils package --- AUTHORS | 7 + COPYING | 340 ++ ChangeLog | 6265 ++++++++++++++++++++++++ INSTALL | 182 + Makefile.am | 158 + Makefile.in | 663 +++ NEWS | 219 + README | 31 + THANKS | 88 + TODO | 636 +++ acinstall | 35 + aclocal.in | 455 ++ aclocal.m4 | 134 + ansi2knr.1 | 36 + ansi2knr.c | 609 +++ automake.in | 7332 ++++++++++++++++++++++++++++ automake.info | 111 + automake.info-1 | 1268 +++++ automake.info-2 | 1262 +++++ automake.info-3 | 690 +++ automake.texi | 3477 +++++++++++++ clean-hdr.am | 25 + clean-kr.am | 25 + clean.am | 34 + comp-vars.am | 22 + compile.am | 43 + config.guess | 1354 +++++ config.sub | 1460 ++++++ configure | 1166 +++++ configure.in | 49 + data-clean.am | 18 + data.am | 37 + dejagnu.am | 44 + depend.am | 37 + depend2.am | 59 + dist-vars.am | 22 + elisp-comp | 49 + footer.am | 20 + header-vars.am | 70 + header.am | 34 + install-sh | 251 + java-clean.am | 25 + java.am | 33 + kr-extra.am | 31 + library.am | 21 + libs-clean.am | 25 + libs.am | 47 + libtool.am | 39 + lisp-clean.am | 25 + lisp.am | 43 + ltlib-clean.am | 25 + ltlib.am | 38 + ltlibrary.am | 19 + m4/Makefile.am | 13 + m4/Makefile.in | 202 + m4/amversion.in | 28 + m4/ccstdc.m4 | 91 + m4/cond.m4 | 12 + m4/dmalloc.m4 | 22 + m4/error.m4 | 13 + m4/header.m4 | 22 + m4/init.m4 | 33 + m4/lex.m4 | 10 + m4/lispdir.m4 | 37 + m4/maintainer.m4 | 19 + m4/missing.m4 | 18 + m4/mktime.m4 | 167 + m4/multi.m4 | 41 + m4/obstack.m4 | 15 + m4/protos.m4 | 25 + m4/ptrdiff.m4 | 12 + m4/regex.m4 | 37 + m4/sanity.m4 | 42 + m4/strtod.m4 | 69 + m4/termios.m4 | 14 + m4/winsz.m4 | 36 + mans-vars.am | 18 + mans.am | 61 + mdate-sh | 92 + missing | 198 + mkinstalldirs | 40 + multilib.am | 45 + packaging/automake-1.4-backslash.patch | 102 + packaging/automake-1.4-libtoolize.patch | 15 + packaging/automake-1.4-subdir.patch | 22 + packaging/automake-1.4-subdirs-89656.patch | 20 + packaging/automake-1.4-tags.patch | 14 + packaging/automake14-info.patch | 103 + packaging/automake14.changes | 3 + packaging/automake14.spec | 80 + program.am | 25 + progs-clean.am | 25 + progs.am | 37 + remake-hdr.am | 43 + remake.am | 24 + scripts.am | 52 + stamp-vti | 3 + subdirs.am | 78 + tags-clean.am | 31 + tags.am | 45 + tests/ChangeLog | 858 ++++ tests/Makefile.am | 45 + tests/Makefile.in | 201 + tests/acinclude.test | 12 + tests/aclocal.test | 11 + tests/aclocali.test | 25 + tests/aclocalii.test | 17 + tests/acoutnoq.test | 21 + tests/acoutput.test | 18 + tests/acoutqnl.test | 19 + tests/acouttbs.test | 20 + tests/acsilent.test | 19 + tests/all.test | 15 + tests/alpha.test | 28 + tests/ammissing.test | 10 + tests/ansi.test | 23 + tests/ansi2.test | 22 + tests/ansi3.test | 44 + tests/auxdir.test | 22 + tests/backsl.test | 19 + tests/badline.test | 16 + tests/badprog.test | 17 + tests/block.test | 19 + tests/canon.test | 15 + tests/canon2.test | 19 + tests/canon3.test | 20 + tests/canon4.test | 20 + tests/checkall.test | 16 + tests/clean.test | 11 + tests/colneq.test | 12 + tests/colneq2.test | 16 + tests/colon.test | 20 + tests/colon2.test | 22 + tests/colon3.test | 41 + tests/colon4.test | 26 + tests/colon5.test | 20 + tests/colon6.test | 20 + tests/colon7.test | 25 + tests/comment.test | 12 + tests/comment2.test | 19 + tests/compile_f_c_cxx.test | 35 + tests/cond.test | 24 + tests/cond2.test | 25 + tests/cond3.test | 43 + tests/cond4.test | 31 + tests/cond5.test | 39 + tests/cond6.test | 26 + tests/cond7.test | 26 + tests/condman.test | 21 + tests/condman2.test | 15 + tests/conf2.test | 22 + tests/confdist.test | 12 + tests/confh.test | 32 + tests/confh2.test | 28 + tests/confh3.test | 30 + tests/config.test | 25 + tests/confincl.test | 22 + tests/confsub.test | 33 + tests/confvar.test | 15 + tests/confvar2.test | 15 + tests/cxxcpp.test | 16 + tests/cxxlibobj.test | 25 + tests/cxxlink.test | 24 + tests/cxxnoc.test | 22 + tests/cxxo.test | 19 + tests/cygwin32.test | 24 + tests/defs | 62 + tests/defun.test | 13 + tests/defun2.test | 23 + tests/dejagnu.test | 16 + tests/depacl.test | 13 + tests/depacl2.test | 17 + tests/depend.test | 23 + tests/depend2.test | 71 + tests/depend3.test | 36 + tests/discover.test | 27 + tests/distdir.test | 15 + tests/dup2.test | 16 + tests/else.test | 22 + tests/empty.test | 33 + tests/error.test | 20 + tests/exdir.test | 15 + tests/exdir2.test | 13 + tests/exsource.test | 37 + tests/extra.test | 25 + tests/extra3.test | 13 + tests/extra4.test | 15 + tests/flibs.test | 37 + tests/fnoc.test | 24 + tests/fo.test | 21 + tests/fonly.test | 35 + tests/fpinst2.test | 21 + tests/fpinstall.test | 21 + tests/gnits.test | 29 + tests/implicit.test | 18 + tests/include.test | 17 + tests/info.test | 28 + tests/insh.test | 14 + tests/insh2.test | 15 + tests/install.test | 19 + tests/installsh.test | 38 + tests/instdata.test | 15 + tests/instexec.test | 12 + tests/insthook.test | 16 + tests/instman.test | 17 + tests/interp.test | 19 + tests/interp2.test | 20 + tests/java.test | 13 + tests/javaprim.test | 14 + tests/javasubst.test | 16 + tests/ldadd.test | 33 + tests/lex.test | 22 + tests/lex2.test | 22 + tests/libobj.test | 29 + tests/libobj2.test | 31 + tests/libobj3.test | 18 + tests/libobj4.test | 17 + tests/libobj5.test | 22 + tests/libobj6.test | 28 + tests/libobj7.test | 37 + tests/libobj8.test | 36 + tests/library.test | 20 + tests/link_c_cxx.test | 34 + tests/link_f_c.test | 35 + tests/link_f_c_cxx.test | 36 + tests/link_f_cxx.test | 34 + tests/link_f_only.test | 32 + tests/lisp.test | 21 + tests/mdate.test | 19 + tests/mdate2.test | 23 + tests/mdate3.test | 32 + tests/mkinst2.test | 23 + tests/mkinstall.test | 16 + tests/noinst.test | 15 + tests/number.test | 19 + tests/objc.test | 22 + tests/obsolete.test | 19 + tests/order.test | 18 + tests/outdir.test | 17 + tests/output.test | 20 + tests/output2.test | 25 + tests/output3.test | 23 + tests/output4.test | 22 + tests/output5.test | 19 + tests/package.test | 18 + tests/parse.test | 27 + tests/pluseq.test | 16 + tests/pluseq2.test | 29 + tests/pluseq3.test | 30 + tests/pluseq4.test | 17 + tests/pluseq5.test | 17 + tests/prefix.test | 16 + tests/primary.test | 12 + tests/primary2.test | 15 + tests/proginst.test | 12 + tests/ranlib.test | 20 + tests/recurs.test | 21 + tests/recurs2.test | 23 + tests/remake.test | 20 + tests/remake2.test | 20 + tests/req.test | 20 + tests/rulepat.test | 13 + tests/scripts.test | 20 + tests/seenc.test | 21 + tests/sinclude.test | 20 + tests/spell.test | 14 + tests/spell2.test | 16 + tests/spell3.test | 14 + tests/spelling.test | 14 + tests/stamph.test | 18 + tests/stdlib.test | 20 + tests/subdir.test | 27 + tests/subdir2.test | 39 + tests/subst.test | 17 + tests/symlink.test | 18 + tests/syntax.test | 14 + tests/tags.test | 16 + tests/tagsub.test | 31 + tests/target.test | 19 + tests/texinfo.test | 19 + tests/texinfo2.test | 20 + tests/texinfo3.test | 16 + tests/texinfo4.test | 15 + tests/texinfo5.test | 18 + tests/texinfo6.test | 15 + tests/texinfo7.test | 18 + tests/unused.test | 19 + tests/version.test | 24 + tests/version2.test | 24 + tests/version3.test | 12 + tests/version4.test | 11 + tests/vpath.test | 15 + tests/vtexi.test | 27 + tests/vtexi2.test | 25 + tests/whoami.test | 12 + tests/xsource.test | 22 + tests/yacc.test | 20 + tests/yaccpp.test | 19 + texi-vers.am | 45 + texinfo.tex | 6341 ++++++++++++++++++++++++ texinfos.am | 206 + version.texi | 3 + ylwrap | 123 + 303 files changed, 43422 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 THANKS create mode 100644 TODO create mode 100755 acinstall create mode 100644 aclocal.in create mode 100644 aclocal.m4 create mode 100644 ansi2knr.1 create mode 100644 ansi2knr.c create mode 100755 automake.in create mode 100644 automake.info create mode 100644 automake.info-1 create mode 100644 automake.info-2 create mode 100644 automake.info-3 create mode 100644 automake.texi create mode 100644 clean-hdr.am create mode 100644 clean-kr.am create mode 100644 clean.am create mode 100644 comp-vars.am create mode 100644 compile.am create mode 100755 config.guess create mode 100644 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100644 data-clean.am create mode 100644 data.am create mode 100644 dejagnu.am create mode 100644 depend.am create mode 100644 depend2.am create mode 100644 dist-vars.am create mode 100755 elisp-comp create mode 100644 footer.am create mode 100644 header-vars.am create mode 100644 header.am create mode 100755 install-sh create mode 100644 java-clean.am create mode 100644 java.am create mode 100644 kr-extra.am create mode 100644 library.am create mode 100644 libs-clean.am create mode 100644 libs.am create mode 100644 libtool.am create mode 100644 lisp-clean.am create mode 100644 lisp.am create mode 100644 ltlib-clean.am create mode 100644 ltlib.am create mode 100644 ltlibrary.am create mode 100644 m4/Makefile.am create mode 100644 m4/Makefile.in create mode 100644 m4/amversion.in create mode 100644 m4/ccstdc.m4 create mode 100644 m4/cond.m4 create mode 100644 m4/dmalloc.m4 create mode 100644 m4/error.m4 create mode 100644 m4/header.m4 create mode 100644 m4/init.m4 create mode 100644 m4/lex.m4 create mode 100644 m4/lispdir.m4 create mode 100644 m4/maintainer.m4 create mode 100644 m4/missing.m4 create mode 100644 m4/mktime.m4 create mode 100644 m4/multi.m4 create mode 100644 m4/obstack.m4 create mode 100644 m4/protos.m4 create mode 100644 m4/ptrdiff.m4 create mode 100644 m4/regex.m4 create mode 100644 m4/sanity.m4 create mode 100644 m4/strtod.m4 create mode 100644 m4/termios.m4 create mode 100644 m4/winsz.m4 create mode 100644 mans-vars.am create mode 100644 mans.am create mode 100755 mdate-sh create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 multilib.am create mode 100644 packaging/automake-1.4-backslash.patch create mode 100644 packaging/automake-1.4-libtoolize.patch create mode 100644 packaging/automake-1.4-subdir.patch create mode 100644 packaging/automake-1.4-subdirs-89656.patch create mode 100644 packaging/automake-1.4-tags.patch create mode 100644 packaging/automake14-info.patch create mode 100644 packaging/automake14.changes create mode 100644 packaging/automake14.spec create mode 100644 program.am create mode 100644 progs-clean.am create mode 100644 progs.am create mode 100644 remake-hdr.am create mode 100644 remake.am create mode 100644 scripts.am create mode 100644 stamp-vti create mode 100644 subdirs.am create mode 100644 tags-clean.am create mode 100644 tags.am create mode 100644 tests/ChangeLog create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100755 tests/acinclude.test create mode 100755 tests/aclocal.test create mode 100755 tests/aclocali.test create mode 100755 tests/aclocalii.test create mode 100755 tests/acoutnoq.test create mode 100755 tests/acoutput.test create mode 100755 tests/acoutqnl.test create mode 100755 tests/acouttbs.test create mode 100755 tests/acsilent.test create mode 100755 tests/all.test create mode 100755 tests/alpha.test create mode 100755 tests/ammissing.test create mode 100755 tests/ansi.test create mode 100755 tests/ansi2.test create mode 100755 tests/ansi3.test create mode 100755 tests/auxdir.test create mode 100755 tests/backsl.test create mode 100755 tests/badline.test create mode 100755 tests/badprog.test create mode 100755 tests/block.test create mode 100755 tests/canon.test create mode 100755 tests/canon2.test create mode 100755 tests/canon3.test create mode 100755 tests/canon4.test create mode 100755 tests/checkall.test create mode 100755 tests/clean.test create mode 100755 tests/colneq.test create mode 100755 tests/colneq2.test create mode 100755 tests/colon.test create mode 100755 tests/colon2.test create mode 100755 tests/colon3.test create mode 100755 tests/colon4.test create mode 100755 tests/colon5.test create mode 100755 tests/colon6.test create mode 100755 tests/colon7.test create mode 100755 tests/comment.test create mode 100755 tests/comment2.test create mode 100755 tests/compile_f_c_cxx.test create mode 100755 tests/cond.test create mode 100755 tests/cond2.test create mode 100755 tests/cond3.test create mode 100755 tests/cond4.test create mode 100755 tests/cond5.test create mode 100755 tests/cond6.test create mode 100755 tests/cond7.test create mode 100755 tests/condman.test create mode 100755 tests/condman2.test create mode 100755 tests/conf2.test create mode 100755 tests/confdist.test create mode 100755 tests/confh.test create mode 100755 tests/confh2.test create mode 100755 tests/confh3.test create mode 100755 tests/config.test create mode 100755 tests/confincl.test create mode 100755 tests/confsub.test create mode 100755 tests/confvar.test create mode 100755 tests/confvar2.test create mode 100755 tests/cxxcpp.test create mode 100755 tests/cxxlibobj.test create mode 100755 tests/cxxlink.test create mode 100755 tests/cxxnoc.test create mode 100755 tests/cxxo.test create mode 100755 tests/cygwin32.test create mode 100644 tests/defs create mode 100755 tests/defun.test create mode 100755 tests/defun2.test create mode 100755 tests/dejagnu.test create mode 100755 tests/depacl.test create mode 100755 tests/depacl2.test create mode 100755 tests/depend.test create mode 100755 tests/depend2.test create mode 100755 tests/depend3.test create mode 100755 tests/discover.test create mode 100755 tests/distdir.test create mode 100755 tests/dup2.test create mode 100755 tests/else.test create mode 100755 tests/empty.test create mode 100755 tests/error.test create mode 100755 tests/exdir.test create mode 100755 tests/exdir2.test create mode 100755 tests/exsource.test create mode 100755 tests/extra.test create mode 100755 tests/extra3.test create mode 100755 tests/extra4.test create mode 100755 tests/flibs.test create mode 100755 tests/fnoc.test create mode 100755 tests/fo.test create mode 100755 tests/fonly.test create mode 100755 tests/fpinst2.test create mode 100755 tests/fpinstall.test create mode 100755 tests/gnits.test create mode 100755 tests/implicit.test create mode 100755 tests/include.test create mode 100755 tests/info.test create mode 100755 tests/insh.test create mode 100755 tests/insh2.test create mode 100755 tests/install.test create mode 100755 tests/installsh.test create mode 100755 tests/instdata.test create mode 100755 tests/instexec.test create mode 100755 tests/insthook.test create mode 100755 tests/instman.test create mode 100755 tests/interp.test create mode 100755 tests/interp2.test create mode 100755 tests/java.test create mode 100755 tests/javaprim.test create mode 100755 tests/javasubst.test create mode 100755 tests/ldadd.test create mode 100755 tests/lex.test create mode 100755 tests/lex2.test create mode 100755 tests/libobj.test create mode 100755 tests/libobj2.test create mode 100755 tests/libobj3.test create mode 100755 tests/libobj4.test create mode 100755 tests/libobj5.test create mode 100755 tests/libobj6.test create mode 100755 tests/libobj7.test create mode 100755 tests/libobj8.test create mode 100755 tests/library.test create mode 100755 tests/link_c_cxx.test create mode 100755 tests/link_f_c.test create mode 100755 tests/link_f_c_cxx.test create mode 100755 tests/link_f_cxx.test create mode 100755 tests/link_f_only.test create mode 100755 tests/lisp.test create mode 100755 tests/mdate.test create mode 100755 tests/mdate2.test create mode 100755 tests/mdate3.test create mode 100755 tests/mkinst2.test create mode 100755 tests/mkinstall.test create mode 100755 tests/noinst.test create mode 100755 tests/number.test create mode 100755 tests/objc.test create mode 100755 tests/obsolete.test create mode 100755 tests/order.test create mode 100755 tests/outdir.test create mode 100755 tests/output.test create mode 100755 tests/output2.test create mode 100755 tests/output3.test create mode 100755 tests/output4.test create mode 100755 tests/output5.test create mode 100755 tests/package.test create mode 100755 tests/parse.test create mode 100755 tests/pluseq.test create mode 100755 tests/pluseq2.test create mode 100755 tests/pluseq3.test create mode 100755 tests/pluseq4.test create mode 100755 tests/pluseq5.test create mode 100755 tests/prefix.test create mode 100755 tests/primary.test create mode 100755 tests/primary2.test create mode 100755 tests/proginst.test create mode 100755 tests/ranlib.test create mode 100755 tests/recurs.test create mode 100755 tests/recurs2.test create mode 100755 tests/remake.test create mode 100755 tests/remake2.test create mode 100755 tests/req.test create mode 100755 tests/rulepat.test create mode 100755 tests/scripts.test create mode 100755 tests/seenc.test create mode 100755 tests/sinclude.test create mode 100755 tests/spell.test create mode 100755 tests/spell2.test create mode 100755 tests/spell3.test create mode 100755 tests/spelling.test create mode 100755 tests/stamph.test create mode 100755 tests/stdlib.test create mode 100755 tests/subdir.test create mode 100755 tests/subdir2.test create mode 100755 tests/subst.test create mode 100755 tests/symlink.test create mode 100755 tests/syntax.test create mode 100755 tests/tags.test create mode 100755 tests/tagsub.test create mode 100755 tests/target.test create mode 100755 tests/texinfo.test create mode 100755 tests/texinfo2.test create mode 100755 tests/texinfo3.test create mode 100755 tests/texinfo4.test create mode 100755 tests/texinfo5.test create mode 100755 tests/texinfo6.test create mode 100755 tests/texinfo7.test create mode 100755 tests/unused.test create mode 100755 tests/version.test create mode 100755 tests/version2.test create mode 100755 tests/version3.test create mode 100755 tests/version4.test create mode 100755 tests/vpath.test create mode 100755 tests/vtexi.test create mode 100755 tests/vtexi2.test create mode 100755 tests/whoami.test create mode 100755 tests/xsource.test create mode 100755 tests/yacc.test create mode 100755 tests/yaccpp.test create mode 100644 texi-vers.am create mode 100644 texinfo.tex create mode 100644 texinfos.am create mode 100644 version.texi create mode 100755 ylwrap diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..49de6bb --- /dev/null +++ b/AUTHORS @@ -0,0 +1,7 @@ +Authors of GNU Automake. + +David Mackenzie. First version of most ".am" files. +Wrote sh version of automake.in. + +Tom Tromey. Touched all ".am" files. +Rewrote automake.in diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..321f166 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,6265 @@ +2002-07-27 Tom Tromey + + Automake 1.4-p6 released. + + * Makefile.am (DISTCLEANFILES): New macro. + (installcheck-local): Use pkgvdatadir. + + * automake.in (handle_configure): Push @rewritten_inputs onto + DIST_COMMON. + + * Makefile.am (maintainer-check): Use [:lower:] instead of [a-z]. + + * configure.in: Updated to automake 1.4-p6. + * NEWS: Updated. + + * config.guess, config.sub, texinfo.tex: New versions from FSF. + +2002-07-25 Tom Tromey + + * automake.in: Changed cygnus.com to redhat.com. + * aclocal.in: Changed cygnus.com to redhat.com. + (scan_file): Don't give error for duplicate macro. + +2002-07-14 Tom Tromey + + Versioned installs: + * m4/Makefile.am (m4datadir): Use APIVERSION. + (m4data_DATA): Added amversion.m4. + (DISTCLEANFILES): New macro. + * Makefile.am (install-exec-hook): New target. + (uninstall-hook): Likewise. + (pkgvdata_DATA): Use pkgvdatadir. + (scriptdir): Likewise. + (EXTRA_DIST): Use pkgvdata_DATA. + * configure: Rebuilt. + * configure.in (APIVERSION): New subst. + (pkgvdatadir): Likewise. + (m4/amversion): Create. + (LN): New subst; check for working ln. + * aclocal.in ($APIVERSION): New global. + (parse_arguments): Use APIVERSION. + (default_acdir): New global. + Don't explicitly pass acdir to scan_m4_files. + * automake.in (am_dir): Use APIVERSION. + (handle_configure): Don't overwrite entries in @other_input_files + when processing. + * m4/amversion.in: New file. + * m4/init.m4 (AM_INIT_AUTOMAKE): Look for versioned aclocal, + automake. + * missing: Accept versioned aclocal. + +2001-08-22 Tom Tromey + + * automake.in (lang_lex_finish): Lex suffix uses `l', not `y'. + From Sergey Vlasov. + +2001-08-18 Gary V. Vaughan + + Backported from development branch. + * automake.in (usage): Rewrote code to handle columnization. + From Alexey Mahotkin and Maxim Sinev. + +2001-07-26 Tom Tromey + + * lisp.am (install-@DIR@LISP): Removed spurious `@'. From Bruno + Haible. + +2001-07-15 Gary V. Vaughan + + * configure.in (AM_INIT_AUTOMAKE): Bumped the version number to + 1.4-p5a. + + Automake 1.4-p5 was released. + + * NEWS: Updated. + * config.guess, config.sub, texinfo.tex: Updated from master + copies at GNU. + * configure.in (AM_INIT_AUTOMAKE): Set the fork identifier to + patch level 5, 1.4-p5. + * stamp-vti: Regenerated. + * version.texi: Ditto. + * configure: Ditto. + * Makefile.in: Ditto. + * m4/Makefile.in: Ditto. + * tests/Makefile.in: Ditto. + + automake.in (scan_one_configure_file): AM_PROG_LIBTOOL is + still used regularly. + + * lib/missing: Updated. Added comment explaining configure.ac + oddity. + + From Bruno Haible : + (install-@DIR@LISP): Handle case where lispdir is not defined. + (uninstall-@DIR@LISP): Likewise. + + From Bruno Haible : + * lispdir.am (uninstall-@DIR@LISP): DESTDIR was missing. + + From Bruno Haible : + * subdirs.am (distclean-recursive): Work around a bug in + /bin/sh on FreeBSD which breaks the loop prematurely. + * Makefile.in: Regenerated. + + From Marius Vollmer : + * automake.in (handle_texinfo): Version.texi files might be + needed in more than one directory. + + * remake.am (config.status): Depends on configure, not + configure.in. + * Makefile.in: Regenerated. + * m4/Makefile.in: Ditto. + * tests/Makefile.in: Ditto. + Reported by Nicolas Joly + + * automake.in (usage): List distributed files correctly. + Reported by Tim Mooney + + * aclocal.in: Update copyright messages to include 2001. + * automake.in: Ditto. + * missing: Ditto. + * texinfos.am: Ditto. + Reported by Tim Mooney + +2001-07-15 Tim Mooney + + * aclocal.in (scan_configure, add_file): Handle the full + macro name even if it contains numbers, such as I18N. + +2001-07-14 Akim Demaille + + * automake.in ($obsolete_rx): Stop at word boundaries. + (&scan_one_configure_file): Skip VERSION=$2. + * aclocal.in ($obsolete_rx): Stop at word boundaries. + +2001-07-02 Gary V. Vaughan + + * automake.in (scan_one_configure_file): Diagnose use of + autoconf-2.50's AC_CONFIG_HEADERS macro as an error. + +2001-06-24 Gary V. Vaughan + + From Martin Dickopp : + * missing: replace hard coded configure.in with $configure_ac, + set appropriately according to file presence. + +2001-06-23 Akim Demaille + + * m4/ccstdc.m4, m4/cond.m4, m4/dmalloc.m4, m4/error.m4, + * m4/header.m4, m4/init.m4, m4/lex.m4, m4/lispdir.m4, + * m4/maintainer.m4, m4/missing.m4, m4/mktime.m4, m4/multi.m4, + * m4/obstack.m4, m4/protos.m4, m4/ptrdiff.m4, m4/regex.m4, + * m4/sanity.m4, m4/strtod.m4, m4/termios.m4, m4/winsz.m4: + Quote the name being defined. + * tests/depacl.test: Adjust. + +2001-06-10 Gary V. Vaughan + + * configure.in (AM_INIT_AUTOMAKE): Bumped the version number to + 1.4-p4a. + + Automake 1.4-p4 was released. + + * NEWS: Updated. + * config.sub: Updated from master copy at GNU -- config.guess + has not changed since the last release. + * configure.in (AM_INIT_AUTOMAKE): Set the fork identifier to + patch level 3, 1.4-p4. + * stamp-vti: Regenerated. + * version.texi: Ditto. + * configure: Ditto. + + From Masaki WAKABAYASHI : + * automake.in: Substitute $configure_ac for @CONFIGURE_AC@ + while writing Makefile.in. + * empty.test: Ditto. + * remake-hdr.am: Use @CONFIGURE_AC@ instead of hardcoding + configure.in. + * remake.am: Ditto. + * texi-vers.am: Ditto. + +2001-06-08 Tom Tromey + + * tests/version4.test: New file. + * automake.in (version_check): New sub. + (handle_options): Use it. + * tests/Makefile.am (AUTOMAKE_OPTIONS): Removed. + (TESTS): Added version4.test. + * m4/Makefile.am (AUTOMAKE_OPTIONS): Removed. + * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits'. + +2001-06-07 Gary V. Vaughan + + * configure.in (AM_INIT_AUTOMAKE): Bumped the version number to + 1.4-p3a. + + Automake 1.4-p3 was released. + + * configure.in (AM_INIT_AUTOMAKE): Set the fork identifier to + patch level 3, 1.4-p3. + * stamp-vti: Regenerated. + * version.texi: Ditto. + * configure: Ditto. + + * texinfo.tex: Updated from master copy at GNU. + + * config.guess, config.sub: Updated from master copies at GNU. + + From "Gerrit P. Haase" : + * Makefile.in: Regenerated. + * Makefile.am (install-data-hook): No slash after $(DESTDIR). + + * NEWS: Updated. + * Makefile.in: Regenerated. + * aclocal.m4: Regenerated. + * configure: Regenerated. + * stamp-vti: Regenerated. + * version.texi: Regenerated. + * m4/Makefile.in: Regenerated. + * tests/Makefile.in: Regenerated. + * automake.in (configure_ac): Set this new variable to whichever + of configure.ac and configure.in is found first, and use it + throughout in place of hardcoded configure.in. + * aclocal.in (configure_ac): Ditto. + +2001-05-25 Tom Tromey + + From Karl Berry: + * automake.in (handle_texinfo): version.texi might be included in + multiple places. + +2001-05-24 Gary V. Vaughan + + * configure.in (AM_INIT_AUTOMAKE): Bumped the version number to + 1.4-p2a. + + Automake 1.4-p2 was released. + + * configure.in (AM_INIT_AUTOMAKE): Set the fork identifier to + patch level 2, 1.4-p2. + * configure: Regenerated. + * stamp-vti: Ditto. + * version.texi: Ditto. + * NEWS: Updated. + * automake.in (parse arguments): Updated copyright dates. + + * config.sub: Updated from master copy at GNU -- config.guess + has not changed since the last release. + + From "Steve M. Robbins" + * automake.in (scan_one_configure_file): Cope with AC_CONFIG_FILES + macros introduced in autoconf-2.50. + +2001-05-21 Gary V. Vaughan + + From Christian Holm Christensen : + * automake.in (lang_ppf77_rewrite): This function should have + been defined all along. + (lang_ppf77_finish): Fix the format of the rules we output. + +2001-05-13 Gary V. Vaughan + + * Makefile.in: Regenerated. + From Peter Breitenlohner : + * Makefile.am (install-data-hook): Take DESTDIR into account + when calculating to installed scripts. + +2001-05-12 Steve M. Robbins + + * automake.in (handle_dist): Fix makefile fragment emitted when a + distcheck-hook is defined. + +2001-05-10 Gary V. Vaughan + + * configure.in (AM_INIT_AUTOMAKE): Bumped the version number to + 1.4-p1a. + +2001-05-08 Gary V. Vaughan + + Automake 1.4-p1 was released. + + * Makefile.in: Regenerated. + * aclocal.m4: Ditto. + * m4/Makefile.in: Ditto. + * tests/Makefile.in: Ditto. + + * NEWS: Updated. + + * config.guess, config.sub: Updated from master copies at GNU. + + * configure.in (AM_INIT_AUTOMAKE): Set the fork identifier to + patch level 1, 1.4-p1. + Makefile.in: Regenerated. + configure: Ditto. + stamp-vti: Ditto. + version.texi: Ditto. + +2001-05-08 Tom Tromey + + * automake.in (GNITS_VERSION_PATTERN): Document. Added `fork + identifier'. + (handle_options): Handle fork identifier in version number. + +2001-05-08 Gary V. Vaughan + + * automake.in (libtoolize_files): Removed ltconfig from this + list, since it is not generated by libtool-1.4 or better. + (libtoolize_sometimes): List of files that are generated by + some versions of libtoolize. + (initialize_global_constants): Also include files from + libtoolize_sometimes in common_files. + + * automake.in (require_file_internal): Fixed bogus error + during file copy on 'automake --add-missing --copy'. The + result of the system() call is no longer negated. + + * automake.in (handle_dist_worker): Typo. Added the missing + 'd' required to include directories listed in EXTRA_DIST in + the distribution tarball. + + * texinfos.am (uninstall-info): Typo. Added the missing $. + + * configure.in (AM_INIT_AUTOMAKE): Bump version to 1.4.1. + +1999-01-14 Tom Tromey + + * automake.in (handle_configure): Compute $header_dir based on + $one_name, not $one_hdr. Reported by Erez Zadok. Fixes + confh2.test. + (handle_configure): Compute relative path to input header + correctly in all cases. + + * automake.in (handle_tests): Avoid error messages from dejagnu + test rules. From Karl Heuer. + + * automake.in (handle_texinfo): Add `/' to end of $conf_dir. + + * Makefile.am (AUTOMAKE_OPTIONS): Added `1.4'. + + * texi-vers.am ($(srcdir)/stamp-@VTI@): Find @TEXI@ in srcdir. + From Alexandre Oliva and Erez Zadok. + + * automake.in (create): Renamed from touch. + (handle_configure): Use create, not touch. + + * config.sub, config.guess: New versions from autoconf. + + * mkinstalldirs: New version from autoconf. + +1999-01-12 Tom Tromey + + * config.sub, config.guess, COPYING, texinfo.tex: New versions + from FSF. + +1999-01-11 Marcus G. Daniels + + * automake.in (PATH_PATTERN): New variable: + (INCLUDE_PATTERN): Use it. Ignore all include commands using + symbols besides $(top_srcdir) and $(srcdir). + +1999-01-11 Alexandre Oliva + + * automake.in (handle_dist_worker): avoid failure in `make dist' + if last file is a builddir-only file + +1999-01-11 Alexandre Oliva + + * missing (autoheader): `s' was missing from sed script; grr + +1999-01-11 Tom Tromey + + * remake-hdr.am (@STAMP@): Reverted timestamp change. + ($(srcdir)/@STAMP@.in): Likewise. + +1999-01-10 Tom Tromey + + * Makefile.am (scriptdir): New macro. + (script_DATA): Likewise. + (install-data-hook): Use them. + (EXTRA_DIST): Added script_DATA. + (installcheck-local): Use script_DATA. + + * Makefile.am (pkgdata_DATA): Removed duplicate definition. + +1999-01-10 Alexandre Oliva + + * missing (autoheader): accept multiple header files + (automake): simplify sed processing + +1999-01-10 Alexandre Oliva + + * automake.in (handle_configure, stamp_dir): create only one stamp + file per header, instead of one in the top-level directory and one + in the directory that contains the header. + +1999-01-10 Tom Tromey + + * automake.in (lang_objc_finish): Formatting fix. + + * automake.in (objc_extensions): New sub. + (handle_dependencies): Only generate dependency-tracking code for + ObjC when ObjC source seen. + +1998-12-22 Marcus G. Daniels + + * automake.in (handle_dependencies): Transform EXT & PFX in + Objective C case. + +1998-12-11 Marcus G. Daniels + + * automake.in: Register Objective C language. + (finish_languages): Consider Objective C to be non_c. + (lang_objc_rewrite, lang_objc_finish): New functions. + (resolve_linker): Recognize OBJCLINK before LINK. + +1999-01-10 Tom Tromey + + * automake.in (handle_texinfo): Handle empty $config_aux_dir. + + * automake.in (handle_texinfo): Set $conf_pat correctly when + config_aux_dir not used. + (handle_texinfo): Run maintainer-clean-aminfo rules in srcdir. + From Erez Zadok. + * texi-vers.am (maintainer-clean-@VTI@): Prefix file names with + $(srcdir). From Erez Zadok. + ($(srcdir)/stamp-@VTI@): Don't run mdate-sh from srcdir. + +1999-01-08 Thomas Tanner + + * depend.am: remove the dependencies (.deps) + in "make distclean", not "make maintainer-clean" + +1999-01-10 Tom Tromey + + * aclocal.in (write_aclocal): Updated copyright. + (parse_arguments): Likewise. + * automake.in (parse_arguments): Updated copyright. + (initialize_global_constants): Likewise. + + * Makefile.am (pkgdata_DATA): Renamed from pkgdata_SCRIPTS. + (install-data-hook): New hook. Report from Petter Reinholdtsen. + + * remake-hdr.am: Provide `else' clause for each `if'. + +1999-01-10 Alexandre Oliva + + * remake-hdr.am: recover from removal of config headers, and try + to get real timestamps, which is useful for CVS files + +1999-01-10 Tom Tromey + + * automake.in (handle_merge_targets): Don't special-case "-local" + targets. Test all.test. + + * automake.in (handle_texinfo): Prepend $(srcdir) to directory + used to find texinfo.tex. Report from Glenn Amerine. + +1999-01-07 Tom Tromey + + Based on report from Marcus G. Daniels. Fixes include.test. + * automake.in (generate_makefile): Call read_main_am_file. + (read_main_am_file): New sub. + (read_am_file): Moved header generation code into + read_main_am_file. + +1999-01-06 Gary V. Vaughan + + * automake.in (require_file_internal): qub perl on win32 hangs + on a call to unlink for a non-existant file, which in turn causes + tests/symlink.test to hang on win32. Check that the file exists + before unlinking it! + +1998-12-24 Thomas Tanner + + * automake.in (handle_ltlibraries): check whether -module was + defined for libraries names without 'lib' prefix. + +Fri Dec 11 10:20:42 1998 Matthew D. Langston + + * compile_f_c_cxx.test: Change to use F77 and F77LINK instead of + FC and FLINK, respectively. + * flibs.test: same + * fnoc.test: same + * fo.test: same + * fonly.test: same + * link_f_c.test: same + * link_f_c_cxx.test: same + * link_f_cxx.test: same + * link_f_only.test: same + +Fri Dec 11 10:23:17 1998 Matthew D. Langston + + * automake.in, automake.texi: Change all of the Fortran 77 code to + use the new `F77' prefix instead of the older `FC' prefix. + Specifically this changed FC, FCOMPILE, LTFCOMPILE, FLINK and FLD + to F77, F77COMPILE, LTF77COMPILE, F77LINK and F77LD, respectively. + +1999-01-05 Tom Tromey + + * depend2.am (%.o): Use \012, not \n, to avoid losing `tr's. From + Bill Currie. + (%.lo): Likewise. + +1998-12-22 Alexandre Oliva + + * depend2.am: Don't assume backslash can't occur in the middle of + filename; it loses on M$W + +1998-12-21 Tom Tromey + + * automake.in (handle_libraries): Reverted Thomas Tanner's + change. Non-libtool libraries still must fit naming + requirements. + +1998-12-21 Alexandre Oliva + + * automake.in (handle_configure): Dist inputs for AC_OUTPUT. + +1998-12-21 Alexandre Oliva + + * depend2.am: don't use .p and .P for dependencies; it loses on + case-insensitive filesystems. + Reported by Henrik Frystyk Nielsen + +1998-12-20 Thomas Tanner + + * automake.in (handle_libraries, handle_ltlibraries): relax the + name checking to not enforce `^lib.*' for the sake of building libtool + modules. + +1998-12-21 Tom Tromey + + * automake.in (do_one_merge_target): Special case + install-data-hook and install-exec-hook. + (handle_merge_targets): Removed install-data-hook and + install-exec-hook code. Test insthook.test. + +1998-12-16 Tom Tromey + + * tags.am (ID): Uniquify list of sources. Report from Jim + Meyering. + +1998-12-11 Tom Tromey + + Bug report from Paul D. Smith: + * automake.in (handle_merge_targets): Set + AM_INSTALL_PROGRAM_FLAGS, not INSTALL_PROGRAM. + * header-vars.am (INSTALL_PROGRAM): Added + AM_INSTALL_PROGRAM_FLAGS. + +1998-12-03 Tom Tromey + + * automake.in (handle_dist): Print prettier banner when + `make dist' succeeds. From Akim Demaille. + +1998-12-02 Tom Tromey + + * configure.in: Upped version to 1.3e (1.3d was just released). + + * configure.in: Upped version to 1.3d. + + * texinfo.tex, config.guess, config.sub, install-sh: New + versions. + * ansi2knr.c: New version. + + * automake.in (handle_configure): Quote @MAINTAINER_MODE_TRUE@ to + avoid problems where AM_MAINTAINER_MODE is put into automake's own + configure.in. + + * Makefile.am (cvs-dist): Run `cvs tag' operation in srcdir. + + Some bugs from François Pinard: + * automake.in (usage): Remove duplicates in file list. + + * automake.in (usage): Print files in column-major order. + (handle_gettext): Only require ABOUT-NLS for GNU programs. + +1998-12-01 Tom Tromey + + * automake.texi (Dist): Documented GZIP_ENV. + * automake.in (handle_dist): Define and use GZIP_ENV, not GZIP. + (initialize_global_constants): Use GZIP_ENV, not GZIP. + +1998-11-27 Tom Tromey + + * automake.in (quote_cond_val): Use "\002", not '\002', to + represent null string. + (unquote_cond_val): Removing all "\002" strings from result. Test + cond7.test. + + * automake.texi: Formatting changes for latest texinfo. + + * automake.in (handle_java): Removed debugging print. + +1998-11-18 Tom Tromey + + * automake.in (finish_languages): Use CCLD, not CLD. + + * automake.in (finish_languages): Define CLD; use it in LINK + definition. + (lang_cxx_finish): Define CXXLD; use it in CXXLINK definition. + (lang_f77_finish): Define FLD; use it in FLINK definition. + (lang_ppf77_finish): Likewise. + (lang_ratfor_finish): Likewise. + +1998-11-10 Matthew D. Langston + + * automake.in (scan_one_configure_file): Recognize + AC_F77_LIBRARY_LDFLAGS, and recognize FLIBS as a configure + substitution. + + * automake.texi: Fix several little Fortran 77 references to now + point to autoconf.texi. Rename associated Fortran 77 macros from + `AM_' to `AC_'. + +1998-11-10 Tom Tromey + + * automake.in (read_am_file): Handle configure_vars case. Test + pluseq4.test. + +1998-11-09 Tom Tromey + + * automake.in (read_am_file): `conditional_stack' isn't a + function. Correctly add new value to existing value in `+=' + case. + +1998-10-29 Gary V. Vaughan + + * automake.in (parse_arguments): Fixed type of -c for copying + +1998-10-30 Tom Tromey + + * automake.texi (Install): Documented DESTDIR more fully. From + Jeff Garzik. + + * automake.in (MACRO_PATTERN): Recognize `+='. + (BOGUS_MACRO_PATTERN): Likewise. + (read_am_file): Handle `+=' assignments. + +1998-10-28 Tom Tromey + + * Makefile.am (maintainer-check): Changed code to be acceptable to + bash 2.01.1. + + * automake.in (do_one_clean_target): Special-case config.status. + Report from Jeff Garzik. + + * m4/Makefile.am (m4data_DATA): Don't mention f77.m4. + * m4/f77.m4: Removed; macro now in autoconf proper. + +1998-10-24 Tom Tromey + + * automake.in (handle_dist_worker): Typo fix in code testing to + see if subdir is `.'. From Raja R Harinath. + + * m4/lispdir.m4: Fixed sed invocation. From Akim Demaille. + +1998-10-20 Tom Tromey + + * automake.in (scan_dependency_file): Fixed test on `while' loop. + Fixes depend2.test. Report from Akim Demaille. + +1998-10-16 Tom Tromey + + * automake.in (handle_ltlibraries): Specify `noinst' when + computing valid prefixes. From Ulrich Drepper. + + * automake.in (scan_dependency_file): Don't give an error if there + is text after the last line. Report from Matthew D. Langston. + + * m4/mktime.m4: Detect glibc mktime bug. From Jim Meyering. + + * Makefile.am (SUBDIRS): Added `.' again. + + * Makefile.am (EXTRA_DIST): Removed automake.spec.in. From + Matthew D. Langston. + (info_TEXINFOS): Removed am-f77.texi. + + * automake.in (handle_ltlibraries): Allow `noinst' LTLIBRARIES. + These are libtool convenience libraries. + +1998-10-13 Tom Tromey + + * m4/f77.m4: New file. + * m4/Makefile.am (m4data_DATA): Added f77.m4. + +Thu Oct 8 15:00:57 1998 Matthew D. Langston + + * automake.in (resolve_linker): Put the Fortran 77 linker where it + needs to be. + + * automake.in (lang_f77_finish): Add support for Fortran 77. + + * automake.in (f77_extensions): New helper function for function + `lang_f77_finish'. + + * automake.in (lang_f77_rewrite): Change to return success. + + * automake.in (scan_one_configure_file): Add test for the Fortran + 77 compiler. + + * automake.in (finish_languages): Changed tests for "C++ only" to + "C++ and/or Fortran 77 only", and renamed `all_cxx' to `non_c'. + + * automake.in: Registered the ppf77 language (`.F' extension) for + preprocessed Fortran 77. + + * automake.in: Registered the ratfor language (`.r' extension). + + * automake.in: Registered Fortran 77 header files with the "header + language" (`.inc' extension). + +Tue Sep 8 14:50:50 1998 Matthew D. Langston + + * automake.texi: Added several new index entries. + +Sun Aug 30 16:10:31 1998 Matthew D. Langston + + * automake.texi: + - Add `@ovindex' (output variable index). + - Merge `@defmac' (Autoconf macros) and `@ovindex' to the General + Index. + + * automake.texi (Macros): + - Changed the `@table @code' list of macros to `@defmac'. + - Add `AC_PROG_FC' and `MDL_F77_LIBRARY_LDFLAGS' to the list. + +Tue Aug 11 10:42:39 1998 Matthew D. Langston + + * automake.texi (C++): Change `@table' to `@vtable'. + + * automake.texi (Fortran 77): Add Fortran 77 documentation. + +1998-10-11 Tom Tromey + + Preliminary (completely untested) multilib support. + * automake.texi (Macros): Document AM_ENABLE_MULTILIB. + * m4/Makefile.am (m4data_DATA): Added multi.m4. + * Makefile.am (amfiles): Added multilib.am. + * automake.in (seen_multilib): New global. + (scan_one_configure_file): Recognize AM_ENABLE_MULTILIB. + (generate_makefile): Call handle_multilib. + (handle_multilib): New function. + * multilib.am: New file. + * m4/multi.m4: New file. + +1998-10-08 Tom Tromey + + * automake.in (handle_dist): Always include configure.in and + configure in distribution. Fixes confdist.test. + + * automake.in (do_one_merge_target): Be silent when running + install-exec-am and install-data-am. Fixes extra3.test and + extra4.test. + +1998-10-07 Tom Tromey + + * automake.in (am_install_var): Added -noextra option. + (handle_data): Pass -noextra to am_install_var. + +Sun Oct 4 22:24:10 1998 Tom Tromey + + * m4/winsz.m4 (AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Use + 3-argument form of AC_DEFINE. + * m4/regex.m4 (AM_WITH_REGEX): Use 3-argument form of AC_DEFINE. + * m4/ptrdiff.m4 (AM_TYPE_PTRDIFF_T): Use 3-argument form of + AC_DEFINE. + * m4/protos.m4 (AM_C_PROTOTYPES):Use 3-argument form of + AC_DEFINE. + * m4/obstack.m4 (AM_FUNC_OBSTACK): Use 3-argument form of + AC_DEFINE. + * m4/init.m4 (AM_INIT_AUTOMAKE): Use 3-argument form of + AC_DEFINE. + * m4/dmalloc.m4 (AM_WITH_DMALLOC): Use 3-argument form of + AC_DEFINE. + +Tue Oct 6 00:02:15 1998 Tom Tromey + + * depend2.am (%.lo): Handle case where compiler does not put space + before ":". From Raja R Harinath. + +Mon Oct 5 13:05:43 1998 Tom Tromey + + * automake.in (scan_one_configure_file): AC_CONFIG_HEADER is not + obsolete; it simply isn't preferred with automake. + (scan_one_configure_file): Likewise for AC_DECL_YYTEXT and + AC_PROG_LEX. + + * automake.in (am_line_error): Handle case where variable defined + in configure.in. Fixes test badline.test. + (%configure_vars): Redefined meaning of values. + (scan_one_configure_file): Set $configure_vars values + appropriately. + +Sat Oct 3 14:53:34 1998 Tom Tromey + + * automake.in (handle_aclocal_m4): Use new MAINTAINER_MODE + conditional. + (handle_configure): Likewise. + (read_am_file): Likewise. + (file_contents_with_transform): Likewise. + (scan_one_configure_file): Recognize that AM_MAINTAINER_MODE + defines a conditional. + * automake.texi (Optional): Document new AM_MAINTAINER_MODE. + * texi-vers.am ($(srcdir)/@VTEXI@): Look at MAINTAINER_MODE + conditional. + (maintainer-clean-@VTI@): Likewise. + * remake.am ($(srcdir)/configure): Look at MAINTAINER_MODE + conditional. + * remake-hdr.am ($(srcdir)/@CONFIG_HEADER_IN@): Look at + MAINTAINER_MODE conditional. + * m4/maintainer.m4 (AM_MAINTAINER_MODE): Defined MAINTAINER_MODE + conditional. + +1998-10-03 Jim Blandy + + * depend2.am (%.lo): When editing the dependency file to add the + .lo file to the targets, allow for whitespace between the end of + the filename and the colon. Some compilers (notably the Cygnus + release of GCC 2.7-97r1) put space there: "alist.o : ..." + +Sat Oct 3 12:07:21 1998 Tom Tromey + + * automake.in (handle_configure): Handle case where there is no + Makefile in the config header directory. Fixes test config.test. + +Thu Oct 1 00:51:51 1998 Tom Tromey + + * depend2.am (%.o): Append sed results to .P file in this case + too. From Raja R Harinath. + + * m4/lispdir.m4 (AM_PATH_LISPDIR): Correctly find xemacs and + xemacs install directories. From Robert Bihlmeyer. + + * depend2.am: Don't bother trying to delete source file from + list. + + * depend2.am (%.o): Handle deleted header file problem. + (%.lo): Likewise. + + * texinfos.am (install-info-am): Handle case where INFO_DEPS is + empty. Reported by Andrew Cagney. + (uninstall-info): Likewise. + (dist-info): Likewise. + + * automake.in (handle_texinfo): Error if user tries to generate + HTML. + +Wed Sep 30 00:41:40 1998 Tom Tromey + + * automake.in (do_one_clean_target): Don't push previous clean + target if this target is `mostly'. Report from Raja R Harinath. + + * subdirs.am (mostlyclean-recursive ...): Build local_target, not + target. From Raja R Harinath. + + Completely changed how languages and source files are handled: + * automake.in: Call register_language for each language. + (lang_c_rewrite): New function. + (lang_cxx_rewrite): Likewise. + (lang_header_rewrite): Likewise. + (lang_yacc_rewrite): Likewise. + (lang_yaccxx_rewrite): Likewise. + (lang_lex_rewrite): Likewise. + (lang_lexxx_rewrite): Likewise. + (lang_asm_rewrite): Likewise. + (lang_fortran_rewrite): Likewise. + (register_language): Likewise. + (extension_map): New global. + (language_map): Likewise. + (resolve_linker): New function. + (handle_single_transform_list): Rewrote to use lang_X_rewrite + functions. Changed meaning of first argument. + (initialize_per_input): Removed seen_any_source. Initialize + language_scratch, extension_seen. Removed cxx_extensions, + seen_c_source, dir_holds_headers, dir_holds_sources. + (handle_source_transform): Don't compute $objpat. Pass $obj + directly to handle_single_transform_list. + (handle_built_sources): Fixed call to + handle_single_transform_list. + (lang_c_finish): New function. + (lang_cxx_finish): Likewise. + (lang_header_finish): Likewise. + (lang_yacc_finish): Likewise. + (lang_yaccxx_finish): Likewise. + (lang_lex_finish): Likewise. + (lang_lexxx_finish): Likewise.. + (lang_asm_finish): Likewise. + (lang_fortran_finish): Likewise. + (yacc_lex_finish_helper): Likewise. + (libtool_compiler): Likewise. + (saw_extension): New function. + (handle_lib_objects_cond): Use saw_extension, not old variables. + (handle_yacc_lex_cxx): Removed. + (finish_languages): New function. + (get_object_extension): Don't set dir_holds_sources. + (handle_headers): Don't set dir_holds_headers. Instead, call + saw_extension. + (saw_sources_p): New function. + (handle_tags): Use it. + (handle_dependencies): Likewise. + (cxx_extensions): New function. + (handle_dependencies): Use it. + (generate_makefile): Call finish_languages, not + handle_yacc_lex_cxx. + +1998-05-24 Andreas Schwab + + * texi-vers.am: Use the correct target names. Fix generation of + stamp file. + + * automake.in (handle_tests): In commands generating site.exp copy + the old contents from site.exp, not site.bak, which does not + exist. + +Tue Sep 29 00:10:22 1998 Tom Tromey + + Fixed noinst.test again: + * automake.in (do_one_merge_target): Special-case `install-am'. + (handle_merge_targets): Don't compute @install variable. + + Fixes for recurs2.test. Report from Jim Meyering. + * automake.in (vars_scanned): Define globally. + (variable_value_as_list_worker): Delete $var entry in + %vars_scanned after local work is done. + +1998-05-26 Marcus G. Daniels + + * automake.in: New pattern: INCLUDE_PATTERN. + (read_am_file): Make AM_FILE a local filehandle. + For INCLUDE_PATTERN, store included paths on @include_stack and call + read_am_file with argument. + (handle_configure): When printing the dependencies for + Makefile.in, print the items on include_stack (if any) as + dependencies, too. + + * automake.texi: Make a command index `cm' that goes into the + concept index. Put if, endif, else, and include in the command index. + (Include): Show usage of include directive. + +Mon Sep 28 00:03:45 1998 Tom Tromey + + `.' in SUBDIRS changes order of builds: + * Makefile.am (SUBDIRS): Added `.'. Put tests last. + * tags.am (TAGS): Don't look for TAGS file in `.'. + * automake.texi (Top level): Document SUBDIRS change. + * automake.in (handle_installdirs): Create separate installdirs-am + target. + (handle_merge_targets): Don't put all-am onto @all. Fixed error + message. Correctly handle install-info. Give error if + install-info-local inappropriately defined. Don't special-case + install-data, install-exec, install, uninstall, or all. + (handle_subdirs): Don't push `-recursive' target names onto + corresponding lists. + (do_one_merge_target): Always define `-am' form of rule, and point + ordinary form to `-am' or `-recursive' as appropriate. + Special-case `all'. + (do_check_merge_target): Generate check-am target. + (handle_dist_worker): Use target_defined. + (handle_dist): Likewise. + (handle_merge_targets): Likewise. + (do_one_merge_target): Likewise. + (do_check_merge_target): Likewise. + (do_one_clean_target): Likewise. + (initialize_per_input): Initialize $all_target. + (do_one_clean_target): Always generate -am form of rule; other + changes for new SUBDIRS change. + (handle_clean): Always generate clean-am form of rule. + (handle_tags): Only build subdir if not `.'. + (handle_dist_worker): Skip `.' directory. + * subdirs.am: Allow `.' to be specified in SUBDIRS. + +Sun Sep 27 20:02:21 1998 Tom Tromey + + * automake.texi (Dist): Document EXTRA_DIST change. + * automake.in (handle_dist_worker): Allow subdirs in EXTRA_DIST. + + * automake.in (handle_ltlibraries): Wrote better comment about + EXTRA_LTLIBRARIES. + + * automake.texi (Invoking Automake): Document --copy. + * automake.in (copy_missing): New global. + (parse_arguments): Recognize --copy/-c. + (require_file_internal): Handle $copy_missing. Fixed error + message. + (initialize_global_constants): Document -c/--copy. + + * automake.texi: Document LIBOBJS trick. + + * automake.in (handle_dist_worker): If DIST_SUBDIRS defined, use + it even when SUBDIRS not conditional. + + * automake.in (quote_cond_val): Turn tabs into \003. + (unquote_cond_val): Turn \003 back into tabs. Fixes test + cond6.test. + + * automake.in (read_am_file): Treat backslash-newline as + whitespace. Test parse.test. + +Sat Sep 26 19:31:22 1998 Tom Tromey + + * configure: Rebuilt. + * configure.in: Upped version to 1.3c. + + Track recent autoconf changes: + * m4/Makefile.in: Rebuilt. + * m4/Makefile.am (m4data_DATA): Updated for deleted files. + * m4/init.m4 (AM_INIT_AUTOMAKE): Use AC_PROG_INSTALL. + * m4/mingw.m4: Removed. + * m4/cygwin.m4: Removed. + * m4/install.m4: Removed. + * m4/exeext.m4: Removed. + * automake.in (scan_one_configure_file): Don't look for + AM_EXEEXT. + (check_cygnus): Only mention AC_EXEEXT. + (obsolete_macros): Mention AM_PROG_INSTALL, AM_EXEEXT, + AM_CYGWIN32, AM_MINGW32. + ($seen_prog_install): Changed interpretation; changed all users. + (scan_one_configure_file): Don't look for AM_PROG_INSTALL. + ($scripts_installed): Removed. + (handle_scripts): Use local $scripts_installed. + * aclocal.in (obsolete_macros): Added AM_PROG_INSTALL, AM_EXEEXT, + AM_CYGWIN32, AM_MINGW32. + +Mon Jul 6 14:52:49 1998 Ian Lance Taylor + + * compile.am (mostlyclean-compile): If OBJEXT, remove *.$(OBJEXT) + along with *.o. + +Thu May 28 18:49:47 1998 Ian Lance Taylor + + * automake.in (seen_objext): New variable. + (get_object_extension): If seen_objext, use .$(OBJEXT) rather than + .o. When including compile.am, keep or discard OBJEXT lines + according to whether seen_objext is set. If seen_objext, add .obj + to @suffixes. If seen_objext, use .$(OBJEXT) rather than .o when + building ansi2knr. + (handle_yacc_lex_cxx): If seen_objext, add a rule to create .obj + files. If seen_objext, use .$(OBJEXT) rather than .o when + building ansi2knr. + (scan_one_configure_file): Check for .obj as well as .o in + LIBOBJS. Set seen_exeext if we see AC_EXEEXT. Look for + AC_OBJEXT, and if found set seen_objext and set OBJEXT in + configure_vars. + (check_cygnus): Change error message to permit AC_EXEEXT. + * compile.am: Add OBJEXT lines for .c.obj compilation. + * Makefile.in: Rebuild. + * m4/Makefile.in: Rebuild. + * tests/Makefile.in: Rebuild. + +Mon Sep 11 16:07:55 1997 Chris Provenzano + + * header-vars.am: SHELL=@SHELL@ + Ran aclocal, autoconf, and automake. + +Sat Sep 26 16:31:29 1998 Tom Tromey + + * ltlib.am: Use $(INSTALL) and not $(INSTALL_DATA). + +Mon Sep 14 08:27:38 1998 Per Cederqvist + + * automake.in (handle_texinfo): The logic for when to provide + texinfo.tex was broken. Attempt to fix. + +Mon Sep 14 00:55:12 1998 Per Cederqvist + + Fix for Dynix 3.1.1. + * automake.in (handle_yacc_lex_cxx): Transform "# " to "#line"; + some compilers (such as /bin/cc on Dynix 3.1.1) don't accept the + output from the preprocessor. + +Tue Aug 25 18:40:51 1998 Tom Tromey + + * automake.in (handle_tests): Don't create site.exp target if it + is already in Makefile.am. + +Sun Aug 16 23:26:26 1998 Tom Tromey + + * automake.in (handle_configure): Use @inputs, not + @rewritten_inputs, when constructing CONFIG_FILES. Use different + list to test for file existence. Test colon6.test. + (rewrite_inputs_into_dependencies): Added add_srcdir argument. + Updated all callers. + +Wed Aug 12 14:16:57 1998 Tom Tromey + + * Released 1.3b. + +Tue Aug 11 12:18:59 1998 Tom Tromey + + * automake.in (handle_clean): Added missing close-paren. Quote + `$' so it doesn't expand when replacing. From Markus + F.X.J. Oberhumer. + + * aclocal.in (usage): Changed bug address. + * automake.in (usage): Changed bug address. + + * clean.am (distclean-generic): Don't mention + DISTCONFIGCLEANFILES. From Markus F.X.J. Oberhumer. + +Mon Aug 10 20:57:35 1998 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Redirect ansi2knr output to + correct file. From Kave Ghazi. + +Sun Aug 2 16:05:16 1998 Tom Tromey + + * Released 1.3a. + + * config.sub, config.guess, texinfo.tex: New versions from FSF. + +Sun Jul 19 00:04:25 1998 Tom Tromey + + * automake.in (variable_conditions): Initialize %vars_scanned. + (variable_conditions_sub): Check it. Test cond5.test. + +Sat Jul 18 00:24:14 1998 Tom Tromey + + * automake.in (variable_value_as_list_worker): Renamed from + variable_value_as_list. Set entry in vars_scanned, and give error + if variable recursively defined. Test recurs.test. + (value_to_list): Call it instead. + (variable_value_as_list): New function. + + * automake.in (variable_conditions_sub): If var is not + conditional, but does have conditional subvariables, then return + value should be all permutations of subvariable conditions. Test + cond4.test. + (handle_source_transform): Define _OBJECTS variable with each + condition; no need to define multiple new variables. + +Fri Jul 17 12:56:14 1998 Tom Tromey + + * automake.in (am_install_var): Use DESTDIR, not DATADIR. From + Motoyuki Kasahara. + + * automake.in (scan_dependency_file): Recognize DOS-style paths as + absolute. + * ylwrap: Recognize DOS-style paths as absolute. From Ian Lance + Taylor. + +Fri Jul 17 07:37:20 1998 H.J. Lu (hjl@gnu.org) + + * ylwrap: Don't use absolute path if the input is in the + current directory. + +Fri Jul 17 11:58:27 1998 Ian Lance Taylor + + * automake.in: Use $(AM_MAKEFLAGS) in every invocation of $(MAKE). + * subdirs.am: Likewise. + +Thu Jul 16 18:09:03 1998 Ian Lance Taylor + + * remake.am (config.status): Depend upon + $(CONFIG_STATUS_DEPENDENCIES). + * automake.in (handle_configure): Examine + CONFIG_STATUS_DEPENDENCIES. + +Tue Jul 14 13:37:48 1998 Tom Tromey + + * Makefile.am: Always look in srcdir for automake.in. + +Tue Jun 23 14:00:27 1998 Ian Lance Taylor + + * progs.am: Don't let $(EXEEXT) interfere with $(transform). + Report from Mike Stump . + +Tue Jun 2 13:27:34 1998 Tom Tromey + + * automake.in (scan_one_configure_file): Make CONFIGURE file + handle local. From Kevin Street. + + * automake.in (read_am_file): Error if blank line or comment + follows trailing backslash. Test syntax.test. + (file_contents_with_transform): Likewise. + +Thu May 28 18:49:47 1998 Ian Lance Taylor + + * automake.in (handle_configure): Always use $(SHELL) when running + config.status. + +Mon Jun 1 14:23:29 1998 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Use AM_CPPFLAGS, AM_CXXFLAGS, + AM_CFLAGS. + (output_yacc_build_rule): Use AM_YFLAGS, AM_LFLAGS. + (handle_dependencies): Don't define CXXMKDEP. + + * clean.am (mostlyclean-generic): Prefix rule with MOSTLYCLEAN. + (clean-generic): Prefix rule with CLEAN. + (distclean-generic): Prefix rule with DISTCLEAN. + (maintainer-clean-generic): Prefix rule with MAINTAINERCLEAN. + BUILT_SOURCES now handled in automake itself. + * automake.in (initialize_per_input): Initialize + maintainer_clean_files. + (handle_yacc_lex_cxx): Put lex and yacc output files onto + @maintainer_clean_files. + (handle_clean): Handle @maintainer_clean_files. Transform + clean.am when installing; try to remove unnecessary tests in + generated code. + + * automake.in (do_check_merge_target): Only generate $(MAKE) + command if there are check targets to make. Report from Karl + Heuer. + +Sun May 17 23:05:55 1998 Tom Tromey + + * aclocal.in (write_aclocal): Fixed generated copyright message. + From Eleftherios Gkioulekas. + + * automake.in (parse_arguments): Typo fix from Paul D. Smith. + +Fri May 8 12:14:03 1998 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Put lex and yacc output files + onto @clean. + +Wed May 6 01:18:05 1998 Tom Tromey + + * header-vars.am (DESTDIR): Changed from DISTDIR. + +Fri Apr 24 10:16:20 1998 Tom Tromey + + * libs.am: Don't display loop while it runs. + +Sun Apr 5 13:58:24 1998 Tom Tromey + + * Released 1.3. + + * automake.in (handle_options): Correctly handle trailing alpha + version letter or lack thereof. Test version3.test. + + * automake.in (am_conf_line_warning): Perl 4 fixlet; typo fix. + + * automake.in (handle_ltlibraries): Examine _DEPENDENCIES + variable. Report from Chris Provenzano. Test library.test. + (handle_libraries): Likewise. + + * m4/lex.m4: Allow AM_PROG_LEX to be called with no arguments. + +Sun Apr 5 13:54:25 1998 Alexandre Oliva + + * automake.in (scan_one_configure_file): Only warn about + AC_DECL_YYTEXT and AC_PROG_LEXX. + (am_conf_line_warning): New function. + +Fri Apr 3 15:43:46 1998 Doug Evans + + * automake.in (handle_configure): Fix setting of colon_infile + in case where multiple files are used to build Makefile. + [ Test colon5.test ] + +Fri Apr 3 13:07:58 1998 Tom Tromey + + * ansi2knr.c, texinfo.tex: New versions from respective + maintainers. + + * automake.in (scan_one_configure_file): Exclude INSTALL_DATA from + configure_vars. Test instdata.test. + +Tue Mar 31 21:07:42 1998 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Changed to use new version of + ansi2knr. + * ansi2knr.c: New version from L. Peter Deutsch. + +Thu Mar 26 11:00:04 1998 Tom Tromey + + * m4/exeext.m4: Correctly eliminate bad cases when computing + am_cv_exeext. Report from Markus F.X.J. Oberhumer. + +Wed Mar 25 15:09:56 1998 Tom Tromey + + * automake.in (handle_options): Support alpha version numbers. + + * lisp.am (install-@DIR@LISP): Allow .el files to appear in build + directory. From Gary V Vaughan. + +Mon Mar 23 07:55:04 1998 Tom Tromey + + * Released 1.2h. + + * header.am (install-@DIR@HEADERS): A header can appear in the + build directory as well as the source directory. From Gary V + Vaughan. + + * automake.in (handle_yacc_lex_cxx): Push lib sources onto + de_ansi_files before generating ._c dependencies. Test + libobj8.test. + + * m4/mktime.m4: New version from Jim Meyering. + + * aclocal.in (usage): Document --print-ac-dir. + (parse_arguments): Added --print-ac-dir. + + * ansi2knr.c, ansi2knr.1: New versions from ghostscript. + (main): Reapplied "-" change from Harlan Stenn. + +Fri Mar 20 22:42:30 1998 Tom Tromey + + * automake.in (scan_one_configure_file): Use &am_conf_line_error, + not warn. Check to make sure warnings happen only for + configure.in, not for "not aclocal.m4". + +Fri Mar 20 22:35:31 1998 Alexandre Oliva + + * automake.in: understand AM_PROG_LEX as a replacement for + AC_PROG_LEX and AC_DECL_YYTEXT + warn if the replaced macros are used. + * m4/Makefile.am: add lex.m4 + * m4/lex.m4 (AM_PROG_LEX): new file and macro + * missing: added lex/flex support + instead of touching flex and bison output files, try to copy + them from a filename based on the last given argument + +Fri Mar 20 00:26:10 1998 Tom Tromey + + * m4/protos.m4: Require AC_PROG_CPP. + + * aclocal.in (add_file): If &search fails, and macro matches AM_, + then print error. Test aclocalii.test. + + De-ansi-fication fixes from Harlan Stenn: + * ansi2knr.c (main): Accept "-" argument to mean stdin. + * automake.in (handle_yacc_lex_cxx): Preprocess C source before + running through ANSI2KNR. + (get_object_extension): Generate rule for /ansi2knr.o. + + * texinfos.am: Include $(DESTDIR). + * lisp.am: Include $(DESTDIR). + * java.am: Include $(DESTDIR). + * mans.am (install-man@SECTION@): Include $(DESTDIR). + * automake.in (handle_man_pages): Include $(DESTDIR) in + installdirs variable. + (handle_texinfo): Likewise. + (am_install_var): Likewise. + * header-vars.am (DISTDIR): Define. + * data.am, header.am, libs.am, ltlib.am, progs.am, scripts.am: + Support $(DESTDIR) at install time. From Assar Westerlund. + + * automake.in (handle_java): Put Java sources in distribution. + +Thu Mar 19 01:33:35 1998 Tom Tromey + + * automake.in (handle_java): Put JAVACFLAGS after -d option. From + Per Bothner. + + * automake.in (handle_java): Use $(JAVAROOT) in place of `../..' + in default CLASSPATH. + (am_install_var): Allow `JAVA' variable to be defined. Don't + define `JAVA' primary. + + * automake.in (scan_one_configure_file): Check for `sinclude' and + turn into recursive call. + + * automake.in (initialize_per_input): Set $output_all. + (generate_makefile): Don't set $output_header or generate + `default' target. Print $output_all before $output_header. + (handle_merge_targets): Put `all' target into $output_all. + +Wed Mar 18 14:48:44 1998 Tom Tromey + + * automake.in (handle_configure): Put secondary dependencies from + multi-":" AC_OUTPUT entry into dependency list for file created by + config.status, not file created by automake. Test colon3.test. + (generate_makefile): Pass $output, not $makefile, to + handle_merge_targets. + + * Makefile.am (pkgdata_DATA): Added java.am, java-clean.am. + * java-clean.am: New file. + * java.am: New file. + * automake.in (generate_makefile): Call handle_java. + (handle_java): New sub. + (am_install_var): Only push primary variable on @all if not doing + Java. + +Sun Mar 8 15:43:09 1998 Tom Tromey + + * automake.in (handle_configure): When recognizing AC_OUTPUT ":" + syntax, make regexp less greedy. From Maciej W. Rozycki. Test + colon4.test. + +Fri Mar 6 21:20:53 1998 Tom Tromey + + * m4/exeext.m4 (AM_EXEEXT): Ignore am_c_test.o. From Bruno + Haible. + +Tue Feb 24 12:10:44 1998 Tom Tromey + + * Released 1.2f. + + * mans.am (install-man@SECTION@, uninstall-man@SECTION@): Quote + `$' in sed expression. + + * config.guess, config.sub, texinfo.tex: New versions from FSF. + + * Makefile.am (pkgdata_DATA): Added mans.am. + * automake.in (handle_man_pages): Rewrote for new man page + handling. + (initialize_global_constants): Removed install_man_format, + uninstall_man_format. + * mans.am: New file. + + * data.am, header.am, libs.am, lisp.am, ltlib.am, progs.am, + scripts.am, texinfos.am: Put `@' before NORMAL_UNINSTALL + invocation. + +Mon Feb 23 13:38:56 1998 Tom Tromey + + * automake.in (get_object_extension): Remove .c.lo rule from + libtool when dependencies turned on. + * libtool.am (.c.lo): Disable when dependency checking turned on. + + Dependency fixes from Alexandre Oliva: + * automake.in (handle_dependencies): Fixed quoting when + substituting @PFX@ and @EXT@. Don't look for the `.P' file. + * depend2.am (%.o): Use @PFX@ and @EXT@. + (%.lo): New rule. + + * texinfos.am (.txi.info, .txi.dvi, .txi): New rules. + * automake.in (handle_texinfo): Recognize .txi files. From Karl + Berry. + + * automake.in (handle_single_transform_list): $objpat now a + parameter. Set $objpat when suffix rule found. + + * aclocal.in (parse_arguments): Only put current year in --version + output. + * automake.in (parse_arguments): Only put current year in + --version output. + +Mon Feb 16 00:12:03 1998 Tom Tromey + + * automake.in (handle_aclocal_m4): When processing -I options, + directory is separate argument. Test aclocali.test. + +Fri Feb 13 14:35:39 1998 Ian Lance Taylor + + * automake.in (handle_texinfo): Correct condition for whether + texinfo.tex is required. [Test texinfo5.test] + +Fri Feb 13 00:28:53 1998 Tom Tromey + + * Released 1.2e. + + * Makefile.am: Removed bogus line. + +Thu Feb 12 22:27:05 1998 Tom Tromey + + * automake.in (get_object_extension): Conditionally include .c.o + rule from compile.am. + (handle_dependencies): Generate correct code when including new + depend2.am. + (file_contents_with_transform): Better error reporting. + * depend.am (MKDEP): Removed. + (.deps/.P): Removed. Don't include .deps/.P. + * compile.am (.c.o): Now conditional on dependencies not being + generated by compiles. + * depend2.am (%.o): New rule. + (.deps/%.P): Removed. + + * tags.am (TAGS): Uniquify list of files. From Harlan Stenn. + + * aclocal.in (scan_m4_files): Reverse-sort keys when constructing + `search' function. From Johan Danielsson. + +Tue Sep 16 14:13:15 1997 Paul D. Smith + + * automake.in: Create new option --generate-deps. This option has + automake generate a .dep_segment file containing just the + dependencies created from the .P list. This is needed to maintain + other makefiles that automake doesn't deal with (Makefile.DOS, + SMakefile, etc.) + * automake.texi (Invoking Automake): Document it. + +Thu Feb 12 19:45:16 1998 Tom Tromey + + * aclocal.in (scan_configure): Tightened regexp a bit. Test + whoami.test. From Johan Danielsson. + + Report from H.J. Lu. + * automake.in (output_yacc_build_rule): Don't write rule to create + `.h' file. + (handle_yacc_lex_cxx): Generate rule to build each .h file. + + * automake.in (handle_options): Set readme-alpha and check-news + for Gnits after main processing. Test alpha.test. From Jim + Meyering. + + * aclocal.in (usage): Updated bug-reporting address. + * automake.in (usage): Updated bug-reporting address. + + * compile.am: Remove *.core for 4.4BSD systems. From Assar + Westerlund. + + * automake.in (handle_single_transform_list): Don't set + seen_any_source if all sources are C++. + +Wed Feb 11 17:30:01 1998 Tom Tromey + + * aclocal.in (write_aclocal): Write to $output_file, not + aclocal.m4. From Alexandre Oliva. + +Thu Feb 5 13:38:55 1998 Tom Tromey + + * automake.in (scan_one_configure_file): Put CXCPP before CXX in + regexp. From Garth Corral. Test cxxxcpp.test. + +Sun Jan 25 11:16:53 1998 Tom Tromey + + * automake.in (generate_makefile): Run handle_minor_options before + handle_dist, to make sure README-alpha ends up in distribution. + From Jim Meyering. + +Tue Jan 13 09:19:33 1998 Tom Tromey + + * aclocal.in (add_file): Hack for Perl 4. From Seth Alves. + +Thu Dec 11 12:29:46 1997 Ian Lance Taylor + + * scripts.am: Don't add @EXEEXT@ to installed scripts. Scripts + are not executables. + +Tue Dec 2 20:07:18 1997 Tom Tromey + + * automake.in (initialize_global_constants): Bug fix in + uninstall_man_format. Report from Eric Backus. + +Mon Dec 1 13:52:39 1997 Tom Tromey + + * automake.in (handle_source_transform): Correctly generate + _OBJECTS when _SOURCES is defined conditionally. Reported by Rob + Savoye. Test cond3.test. + + Fixes for test objc.test: + * automake.in (initialize_per_input): New global seen_any_source. + (handle_yacc_lex_cxx): Use seen_any_source to decide when to + define LINK, et al. + (handle_single_transform_list): Set seen_any_source. + (handle_lib_objects_cond): Likewise. + +Wed Nov 26 13:41:57 1997 Tom Tromey + + * Released 1.2d. + + * m4/ccstdc.m4: Don't force AM_PROG_CC_STDC before AC_PROG_CPP. + Temporary hack. + + * m4/mktime.m4 (AM_FUNC_MTIME): New version from Paul Eggert. + + * header-vars.am (NORMAL_INSTALL, PRE_INSTALL, POST_INSTALL, + NORMAL_UNINSTALL, PRE_UNINSTALL, POST_UNINSTALL): Define as `:', + not `true'. + + * automake.in (output_yacc_build_rule): Don't overwrite .h file in + non-ylwrap case. + + * tags.am (ID): Scan lisp files. + (TAGS): Make tags for lisp files. + +Tue Nov 25 14:20:42 1997 Tom Tromey + + * ltlib.am: Use INSTALL_DATA, not INSTALL_PROGRAM. From Gord + Matzigkeit. + +Fri Nov 21 15:15:50 1997 Tom Tromey + + * m4/mingw.m4, m4/cygwin.m4: Argument to AC_TRY_COMPILE is + function body, not entire function. From Ian Taylor. + +Sat Oct 25 12:39:19 1997 Tom Tromey + + * automake.in (scan_one_configure_file): Skip empty string for + Perl 4. From Assar Westerlund. + + * config.guess, config.sub, texinfo.tex: New versions from FSF. + +Fri Oct 24 23:15:09 1997 Tom Tromey + + * automake.in (output_yacc_build_rule): Use YFLAGS again. + (handle_yacc_lex_cxx): Error if YACCFLAGS used. + +Wed Aug 27 19:26:45 1997 Rob Savoye + + * compile.am: Add suffix rules for ".s.o" and ".S.o" so assembler + files can be used. + * libtool.am: Add suffix rules for ".s.lo" and ".S.lo" so assembler + files can be used. + * automake.in: Add .S and .s to the standard list of suffixes so + assembler files can be used. + +Fri Oct 24 13:39:01 1997 Tom Tromey + + * m4/exeext.m4: Require AM_MINGW32. Check MINGW32 setting. + +Thu Oct 23 21:16:28 1997 Tom Tromey + + * m4/init.m4 (missing_dir): AC_REQUIRE AM_SANITY_CHECK, + AC_ARG_PROGRAM, and AC_PROG_MAKE_SET. + +Tue Oct 21 16:49:36 1997 Tom Tromey + + * automake.in (handle_options): Recognize `cygnus'. + +Tue Sep 9 17:09:47 1997 Rob Savoye + + * m4/mingw.m4: New file for mingw32 support. + * m4/exeext.m4: Also check for the mingw32 environment. + +Tue Oct 21 00:39:44 1997 Tom Tromey + + * m4/Makefile.am (m4data_DATA): Added mingw.m4. + + * automake.in (handle_lib_objects_cond): Don't require @LEXLIB@. + (handle_programs): Likewise. + + * subdirs.am (check-recursive installcheck-recursive + info-recursive dvi-recursive): Handle case when SUBDIRS is empty. + (maintainer-clean-recursive): Likewise. From Assar Westerlund. + + * aclocal.in (scan_m4_files): If macro recognized, &search will + return 1. + (scan_configure): If AM_ macro not found, give error. + + * m4/sanity.m4: If `ls' completely fails, die. From Jim + Meyering. + +Mon Oct 20 16:13:48 1997 Tom Tromey + + * automake.in (handle_single_transform_list): Fixlet for Fortran. + From Bernard Urban. + + * libtool.am: Remove _libs, for libtool 1.0d. From Gord + Matzigkeit. + +Sun Oct 19 22:59:35 1997 Tom Tromey + + * texinfos.am: Bug fix. From John W. Coomes. + +Mon Sep 29 12:57:00 1997 Tom Tromey + + * Released 1.2c. + + * automake.in (handle_dist_worker): In topmost directory of + project, use `distdir', not `top_distdir', as argument to + --output-dir; likewise when building in subdirs. + +Sun Sep 28 15:55:46 1997 Tom Tromey + + * m4/sanity.m4: Test $*, not $@. From Akim Demaille. + + * automake.in (handle_minor_options): New sub. + (check_gnits_standards): Don't handle README-alpha here. + (handle_dist_worker): Check NEWS file if `check-news' option + requested. + (generate_makefile): Run handle_minor_options. + (handle_options): Handle readme-alpha and check-news. Set them if + --gnits. + + * depend.am (MKDEP): Use $(CC), not gcc. + +Wed Sep 24 23:48:26 1997 Tom Tromey + + * Release 1.2b. + + * m4/ccstdc.m4 (AM_PROG_CC_STDC): Make sure this is run before + AC_PROG_CPP. From Markus Oberhumer. + +Fri Sep 12 00:04:19 1997 Paul Eggert + + * m4/ccstdc.m4 (AM_PROG_CC_STDC): Don't look at __STDC__; + look only at whether function prototypes are supported. + +Wed Sep 24 16:10:37 1997 Tom Tromey + + * Various: Put "-" before each `rm' line. This avoids a bug in + some losing makes (Ultrix, 4.3 BSD). + + * automake.in (handle_dist_worker): Correctly handle subdirs that + have their own configure.in. From Peter Mattis. + + * automake.in (handle_yacc_lex_cxx): Handle de-ansi-fied sources + in srcdir as well as build dir. + + * automake.in (scan_one_configure_file): Detect AC_OUTPUT(). + (handle_single_transform_list): Don't apply length() to a list. + + * automake.in (handle_programs): Define _DEPENDENCIES variable if + not defined by user. + +Thu Sep 18 19:43:38 1997 Tom Tromey + + * m4/sanity.m4: Quote "$@" for m4. From Gord Matzigkeit. + +Mon Sep 1 23:50:38 1997 Tom Tromey + + * automake.in (handle_texinfo): Set need_texi_file only when + TEXINFO_TEX not defined. + +Thu Aug 28 09:37:29 1997 Tom Tromey + + From Juergen Erhard: + * automake.in (SUFFIX_RULE_PATTERN): New global. + (handle_single_transform_list): If suffix matches a source suffix, + rewrite. + (read_am_file): Add suffix rules to %suffix_rules. + (initialize_per_input): Initialize %suffix_rules. + +Wed Aug 27 12:56:50 1997 Tom Tromey + + * automake.in (handle_texinfo): Also remove .kys and .ps files. + + * automake.in (handle_yacc_lex_cxx): Quoting fixlet. From Kaveh + Ghazi. + + * aclocal.in (write_aclocal): Print copyright and copying + permissions. From RMS. + * automake.in (initialize_global_constants): More copyright stuff + from RMS. + + * automake.in (handle_texinfo): Only require texinfo.tex in + appropriate situations. Report from Paul D. Smith. + +Mon Aug 25 15:45:52 1997 Tom Tromey + + * automake.in (scan_dependency_file): Fix so that + OMIT_DEPENDENCIES will work. From Alexander Lukyanov. + + * automake.in (handle_texinfo): texi2dvi can generate `.cn' + files. From Akim Demaille. + +Wed Aug 6 10:51:37 1997 Tom Tromey + + * automake.in (handle_texinfo): Reversed sense of test. + +Tue Aug 5 17:49:54 1997 Tom Tromey + + * automake.in (handle_dependencies): Always mark OMIT_DEPENDENCIES + as seen. + + * automake.in (handle_yacc_lex_cxx): Make each _.c file depend on + ansi2knr. + + * automake.in (handle_yacc_lex_cxx): Fix for makes which don't + allow $< in non-suffix rules. From Akim Demaille. + + * automake.in (value_to_list): If variable name contains configure + substitution, then just ignore it. + + * automake.in (variable_defined): Mark variable is seen, even if + only conditionally seen. + + * Makefile.am: Check for bad splits. + * automake.in (various): Use split(' ',...), not split(/ /,...). + +Tue Aug 5 14:08:51 1997 Ian Lance Taylor + + * ylwrap: If the program is a relative path, force it to be + absolute. + +Tue Aug 5 16:59:41 1997 Tom Tromey + + * missing: Examine A[CM]_CONFIG_HEADER for name of files to + touch. From Markus F.X.J. Oberhumer. + + * automake.in (require_file_internal): Better error message when + installing. + + * automake.in (handle_texinfo): Smarter test when deleting output + of makeinfo. + +Sat Aug 2 13:32:45 1997 Tom Tromey + + * automake.in (do_check_merge_target): In --cygnus mode, check + doesn't depend on all. + + * automake.in (output_yacc_build_rule): Use YACCFLAGS, not + YFLAGS. Per GNU Standards. + + * dejagnu.am (RUNTESTDEFAULTFLAGS): New macro. + (check-DEJAGNU): Use it. + + * subdirs.am (maintainer-clean-recursive): Actually reverse subdir + list. From Alexander Lukyanov. + + * automake.in (initialize_global_constants): Changed generated + copyright. From RMS. + + * automake.in (handle_configure): Pass correct value for + CONFIG_FILES. From Ian Taylor. + +Thu Jul 31 17:36:10 1997 Ian Lance Taylor + + * ylwrap (pairlist): Shift out trailing "--"; don't pass it to + $prog. + +Thu Jul 24 00:52:02 1997 Tom Tromey + + * automake.in (initialize_global_constants): Changed index names + in dist hash so that alternate dist targets will be generated. + Report from Glenn Amerine. + + Suggestion from Karl Berry: + * automake.in (usage): Added short info line. + + * aclocal.in (usage): Updated bug-reporting address. Added short + info line. + + * automake.in (handle_emacs_lisp): Put contents of lisp-clean.am + into output. Report from Karl Berry. + +Mon Aug 25 16:14:32 1997 Tom Tromey + + * automake.in (handle_configure): Only generate ":" syntax for + CONFIG_FILES when really needed. + +Wed Aug 6 14:47:12 1997 Ian Lance Taylor + + * remake-hdr.am (@CONFIG_HEADER@): Use a dummy command to force + GNU make to recheck the file modification time. + +Tue Aug 5 14:44:10 1997 Ian Lance Taylor + + * ylwrap: If the program is a relative path, force it to be + absolute. + +Mon Aug 4 14:52:08 1997 Ian Lance Taylor + + * automake.in ($RULE_PATTERN): Accept $ in body of rule name. + (handle_programs): Don't append $(EXEEXT) if the + program name contains '.'. + (am_install_var): When rewriting _PROGRAMS, don't append $(EXEEXT) + if the program names contains '.'. Also, handle conditionals. + +Sat Aug 2 14:43:41 1997 Tom Tromey + + * m4/exeext.m4: Fixed quoting. + + * m4/exeext.m4 (am_cv_exeext): Use echo, not ls. + + * automake.in (handle_programs): Transform @EXEEXT@ when including + program.am. + +Fri Aug 1 17:09:09 1997 Tom Tromey + + * automake.in (handle_programs): Don't transform CYGWIN or + NOTCYGWIN. + (am_install_var): Likewise. + + * progs-clean.am (clean-@DIR@PROGRAMS): Never include EXEEXT. + + * progs.am: Removed @EXEEXT@; it is now implicit. + * program.am: Add @EXEEXT@ in appropriate places; removed + cygwin-dependent code. + * automake.in (seen_exeext): Renamed from seen_cygwin32. + (handle_programs): Use seen_exeext. + (scan_one_configure_file): Look for AM_EXEEXT, not AM_CYGWIN32. + (check_cygnus): Use seen_exeext. + (am_install_var): Likewise. + (am_install_var): When handling PROGRAMS primary, append EXELIST + to program names as necessary. + * m4/exeext.m4: Require AM_CYGWIN32. + +Thu Jul 31 17:36:10 1997 Ian Lance Taylor + + * ylwrap (pairlist): Shift out trailing "--"; don't pass it to + $prog. + + * texinfos.am: Add -I $(srcdir) when invoking $(MAKEINFO) for + CYGNUS .texinfo.info case and .texinfo case. + + * automake.in (handle_configure): Correct handling of inputs for + for AC_OUTPUT files when invoking config.status. + +Mon Jul 28 15:29:25 1997 Rob Savoye + + * m4/cygwin.m4: Set a variable CYGWIN32, rather than EXEEXT. + * m4/exeext.m4: New autoconf test for an executable suffix. + * m4/Makefile.in: Install the new exeext.m4 test. + +Sun Jun 22 14:01:59 1997 Tom Tromey + + * Released version 1.2. + + * automake.in (handle_texinfo): Look for texinfo.tex in aux dir. + + * automake.in (require_file_internal): Only print "installing" + when actually installing. From Gord Matzigkeit. + + * automake.in (handle_tests): Exit status `77' means `ignore + test'. From François Pinard. + (handle_tests) Also, make banner same size as text. + + * automake.in (handle_configure): Don't handle PRE_BUILT_SOURCES. + (handle_built_sources): Likewise; don't have `all' depend on + BUILT_SOURCES. + + * depend.am (DEPS_MAGIC): New variable. + (.deps/.P): Depend on BUILT_SOURCES again. + + * texinfos.am: Use ||, not ;. + +Tue Jun 10 11:04:16 1997 Tom Tromey + + * m4/cygwin.m4: Examine output of compiler to see if .exe needed. + +Sun Jun 1 13:16:05 1997 Tom Tromey + + * automake.in (handle_built_sources): Handle PRE_BUILT_SOURCES. + (handle_configure): Likewise. + + * depend2.am (.deps/%.P): Don't generate file if MKDEP fails. + From Alexandre Oliva. + + * depend.am (.deps/.P): Depend on PRE_BUILT_SOURCES, not + BUILT_SOURCES. + + * automake.in (initialize_global_constants): Added 1997 to + copyright info. + + * automake.in (output_yacc_build_rule): Never move y.tab.c over + the .h file. From Jim Meyering. + +Thu May 29 23:16:02 1997 Tom Tromey + + * automake.in (scan_one_configure_file): Avoid defining ACLOCAL, + AUTOCONF, AUTOMAKE, AUTOHEADER. From David Zaroski. + +Sat Feb 22 16:05:24 1997 Gordon Matzigkeit + + * Makefile.am (pkgdata_DATA): Under this new scheme, we no longer + need compile-kr.am. Delete it. + + * automake.in (handle_yacc_lex_cxx, get_object_extension): Use + _.c, _.o, _.lo instead of ._c, ._o, .l_o for de-ansification. + + * ansi2knr.c (main): Parse our arguments a little differently so + that we don't create null output files when we can't read the + input file. + +Wed May 28 23:40:33 1997 Tom Tromey + + * depend.am (.deps/.P): Depend on $(BUILT_SOURCES) again. From + Gord Matzigkeit. + +Mon May 26 22:50:49 1997 Tom Tromey + + * remake-hdr.am ($(srcdir)/@STAMP@.in): Make echo silent. Report + from Alexandre Oliva. + + * automake.in (generate_makefile): If --no-force, check + Makefile.in against configure.in and aclocal.m4. Report from + Alexandre Oliva. + + * automake.in (handle_dist_worker): Put --include-deps on command + line if specified originally. + (handle_configure): Likewise. + + * configure.in: Error if Perl 5.001 is used. + + * ylwrap: Don't quote $prog when executing it. From Jim + Meyering. + +Thu May 15 12:05:20 1997 Tom Tromey + + * automake.in (handle_merge_targets): Set INSTALL_SCRIPT in + install-strip target. + +Tue May 13 08:20:02 1997 Tom Tromey + + * automake.in (handle_dependencies): Don't generate dependencies + if DEP_FILES would be empty. + +Sun May 11 13:59:14 1997 Tom Tromey + + * config.guess: New version from FSF. + + * automake.in (get_object_extension): If ansi2knr in another + directory, always define ANSI2KNR to full path. From Akim + Demaille. + + * kr-extra.am (clean-krextra): Remove ansi2knr here, not in + distclean-krextra. + + * missing: Regularized grammar. From François Pinard. + +Sat May 10 16:48:47 1997 Tom Tromey + + * Released 1.1p. + + * m4/init.m4: Error if source directory already configured. + + * automake.in (scan_dependency_file): Always use srcdir name as + passed in on command line. + +Thu May 1 12:53:46 1997 Ian Lance Taylor + + * automake.in (value_to_list): Don't fail when a variable + substitution is not a complete word. + +Tue May 6 15:22:41 1997 Ian Lance Taylor + + * subdirs.am: Fix check for make -k to use $(MAKEFLAGS) and to not + get fooled by command line arguments. + +Sat May 10 15:48:46 1997 Tom Tromey + + * m4/ccstdc.m4: Print "none needed" if compiler accepts ANSI C by + default. + +Mon May 5 23:24:09 1997 Tom Tromey + + * mkinstalldirs, config.guess, config.sub, COPYING, texinfo.tex: + New versions from FSF. + +Sun May 4 15:21:22 1997 Tom Tromey + + * texinfos.am (install-info): Avoid the Debian install-info. + (uninstall-info): Likewise. + + * automake.in (handle_single_transform_list): Strip any directory + name before processing name. + +Thu May 1 19:24:08 1997 Tom Tromey + + * depend2.am (.deps/%.P): Don't put $(srcdir)/ into dependency. + +Wed Apr 30 19:15:47 1997 Tom Tromey + + * automake.in (handle_dist_worker): Change how top_distdir is + computed. Based on patch from Ian Taylor. + (handle_dist): Define top_distdir. + + * automake.in (handle_yacc_lex_cxx): Include CXXFLAGS in CXXLINK. + (handle_yacc_lex_cxx): Include CFLAGS in LINK. + +Wed Apr 30 14:46:37 1997 Ian Lance Taylor + + * automake.in (handle_dist_worker): When building a distribution, + if SUBDIRS is defined conditionaly, recur into each possible + subdirectory. + + * clean.am (distclean-generic): Remove stamp-h[0-9]*. + +Tue Apr 29 19:11:45 1997 Tom Tromey + + * INSTALL, mkinstalldirs, install-sh: Update from François + Pinard. + + * aclocal.in (add_macro): If AC_ macro was defined, then mark it + as seen. Report from Janos Farkas. + + * subdirs.am: Clean targets now run in reverse order. From Kevin + Dalley. + + * automake.in (handle_texinfo): Put `aminfo', not `info' on + @clean. + + * mdate-sh: New version from Ulrich Drepper. + +Mon Apr 28 01:18:05 1997 Tom Tromey + + * automake.in (handle_configure): Makefile only depends on + BUILT_SOURCES when generating dependencies. + + * Released 1.1o. + +Sun Apr 27 23:58:20 1997 Tom Tromey + + * automake.in (handle_dist): Use variable_value, not + variable_contents. + +Wed Apr 23 14:04:28 1997 Ian Lance Taylor + + * automake.in (IF_PATTERN): Define. + (ELSE_PATTERN, ENDIF_PATTERN): Define. + (AM_CONDITIONAL_PATTERN): Define. + (%configure_cond): New global hash table. + (handle_source_transform): If xx_SOURCES is defined conditionally, + define xx_OBJECTS using the same conditions. + (handle_lib_objects): If variable is defined conditionally, define + xx_DEPENDENCIES conditionally. Most code moved into subroutine. + (handle_lib_objects_cond): New function, broken out of + handle_lib_objects. + (scan_one_configure_file): Look for $AM_CONDITIONAL_PATTERN. + (conditional_true_when): New function. + (variable_defined): Add new parameter: cond. Change some + callers. + (variable_conditions): New function. + (variable_conditionally_defined): New function. + (variable_value): New function. Change most uses of $contents to + call variable_value instead. + (value_to_list): New function, from variable_value_as_list. + (variable_value_as_list): Add new parameter: cond. Change all + callers. Move some code into subroutine value_to_list. + (define_pretty_variable): Add new parameter: cond. Change call + callers. + (read_am_file): Handle conditionals. + (initialize_per_input): Initialize %conditional and + @conditional_stack. + * m4/cond.m4: New file. + * m4/Makefile.am (m4data_DATA): Add cond.m4. + +Sun Apr 27 11:03:36 1997 Tom Tromey + + * automake.in (handle_dist_worker): Run automake once per + directory, instead of once at the top. + (handle_dist_worker): Changed interface. + (handle_dist): Likewise. + (generate_makefile): Better error message if can't write the + file. + (handle_dist_worker): Pass top_distdir to subdir makes. + + * automake.in (handle_dist_worker): Use mode 777 on directories in + distribution. GNU Standards compliance. + + * automake.in (handle_yacc_lex_cxx): Don't use interlock. + (output_yacc_build_rule): Don't use interlock; just use new ylwrap + instead. The new ylwrap builds in a subdir; idea from Mark + Eichin. + (output_lex_build_rule): Likewise. + (initialize_global_constants): [common_files] Don't include + interlock. + + * Makefile.am (pkgdata_SCRIPTS): Removed interlock. + * interlock: Removed. + * ylwrap: Changed interface. Now runs command in subdir. + + * remake.am (config.status): Look in srcdir for config header. + ($(srcdir)/configure): Likewise. + * remake-hdr.am (@STAMP@): Look in srcdir for config header. From + Phil Nelson. + ($(srcdir)/@CONFIG_HEADER_IN@): Likewise. + + * automake.in (handle_aclocal_m4): Make target $(ACLOCAL_M4), not + value spelled out. From Phil Nelson + + * automake.in (handle_configure): Don't skip Makefiles; instead + skip automake inputs. + (handle_merge_targets): Changed interface; put $makefile at + beginning of @all (rather than Makefile at end). + + * automake.in (handle_yacc_lex_cxx): Correctly compute + de_ansi_sources. + + * clean-kr.am (distclean-kr): Do nothing; ansi2knr is removed in + kr-extra.am. + + * Makefile.am: Check to make sure there are no accidental + configure substitutions. + + * automake.in (handle_texinfo): Don't allow configure substitution + on @MAKEINFO@ here. + + * automake.in (handle_yacc_lex_cxx): ._c and ._o files both depend + on $(ANSI2KNR). + + * kr-extra.am (ansi2knr): Removed. + (ansi2knr.o): Likewise. + + * automake.in (get_object_extension): Allow ansi2knr to be built + from any directory. + +Fri Apr 25 12:33:23 1997 Tom Tromey + + * missing: Changed bison text. From Ian Taylor. + + * m4/missing.m4: Redirect stdin of testee. From Bill Fenner. + + * automake.in (output_yacc_build_rule): Generate rule to create .h + file. + (handle_footer): Generate unique, sorted list of suffixes. + + * automake.in (scan_one_configure_file): Recognize AC_PROG_AWK, + _CPP, _CXCPP, _LN_S. From Ralph Schleicher. + +Mon Apr 21 12:35:57 1997 Ian Lance Taylor + + * automake.in (@config_fullnames): New array. + (@config_names): New array, replacing $config_name. + (@config_headers): New array, replacing $config_header. + (get_object_extension): Handle multiple header files. + (handle_tags, handle_merge_targets): Likewise. + (scan_one_configure_file): Likewise. + (handle_configure): Likewise. Don't check for the configuration + header file in AC_OUTPUT; it won't be there. + * remake-hdr.am: Handle multiple header files. + * clean-hdr.am: New file, broken out of remake-hdr.am. + * m4/header.m4: Handle multiple header files. + * Makefile.am (pkgdata_DATA): Add clean-hdr.am. + +Wed Apr 16 00:05:47 1997 Tom Tromey + + * texinfos.am (.texi.info, .texi, .texinfo.info, .info): Remove + + * automake.in (define_program_variable): Added `override' argument. + (handle_texinfo): Pass override arg when defining MAKEINFO. + (AC_MISSING_PROG): New constant. + (scan_one_configure_file): Use it. + +Tue Apr 15 12:12:28 1997 Tom Tromey + + * automake.in (handle_texinfo): In --cygnus mode, reserve + clean-info for the user. + + * automake.in (handle_subdirs): Typo fix. From Akim Demaille. + + * automake.in (handle_tags): Only use SUBDIRS if it is actually + defined. Report from Ian Taylor. + + * tags.am: Added prefix to SUBDIRS rules. + +Wed Apr 9 17:09:40 1997 Tom Tromey + + * automake.in (handle_ltlibraries): Use correct rpath + substitution. Bug from Jim Blandy. + +Mon Apr 7 17:40:18 1997 Tom Tromey + + * automake.in (AM_INIT_AUTOMAKE_PATTERN): Fixed for new 3rd arg. + Test version2.test. + +Thu Apr 3 19:07:59 1997 Tom Tromey + + * Released 1.1n. + + * tags.am (TAGS): Run "cd && etags" in subshell for proper + associativity. + + * texinfos.am (install-info-am): If --cygnus, then info file can + be in build dir. From David Zaroski. + + * ltlibrary.am (@LTLIBRARY@): use @RPATH@, not explicit -rpath. + + * automake.in (handle_ltlibraries): Treat EXTRA_ libraries + specially. + +Wed Apr 2 00:03:50 1997 Tom Tromey + + * automake.in (handle_source_transform): Don't generate dependency + on config.h. + (scan_dependency_file): Strip the .P file from the target. + + * automake.in (handle_tags): Use single, not double, quotes when + setting list variable. + + * data.am, header.am, libs.am, lisp.am, ltlib.am, progs-clean.am, + progs.am, scripts.am, tags.am: Use single quotes to fill list + variable; otherwise `$' in filename will not work. From Per + Bothner. + + * mdate-sh: Use "ls -d" so mdate-sh can be run on a directory. + From Bruno Haible. + + * automake.in (handle_programs): Error if LIBADD used where LDADD + meant. + (handle_libraries): Error if LDADD used where LIBADD meant. + (handle_ltlibraries): Likewise. + +Tue Apr 1 22:46:33 1997 Tom Tromey + + * automake.in (check_canonical_spelling): New sub. + (handle_programs): Use it. + (handle_libraries): Likewise. + (handle_ltlibraries): Likewise. + +Mon Mar 31 12:13:08 1997 Tom Tromey + + * depend2.am (.deps/%.P): Make .P file depend on everything the .c + file includes. + +Fri Mar 28 23:34:49 1997 Tom Tromey + + * automake.in (handle_configure): Error if stamp-h appears in + AC_OUTPUT line. + +Thu Mar 27 17:28:47 1997 Tom Tromey + + * automake.in (handle_dist_worker): Avoid automake rules in + generated Makefile when no-dependencies specified. From Greg + Woods. + + * m4/lispdir.m4: Don't AC_SUBST ELCFILES. From Greg Woods. + + * texi-vers.am (stamp-@VTI@): Make commands silent. + + * Makefile.am (maintainer-check): "true" is ok now. + + * m4/init.m4: Added optional 3rd argument, which avoids + AC_DEFINE. + + * automake.in (scan_one_configure_file): Explicitly avoid + INSTALL_SCRIPT to avoid defining it twice. + + * header-vars.am: Change _INSTALL variable definitions to `true'. + Updated all users to put `@' before invocation. + +Tue Mar 25 22:09:45 1997 Tom Tromey + + Update to follow GNU Standards: + * automake.in (handle_man_pages): Use NORMAL_UNINSTALL before + uninstall-man. + * texinfos.am (uninstall-info): Use two loops, and have + PRE_UNINSTALL before running install-info. + * data.am, header.am, libs.am, lisp.am, ltlib.am, progs.am, + scripts.am, texinfos.am: Use NORMAL_UNINSTALL. + * header-vars.am (PRE_UNINSTALL, POST_UNINSTALL, + NORMAL_UNINSTALL): Define. + + * automake.in (scan_one_configure_file): Don't define ANSI2KNR as + a configure varriable. + + * m4/missing.m4: Run test in a subshell. From Gord Matzigkeit. + +Mon Mar 24 23:28:59 1997 Tom Tromey + + * m4/sanity.m4: Sleep before creating temp file. + + * header-vars.am (NORMAL_INSTALL, PRE_INSTALL, POST_INSTALL): + Define. + +Sat Mar 22 00:06:00 1997 Tom Tromey + + * automake.in (am_install_var): Make sure to delete + CYGWIN/NOTCYGWIN tokens as appropriate. + (handle_programs): Remove NOTCYGWIN tokens as well. + (file_contents_with_transform): A single newline makes an empty + line. + + * program.am: Remove executable before linking. + + * texinfos.am (.texi.dvi): Look in @TEXINFODIR@ for texinfo.tex. + (.texinfo.dvi): Likewise. + + * automake.in (handle_texinfo): TEXINFO_TEX variable can set + location of texinfo.tex. + +Fri Mar 21 10:22:51 1997 Tom Tromey + + * texinfos.am (.texinfo.dvi): Mirror .texi.dvi. + + * ansi2knr.c, ansi2knr.1: New versions from L. Peter Deutsch. + + * scripts.am: Add @EXEEXT@ to installed scripts. + +Wed Jan 22 20:12:31 1997 Jim Meyering + + * m4/mktime.m4 (AM_FUNC_MKTIME): Run tests for each of a few values + for the TZ environment variable. Andre Novaes Cunha provided the + hairy TZ setting that exercized the Solaris tzset bug. + +1997-01-22 Paul Eggert + + * m4/mktime.m4: (AM_FUNC_MKTIME): Fix bug in mktime test -- don't + test now, test a couple of thousand times. + +Thu Mar 20 00:16:54 1997 Tom Tromey + + * automake.in (handle_programs): Remove CYGWIN lines unless + AM_CYGWIN32 seen. + (am_install_var): Remove CYGWIN lines from -clean file as well. + + * progs.am: Put @EXEEXT@ where appropriate. + + * program.am (@PROGRAM@): If using Cygwin32, then create actual + name in addition to ".exe" name. + + * progs-clean.am (clean-@DIR@PROGRAMS): Conditionalize on CYGWIN. + + * automake.in (check_cygnus): Require AM_CYGWIN32 in --cygnus mode. + (am_install_var): If AM_CYGWIN32 not seen, then remove @EXEEXT@ + from .am files. + + * automake.in (seen_cygwin32): New global. + (scan_one_configure_file): Check for AM_CYGWIN32. + + * m4/cygwin.m4: New file. + + * automake.in (scan_one_configure_file): Explicitly handle + AC_CONFIG_HEADER so we can avoid spurious warnings. + (obsolete_macros): Removed AC_CONFIG_HEADER. + + * automake.in (handle_yacc_lex_cxx): Perl 4 fixes. From Greg + A. Woods. + +Wed Mar 19 00:35:13 1997 Tom Tromey + + * Released 1.1m. + + * m4/missing.m4: Print message saying what is happening. + + * m4/sanity.m4: sleep before testing. + +Tue Mar 18 17:20:03 1997 Tom Tromey + + * config.guess, config.sub: New from the FSF. + + * automake.in (initialize_global_constants): [common_files] + Include `missing'. + (scan_configure): Require `missing'. + + * header-vars.am (MAKEINFO): Don't define. + + * m4/init.m4 (missing_dir): Use AM_MISSING_PROG. + * m4/missing.m4: New file. + + `missing' changes from François Pinard: + * Everywhere: Use ACLOCAL_M4 to name aclocal.m4 file; ACLOCAL now + names aclocal program. + * m4/init.m4: Replace programs with `missing' if not found. + * automake.in (handle_texinfo): Define MAKEINFO as @MAKEINFO@. + (AC_CHECK_PATTERN): Check for alphanumeric names only. + (handle_aclocal_m4): Use ACLOCAL, not aclocal. + * Makefile.am (pkgdata_SCRIPTS): Include missing. + * missing: New file. + + * automake.in (target_defined): New sub. + (handle_footer): Error if target .SUFFIXES used. + +Sun Mar 16 14:33:41 1997 Tom Tromey + + * automake.in (handle_lib_objects): Set seen_c_source to line + number. + (handle_yacc_lex_cxx): Use seen_c_source as line number. + (am_line_error): Line of -1 means skip line-number check. + + * automake.in (read_am_file): Change to keep perl -w quiet. + (check_typos): Removed extra check of EXTRA_ containing config + subs. + +Mon Mar 10 23:17:19 1997 Tom Tromey + + * remake-hdr.am (stamp-h): Set CONFIG_HEADERS to + $(CONFIG_HEADER_FULL). + * automake.in (handle_configure): Define CONFIG_HEADER_FULL. + + * automake.in (handle_lib_objects): Set seen_c_source as + appropriate. From Alexander V. Lukyanov. Test cxxlibobj.test. + +Sat Mar 8 22:54:35 1997 Tom Tromey + + * texinfo.tex: New version. + + * automake.in (handle_emacs_lisp): If EMACS is `no', then we + couldn't find an Emacs. So don't bother running elisp-comp. From + Ulrich Drepper. + + * automake.in (handle_texinfo): Added .tr and .cv to list of + texinfo clean extensions. From Karl Berry. + +Fri Feb 28 22:14:53 1997 Tom Tromey + + * Makefile.am: Make sure we never use "undef". + + * automake.in (usage): Changed bug-reporting address. + (handle_dist): Use undef, not delete. + +Wed Feb 26 08:41:11 1997 Gordon Matzigkeit + + * automake.in (%obsolete_macros): Reintroduce, with hints for what + to do to upgrade the support. + + * automake.in, ltlib-clean.am, ltlib.am, ltlibrary.am: Revamped + libtool support to use the _LTLIBRARIES primary. + +Wed Feb 26 00:20:39 1997 Tom Tromey + + * automake.in (handle_tags): In default case, add @tags_deps to + dependencies of tags target. + +Tue Feb 25 23:46:29 1997 Tom Tromey + + * automake.in (handle_tests): If a test failed, then make should + fail. From Jim Meyering. + +Mon Feb 24 19:02:21 1997 Tom Tromey + + * texi-vers.am (@VTEXI@): Copy stamp file into output. + +Sun Feb 23 00:10:36 1997 Tom Tromey + + * automake.in (handle_programs): Give correct error line for lex + error. + (am_line_error): Avoid uninitialized value errors from perl -w. + + * aclocal.in (scan_m4_files): Fixed perl -w warning. + + * texinfos.am (.texi, .texinfo): New targets. + + * automake.in (scan_texinfo_file): Renamed. + (handle_texinfo): Handle files without ".info" extension. + + * automake.in (handle_subdirs): Error if directory contains "/". + (handle_yacc_lex_cxx): Quoting fix. + (handle_single_transform_list): Use transformed (non-ansi) version + of $obj instead of explicit ".o". From Gord Matzigkeit. + + * m4/sanity.m4: Pass -L to ls if possible. + +Sat Feb 22 15:22:31 1997 Tom Tromey + + * dist-vars.am (DISTFILES): Don't distribute MANS. + + * automake.in (handle_dist): Use define_variable to define TAR, + GZIP. + (handle_dist): Pass GZIP in environment to tar. + (initialize_global_constants): Likewise. + + From Kaveh Ghazi: + * m4/protos.m4: Don't put any dependencies on AC_C_INLINE or + AC_C_CONST. + * m4/ccstdc.m4: Force AM_PROG_CC_STDC to come before AC_C_INLINE + or AC_C_CONST. + +Fri Feb 21 00:39:17 1997 Tom Tromey + + From The Crimson Binome: + * automake.in (handle_yacc_lex_cxx): Handle C++ yacc/lex source. + (output_yacc_build_rule): New sub for C++ yacc/lex. + + * automake.in (my_glob): New sub. + (handle_dependencies): Use my_glob. + (handle_aclocal_m4): Scan ACLOCAL_AMFLAGS for dependencies. + + * ltlibs.am, lisp.am, libs.am, header.am, data.am, progs.am, + scripts.am, texinfos.am: Add leading space to echo. + + * automake.in (handle_texinfo): Added .tps and .vrs to list of TeX + endings. From Jim Blandy. + (install_man_format): Make rule silent; instead print actual + command. + +Tue Feb 4 18:29:42 1997 Tom Tromey + + * dist-vars.am (TAR): Removed. + * automake.in (TAR): New variable. + (handle_dist): Explicitly define TAR. + * configure.in: Compute TAR. + + * automake.in (handle_lib_objects): Put @ALLOCA@ on @dep_list, not + @dep_files. + (AC_SUBST_PATTERN): Typo fix. + (handle_aclocal_m4): Use ACLOCAL_AMFLAGS. + (handle_clean): Put -recursive target before -am target. + (handle_merge_targets): Put basename of $config_name on @all. + Test confsub.test. From Ramón García Fernández. + +Tue Jan 28 22:19:04 1997 Tom Tromey + + * automake.in (initialize_global_constants): Put libtoolize files + into @common_files, not @common_sometimes. From Gord Matzigkeit. + +Sun Jan 26 17:46:08 1997 Tom Tromey + + * texinfos.am (.texi.info): If --cygnus, set -I $(srcdir). From + Per Bothner. + +Sun Jan 12 18:28:16 1997 Fred Fish (fnf@ninemoons.com) + + * automake.in: Use 'interlock' and 'ylwrap' from source + directory or aux config directory, not build directory. + +Tue Jan 7 18:35:10 1997 Tom Tromey + + * aclocal.in (parse_arguments): Handle -I. + (usage): Ditto. + (scan_m4_files): Ditto. + + * automake.in (handle_single_transform_list): Don't give error + message if extension unrecognized. + +Tue Dec 17 11:18:20 1996 Andreas Schwab + + * m4/header.m4 (AM_CONFIG_HEADER): Check for $CONFIG_HEADERS, not + $CONFIG_HEADER. + +Tue Jan 7 17:59:26 1997 Tom Tromey + + * automake.in (scan_one_configure_file): AM_INIT_GUILE_MODULE runs + AM_PROG_INSTALL, not AC_PROG_INSTALL. From Jim Blandy. + (handle_texinfo): Handle no-texinfo.tex option. + (handle_options): Ditto. + +Thu Jan 2 14:16:17 1997 Tom Tromey + + * automake.in (am_install_var): Ignore EXTRA libtool libraries. + From Marius Vollmer. + +Wed Dec 18 15:27:09 1996 Tom Tromey + + * automake.in (read_am_file): Sort configure_vars before adding to + output_vars. + (handle_yacc_lex_cxx): Sort de_ansi_objects. + (handle_man_pages): Sort %section keys. + +Tue Dec 10 00:41:17 1996 Tom Tromey + + * automake.in (AC_SUBST_PATTERN): Check for alphanumeric variable + names only. Test subst.test. + (scan_one_configure_file): Skip AC_DEFUN lines. Test + defun2.test. + +Mon Dec 9 08:18:42 1996 Tom Tromey + + * automake.in (file_contents_with_transform): Use ne, not !=, to + compare strings. Compare against correct string. From Jim + Meyering. + (handle_texinfo): Use rm -f to remove info files. From Gord + Matzigkeit. + + * Released 1.1l. + + * automake.in (handle_texinfo): Put .ps on @suffixes. + +Sun Dec 8 12:29:52 1996 Tom Tromey + + * automake.in (am_install_var): Directory with 'exec' in its name + is installed by install-exec. + + * subdirs.am (maintainer-clean-recursive): Make commands quiet. + * texinfos.am: Make commands quiet. + * scripts.am: Make commands quiet. + * progs.am: Make commands quiet. + * ltlibs.am: Make comamnds quiet. + * lisp.am: Make commands quiet. + * libs.am: Make commands quiet. + * header.am: Make commands quiet. + * data.am: Make commands quiet. + + * automake.in (variable_value_as_list): Handle := substitution + references. + (am_conf_line_error): Take file argument. Changed all callers. + (scan_one_configure_file): Skip config header of [$1]. + (scan_dependency_file): Don't add top_builddir to regex if it is + ".". Don't include top_builddir in output if it is ".". + (scan_one_configure_file): Skip version of [$2]. + +Sat Dec 7 11:34:39 1996 Tom Tromey + + * automake.in (scan_one_configure_file): New sub. + (scan_configure): Scan aclocal.m4 as well as configure.in. + (handle_configure): Makefile.in now depends on $(ACLOCAL), because + automake scans it. + + * automake.in (handle_configure): Put full path to file onto + @rewritten_inputs. Test output4.test. + + * automake.in (handle_configure): Put proper name onto @inputs. + Test output3.test. + + * automake.in (handle_configure): Pass correct args to automake + invocations. Test remake2.test. + + * automake.in (handle_configure): Check dirname of $file, not of + $local. Test output2.test. + + * automake.in (handle_dependencies): Added some missing ";"s in + transforms. + (get_object_extension): Ditto. + (handle_tags): Ditto. + (handle_tests): Ditto. + (read_am_file): Ditto. + (am_install_var): Ditto. + (file_contents_with_transform): Die if transform missing trailing + ";". + + * automake.in (am_install_var): Quote $ in regexp substitution. + From Ulrich Drepper. + +Fri Dec 6 18:54:10 1996 Tom Tromey + + * automake.in (handle_configure): Require actual input files, not + rewritten input files. From Ulrich Drepper. + +Thu Dec 5 02:52:20 1996 Tom Tromey + + Suggestion from Mark Galassi: + * texinfos.am (DVIPS): New macro. + (.dvi.ps): New rule. + + * automake.in (handle_dependencies): Check to make sure + --build-directory specified before searching for .P files. + (handle_configure): Correctly handle ":" syntax when running + config.status. + + * remake.am: Removed rules to regenerate Makefile and Makefile.in; + now handled by handle_configure. + + * remake-subd.am: Removed. + + * automake.in (scan_configure): Handle multiple ":"s in AC_OUTPUT + arg. + (parse_arguments): Ditto. + (handle_configure): Ditto. + (%other_output_files): Removed. + (rewrite_inputs_into_dependencies): New sub. + (handle_configure): Use it. + (handle_configure): Ditto. + + From Gord Matzigkeit: + * automake.in (generate_makefile): Handle ":" in AC_OUTPUT arg. + (handle_configure): Ditto. + + * automake.in (handle_single_transform_list): .S is assembly + source. From Anthony Green. + + * automake.in (handle_single_transform_list): Correctly rewrite + C++ and Fortran source to objects ending in ".o". Test + cxxo.test. + + * automake.in: Better error message if file missing. + + * aclocal.in (@obsolete_macros): ud_GNU_GETTEXT is obsolete. + * automake.in (handle_gettext): Use AM_GNU_GETTEXT, not + ud_GNU_GETTEXT. + (scan_configure): Ditto. ud_GNU_GETTEXT is now obsolete. + +Wed Dec 4 00:41:23 1996 Tom Tromey + + * automake.in (scan_configure): Skip empty elements when adding to + libsources. Perl 4 bug reported by Greg A Woods. + + * Makefile.am (perl4-check): New target. + (cvs-dist): Run perl4-check. + + Perl 4 fixes. Reported by Greg A. Woods: + * automake.in (file_contents_with_transform): If transform caused + all chars to go away, then skip rest of loop. + (handle_texinfo): Don't use "next" in arg to + file_contents_with_transform. + (handle_dependencies): Ditto. + (handle_tests): Ditto. + + * m4/regex.m4 (AM_WITH_REGEX): Check for GNU regex in libc. From + Andreas Schwab. + + * automake.in (parse_arguments): Removed --strictness. + (handle_dist_worker): Don't use --strictness. + (handle_configure): Ditto. + (initialize_global_constants): Don't mention --strictness. + + * automake.in (handle_merge_targets): Use all-recursive-am instead + of all-recursive-hack. The latter is ugly, according to Joel + Weber. + + * automake.in (handle_emacs_lisp): Push $(ELCFILES) onto @all. + + * automake.in (do_one_clean_target): Allow -local version of clean + targets. + +Tue Dec 3 18:58:40 1996 Tom Tromey + + * automake.in (handle_dependencies): Skip C-only lines in + depend2.am when appropriate. + * depend2.am (.deps/%.P): Omit modification of $o if language is + not C. + +Tue Dec 3 11:29:01 1996 Gordon Matzigkeit + + * compile-kr.am: Quote arguments to echo. + + * progs.am: Fix up problems when LIBTOOL is not defined (by + setting shell variable instprog to the installation program). + + * aclocal.in (scan_file): Allow the acinclude.m4 file to override + any other macro files (but still prevent multiple definitions + within acinclude.m4). + +Tue Dec 3 10:40:48 1996 Tom Tromey + + From Ulrich Drepper: + * automake.in (handle_emacs_lisp): Typo fix. + (scan_configure): Only recognize VERSION after whitespace. + + * texinfos.am: install-info requires path to info file. + + * progs.am: Use @LIBTOOL@, not $(LIBTOOL). + + * automake.in (am_install_var): If -ltlibs passed, substitute + @LIBTOOL@. + +Mon Dec 2 13:51:11 1996 Gordon Matzigkeit + + * automake.in (get_object_extension): Unshift ansi2knr onto the + all target, so that it builds before any other targets. + [de_ansi_objects]: Delete, since unshifting ansi2knr is an easier + solution. + +Mon Dec 2 12:13:27 1996 Tom Tromey + + * Released 1.1i. + + From Janos Farkas: + * automake.in (handle_texinfo): Must quote $ for make. + +Sun Dec 1 15:08:09 1996 Tom Tromey + + * automake.in (handle_configure): Correctly handle common case of + multiple non-Makefiles in AC_OUTPUT. Require all input files when + using ":" syntax. + +Sun Nov 24 00:33:50 1996 Tom Tromey + + * automake.in (handle_source_transform): Don't define + EXTRA_prog_SOURCES unnecessarily. Test extra2.test. + + * automake.in (initialize_per_input): New variables + included_generic_compile, included_knr_compile, + included_libtool_compile. + (get_object_extension): Use them. + + * automake.in (handle_single_transform_list): Removed + Objective-C/C++ support (didn't really work anyway). + (handle_single_transform_list): Handle assembly specially. + + * automake.in (handle_yacc_lex_cxx): Set --mode=compile or + --mode=link when running libtool. + + * ltlibs.am: Set --mode=install when running libtool. + (uninstall-@DIR@PROGRAMS): Set --mode=uninstall when running + libtool. + * libtool.am (.c.lo): Set --mode=compile when running libtool. + * progs.am: Set --mode=install when running libtool. + + Fix for bug reported by François Pinard: + * automake.in (do_check_merge_target): New sub. + (do_one_merge_target): No longer handle `check'. + (handle_merge_targets): Use do_check_merge_target. + (initialize_per_input): Set @check_tests. + (handle_tests): Push onto @check_tests, not @check. + + * automake.in (am_install_var): Typo fix. + (handle_configure): Require $inputs[0]. + +Fri Nov 22 00:01:45 1996 Tom Tromey + + * automake.in (handle_lib_objects): Fixed error message + processing. + +Thu Nov 21 22:29:30 1996 Tom Tromey + + * automake.in (scan_configure): AC_FUNC_FNMATCH doesn't add to + LIBOBJS. + (handle_configure): Support multi-":" mode for AC_OUTPUT. + + * m4/header.m4: New file. + + * automake.in (scan_configure): Recognize AM_CONFIG_HEADER. + +Wed Nov 20 00:23:42 1996 Tom Tromey + + * acinstall: Allow commentary at end of "serial" line. From Gord + Matzigkeit. + + * automake.in (handle_yacc_lex_cxx): Only replace output header if + it has changed. + +Tue Nov 19 19:03:30 1996 Tom Tromey + + * automake.in (am_primary_prefixes): Allow configure variables to + be named after primary. + (am_install_var): Ditto. + + * automake.in (initialize_per_input): Initialize output_header. + (generate_makefile): Set up output_header; print it before + output_rules. + (handle_footer): Put .SUFFIXES into output_header, for AIX. + +Mon Nov 18 19:11:53 1996 Gordon Matzigkeit + + * automake.in: Added a lot of libtool support. New variable + prog_LDFLAGS to pass linker flags. Use libtoolize to install + libtool support files. + +Mon Nov 18 13:29:55 1996 Tom Tromey + + * automake.in (handle_lib_objects): Push @LIBOBJS@ and @ALLOCA@ + onto dependency list. + + * aclocal.in (obsolete_macros): Include AM_SANITY_CHECK_CC; now + part of autoconf proper. + * m4/ccsanity.m4: Removed. + +Sun Nov 17 12:25:17 1996 Tom Tromey + + * automake.in (check_typos): Check to make sure EXTRA_ variables + don't contain configure subs. + (handle_dist_worker): Removed EXTRA_DIST_DIRS; not needed. + +Fri Nov 15 18:58:04 1996 Tom Tromey + + * tags-subd.am: Removed. + + * tags.am (tags-recursive): Removed. + (TAGS): Depend on @DIRS@, @CONFIG@. Use @CONFIG@ in rule. + (ID): From tags-subd.am. + + * aclocal.in (obsolete_macros): Include AM_FUNC_FNMATCH. + * automake.in (scan_configure): Recognize AC_FUNC_FNMATCH. + * m4/fnmatch.m4: Removed (now in autoconf). + + * automake.in (initialize_per_input): Init de_ansi_objects. + (handle_single_transform_list): Error if extension unrecognized. + Set elements of de_ansi_objects. + (get_object_extension): Don't push ANSI2KNR onto @all. + (handle_yacc_lex_cxx): Put ANSI2KNR into dependency of all ._o + files. + (pretty_print_internal): Initialize $bol depending on the column. + +Fri Nov 15 16:22:15 1996 Gordon Matzigkeit + + * library.am: Fixed references to LIBRARY according to new scheme. + + * libs.am, libs-clean.am: Removed references to LIBFILES. + + * automake.texi (A Library): doc fix + + * automake.in (handle_libraries): Deleted references to *LIBFILES, + since we now have the full library name in the *LIBRARIES + variable. + (am_install_var): Removed `-no-all' option, which was only required + for the LIBFILES hack. + +Fri Nov 15 16:39:29 1996 Tom Tromey + + * automake.in: Applied libtool-related patches from Gord. + (scan_configure): Set CC configure var if AM_PROG_LIBTOOL seen. + Also indicate that AC_CANONICAL_HOST was run. + + * Makefile.am (pkgdata_DATA): Removed aclocal.m4. + +Thu Nov 14 23:11:09 1996 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Don't auto-define YACC, LEX, + CXX, CC. + + * dejagnu.am: Print warning if runtest missing. + + From Joerg-Martin Schwarz: + * automake.in (handle_aclocal_m4): Find aclocal.m4 in srcdir. + (require_file_internal): Unlink file before creating it. + + * depend2.am (.deps/%.P): Don't print commands when running. + +Mon Nov 11 10:35:08 1996 Tom Tromey + + * automake.in (handle_single_transform_list): Simplified C++ + matching expression. + +Fri Nov 8 09:49:09 1996 Tom Tromey + + * Released 1.1g. + + * compile-kr.am ($(OBJECTS)): Removed. + + * automake.in (get_object_extension): Define ANSI2KNR. Push onto + @all if ansi2knr is in this directory. + + * configure.in: Don't run AC_ARG_PROGRAM, AC_PROG_MAKE_SET. + + * m4/init.m4: Run AM_SANITY_CHECK. + + * m4/sanity.m4: New file. + + * automake.in (handle_dist_worker): In Cygnus mode, possibly find + files to dist in build dir, not srcdir. + (%omit_dependencies): New global. + (scan_dependency_file): Handle OMIT_DEPENDENCIES. + (scan_configure): Put rx.h, regex.h on %omit_dependencies. Ditto + libintl.h. + (handle_tests): Remove CYGNUS strings in Cygnus mode. + (handle_texinfo): Ditto. + + * texinfos.am (dist-info): New target. + + * automake.in (handle_dist_worker): Use DISTFILES, not + DEP_DISTFILES. + (initialize_per_input): Initialize dist_targets. + (handle_texinfo): Don't compute @infos_list; don't define or use + INFOS. Put dist-info onto @dist_targets. + (handle_dist_worker): Handle @dist_targets. Don't use the "echo + trick" for expanding DISTFILES any more. + + * dist-vars.am (DEP_DISTFILES): Removed. + (DISTFILES): Don't include INFOS. + + * automake.in (handle_texinfo): Handle Cygnus mode. + * texinfos.am (.texi.info, .texinfo.info): Handle Cygnus mode. + + * automake.in (handle_single_transform_list): New sub. + (handle_source_transform): Use it. + (handle_built_sources): New sub. + +Thu Nov 7 14:49:16 1996 Tom Tromey + + * remake.am ($(srcdir)/Makefile.in): Pass @ARGS@ to automake. + * remake-subd.am ($(srcdir)/Makefile.in): Pass @ARGS@ to + automake. + * automake.in (handle_configure): Pass --cygnus when running + automake again. + + * remake-hdr.am ($(srcdir)/stamp-h.in): Depend on @FILES@, not + ACCONFIG, CONFIG_TOP, CONFIG_BOT. + * automake.in (handle_aclocal_m4): Always find aclocal.m4 in + top_srcdir. + (handle_configure): Don't define ACCONFIG, CONFIG_TOP, CONFIG_BOT; + instead substitute files directly. + +Wed Nov 6 10:22:26 1996 Tom Tromey + + * remake-hdr.am (stamp-h): Look in top_builddir for + config.status. + ($(srcdir)/stamp-h.in): Look in top_srcdir for configure.in. + +Thu Oct 31 10:55:59 1996 Tom Tromey + + * texinfos.am (.texi.dvi): Set MAKEINFO when running texi2dvi. + From Jim Meyering. + + * automake.in (handle_texinfo): Push install-info-am, not + install-info. + (handle_merge_targets): Handle no-installinfo option. + + * texinfos.am (install-info-am): Renamed from install-info. + + * automake.in (handle_subdirs): Include install-info-recursive if + no-installinfo given. + + * subdirs.am: Include INSTALLINFO token. + + * automake.in (handle_texinfo): Explicitly define MAKEINFO, + TEXI2DVI. + (cygnus_mode): New global. + (handle_dist_worker): Pass --cygnus to automake. + (initialize_global_constants): Document --cygnus. + (check_cygnus): New sub. + (handle_texinfo): Don't require texinfo.tex in Cygnus mode. + + * texi-vars.am: Removed. + + * dejagnu.am (check-DEJAGNU): Don't define rootme. + + * automake.in (handle_tests): Define EXPECT, RUNTEST. + + * dejagnu.am (EXPECT): Removed. + (RUNTEST): Removed. + + * automake.in (define_program_variable): New sub. + +Mon Oct 28 10:43:48 1996 Tom Tromey + + * automake.in (handle_dependencies): Use -M, not -MM, for C++ + dependencies. + +Thu Oct 24 20:21:50 1996 Tom Tromey + + * automake.in (check_libobjs_sources): New sub. Test + libobj4.test. + (handle_source_transform): Don't check for auto-discovered source + files here. + (handle_programs): Run check_libobjs_sources here. + (handle_libraries): Ditto. + + * automake.in (define_configure_variable): New function. + (get_object_extension): Use define_configure_variable. + (handle_yacc_lex_cxx): Ditto. + (handle_emacs_lisp): Ditto. + (configure_vars): New global. + (AC_CHECK_PATTERN): New global. + (seen_ranlib, seen_prog_cc, seen_prog_cxx, seen_prog_lex): + Removed. + (handle_yacc_lex_cxx): Use configure_vars, not seen_prog_*. + (AC_SUBST_PATTERN): New global. + (scan_configure): Use AC_SUBST_PATTERN; don't set seen_prog_*. + (handle_libraries): Don't use seen_ranlib. + (read_am_file): Run define_configure_variable on each discovered + variable. + +Mon Oct 21 23:06:49 1996 Tom Tromey + + * automake.in (scan_configure): Handle AM_INIT_GUILE_MODULE. + (handle_libraries): Pass configure substitutions directly on to + LIBFILES. + + * automake.in (AM_PACKAGE_VERSION_PATTERN): New global. + (scan_configure): Use it. Test version.test. + +Sun Oct 20 12:08:46 1996 Tom Tromey + + * automake.in (handle_dist_worker): Explicitly pass distdir to + dist-hook make. From Tatu Ylonen. + + * m4/strtod.m4: Use correct cache variable. + +Thu Oct 17 13:45:20 1996 Tom Tromey + + Lisp fixes from Erick Branderhorst: + * m4/lispdir.m4: Define lispdir, not LISPDIR. + * lisp.am: Added missing \. + +Fri Oct 11 00:44:49 1996 Tom Tromey + + * automake.in (handle_source_transform): Only rewrite c, yacc, lex + to use de-ansi-fication. + (scan_configure): Handle multi-line AC_REPLACE_FUNCS. Test + libobj5.test. + + * automake.in (handle_lib_objects): Added $lex_seen argument. + Error if lex file used but LEXLIB not seen. + (handle_programs): Ditto. + (handle_yacc_lex_cxx): Define LEXLIB variable. + (handle_lib_objects): Don't allow LEXLIB to end up on dependency + list. + +Thu Oct 10 16:12:38 1996 Tom Tromey + + * automake.in (handle_gettext): Moved check for SUBDIRS and + ABOUT-NLS here. + + * automake.in (handle_configure): Run mkinstalldirs under + $(SHELL). + (handle_yacc_lex_cxx): Run interlock under $(SHELL). + + * remake-subd.am (Makefile): Run config.status under $(SHELL). + * remake-hdr.am (stamp-h): Run config.status under $(SHELL). + * remake.am (Makefile): Run config.status under $(SHELL). + (config.status): Ditto. + + * automake.in (read_am_file): Removed UNMAINT code. + (file_contents_with_transform): Ditto. + * m4/maintainer.m4: Removed bogus UNMAINT code. + + * automake.in (handle_emacs_lisp): Define EMACS variable. + (handle_emacs_lisp): Make sure EMACS is in environment when + elisp-comp is run. + + * elisp-comp: Exit with status 1 if usage bad. + Use "emacs -q". Use EMACS environment variable if set (unless set + to t). + + * m4/lispdir.m4: Unset EMACS if it is set to `t'. + + * automake.in (handle_dist_worker): Allow EXTRA_DIST items to be + in subdirs. + (do_one_merge_target): Use all-am, not all, in subdirs case. + (handle_merge_targets): Always generate all-am in subdirs case. + + * remake.am (Makefile): Depend on BUILT_SOURCES. + * remake-subd.am (Makefile): Depend on BUILT_SOURCES. + * depend.am (.deps/.P): Don't depend on BUILT_SOURCES. + + * automake.in (handle_yacc_lex_cxx): Handle y.tab.h in non-ylwrap + case. + + * ylwrap: Bug fix. From Jim Meyering. + +Wed Oct 9 22:51:16 1996 Tom Tromey + + * m4/mktime.m4: Don't define AC_HEADER_SYS_TIME_H; instead just + check directly for header. + +Mon Oct 7 13:08:15 1996 Tom Tromey + + * automake.in (scan_configure): fp_WITH_DMALLOC and fp_WITH_REGEX + are obsolete. + +Sun Oct 6 00:43:01 1996 Tom Tromey + + * automake.in (AC_CONFIG_AUX_DIR_PATTERN): New global. + (AM_INIT_AUTOMAKE_PATTERN): New global. + (scan_configure): Use them. + + * aclocal.in (add_file): Search contents of included files. Test + req.test. + (scan_m4_files): Don't skip acinclude.m4 when constructing + search. Test acsilent.test. + (scan_m4_files): Scan acinclude.m4. + + * aclocal.in (add_file): Removed debugging print. + (scan_configure): Set $file_contents when scanning acinclude.m4. + Test acinclude.test. + + * configure.in: Upped to 1.1g. + + * Released 1.1f. + + * texinfos.am: Run : after install-info. + + * aclocal.in (parse_arguments): Better error message. + * automake.in (parse_arguments): Better error message. + + * remake.am (Makefile): Depend on $(srcdir)/Makefile.in, to work + around broken makes. From David A. Swierczek. + * remake-subd.am (Makefile): Ditto. + +Sat Oct 5 11:29:48 1996 Tom Tromey + + * automake.in (generate_makefile): Put BUILT_SOURCES onto @all if + appropriate. + (handle_source_transform): Error if discovered source file is + mentioned. + (do_one_merge_target): Move all-vs-check test here. + + * m4/obstack.m4: New file. + * m4/error.m4: New file. + + * automake.in (scan_configure): Support AM_FUNC_MKTIME, + AM_FUNC_ERROR_AT_LINE, AM_FUNC_OBSTACK. + + * texinfo.tex: New version from texinfo 3.9. + + * automake.in (handle_yacc_lex_cxx): Updated for new ylwrap. + Also, handle y.tab.h file when "yacc -d" is used. + (do_one_merge_target): Use pretty_print_rule. + + * ylwrap: Changed usage. + + * m4/mktime.m4: New file. + + * m4: Renamed all .m4 files to fit into 14-char limits. + + * m4/Makefile.am (EXTRA_DIST): New macro. + + * aclocal.in ($ac_defun_rx, %map, %file_contents): New globals. + (scan_m4_files): Use $ac_defun_rx. + (add_file): Ditto. + Run scan_m4_files. + (scan_configure): Scan acinclude.m4 before anything else. + (scan_file): New sub. + (check_acinclude): New sub. + (add_file): Rewrote. + + * progs-clean.am, progs.am: Renamed from programs-clean.am, + programs.am. + * libs-clean.am, libs.am: Renamed from libraries-clean.am, + libraries.am. + * texi-vars: Renamed from texinfos-vars.am. + * comp-vars.am: Renamed from compile-vars.am. + * texi-vers.am: Renamed from texi-version.am. + + * automake.in (require_file_internal): Give error if symlink can't + be made. + (require_config_file): Error message references configure.in. + (handle_yacc_lex_cxx): Fix order of arguments to ylwrap; from + Joerg-Martin Schwarz. + (handle_texinfo): Use texi-vers, not texi-version. + (get_object_extension): Use comp-vars, not compile-vars. + (handle_texinfo): Use texi-vars, not texinfos-vars. + (handle_libraries): Use `libs' prefix, not `libraries'. + (handle_programs): Use `progs' prefix, not `programs'. + +Fri Oct 4 01:14:08 1996 Tom Tromey + + * aclocal.in (scan_m4_files): New sub. + + * m4/AM_FUNC_STRTOD.m4 (am_cv_func_strtod_needs_libm): Set + am_cv_func_strtod_needs_libm, so we can avoid linking with -lm + everywhere. + +Thu Oct 3 20:11:16 1996 Tom Tromey + + * texinfos.am (uninstall-info): Run install-info --remove. + + * automake.in (read_am_file): Define all variables after reading + .am file. Test vpath.test. Reported by Anthony Green. + +Mon Sep 30 08:31:51 1996 Tom Tromey + + * texinfos.am: Run install-info. + + * automake.in (variable_value_as_list): Just return if comment + seen. Report from Mark Galassi. + (handle_options): Don't bother with explicit comment checking. + +Tue Sep 24 09:15:46 1996 Tom Tromey + + * automake.in (read_am_file): Cleaned up dejagnu variables. + +Mon Sep 23 00:04:48 1996 Tom Tromey + + * automake.in (parse_arguments): New usage to conform to GNU + standards. + + * aclocal.in (parse_arguments): New usage to conform to GNU + standards. + + * automake.in (handle_scripts): Push new target onto @check. + * scripts.am (check-@DIR@SCRIPTS): New target. + + * automake.in (initialize_global_constants): Define %dist, + dist_header, dist_trailer. + (handle_dist): Make dist-all target. + (generate_makefile): Run check_typos later. + (examine_variable): New sub. + (handle_tags): Examine TAGS_DEPENDENCIES. Test spell3.test. + Error if TAGS_DEPENDENCIES but no sources used. + (handle_configure): Examine CONFIGURE_DEPENDENCIES. + +Sat Sep 21 13:59:15 1996 Tom Tromey + + * automake.in (am_install_var): More error checking. + +Fri Sep 20 09:06:37 1996 Tom Tromey + + * tags.am (TAGS): Minor cleanup. + + * clean.am (distclean-generic): Don't remove CONFIG_HEADER. + + * remake-hdr.am (mostlyclean-hdr, clean-hdr, distclean-hdr, + maintainer-clean-hdr): New targets. + + * automake.in (handle_configure): Define CONFIG_HEADER correctly + when it is in current directory. + (handle_configure): Push "hdr" on @clean. + + * remake-hdr.am (stamp-h): Run config.status in top_builddir. + ($(srcdir)/stamp-h.in): Run autoheader in top_srcdir. + + * automake.in (scan_configure): Check for install.sh here. + (basename): New sub. + (handle_configure): Handle case where config.h is in subdir. + (handle_configure): Make stamp-in.h for user if it doesn't already + exist. + (touch): New sub. + +Tue Sep 17 23:35:14 1996 Tom Tromey + + * Makefile.am (EXTRA_DIST): Include pkgdata_DATA. + + * dist-vars.am (DISTFILES): Don't distribute BUILT_SOURCES or + DATA. + (DEP_DISTFILES): Ditto. + +Mon Sep 16 22:28:56 1996 Tom Tromey + + * automake.in (check_typos): Renamed. + (check_typos): Check for _LDADD, _LIBADD, and _DEPENDENCIES. + (variable_defined): Note variable as being "seen". + (handle_lib_objects): Don't push configure substitutions onto + _DEPENDENCIES. + +Sun Sep 15 22:45:43 1996 Tom Tromey + + * automake.in (initialize_per_input): Init content_seen. + (variable_value_as_list): Set content_seen entry. + (define_variable): Ditto. + (define_pretty_variable): Ditto. + (check_source_typos): New sub. + (generate_makefile): Call it. + +Thu Sep 12 15:03:19 1996 Tom Tromey + + * automake.in (handle_source_transform): Removed extraneous + space. Test implicit.test. + (read_am_file): Make sure "canonical" variables are mentioned in + %contents. + (scan_configure): AC_CHECK_TOOL sets $seen_canonical to + $AC_CANONICAL_HOST conditionally. + (handle_footer): Don't use define_pretty_variable in all cases. + +Wed Sep 11 11:54:44 1996 Tom Tromey + + * clean.am (distclean-generic): Remove CONFIG_CLEAN_FILES here, + per GNU/Gnits standards. + + * libraries.am (install-@DIR@LIBRARIES): Use two loops, so new + NORMAL_INSTALL and POST_INSTALL variables can work when empty. + + * automake.in (handle_options): Rewrote version handling. Now + returns error indicator. + (MACRO_PATTERN, BOGUS_MACRO_PATTERN): Handle `:=' definitions. + (RULE_PATTERN): Exclude `:=' from being a rule. + + * m4/AM_PROG_CC_STDC.m4 (ac_save_CC): Bug fix from Jim Meyering. + + * automake.in (variable_value_as_list): Always use am_line_error. + (define_variable): New sub. + (get_object_extension): Use define_variable. + (handle_yacc_lex_cxx): Ditto. + (handle_source_transform): Ditto. + (handle_programs): Ditto. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (handle_dependencies): Ditto. + (handle_aclocal_m4): Ditto. + (define_pretty_variable): New sub. + (handle_source_transform): Use define_pretty_variable. + (handle_lib_objects): Ditto. + (handle_libraries): Ditto. + (handle_dist): Ditto. + (handle_dependencies): Ditto. + (handle_configure): Ditto. + (handle_footer): Ditto. + (handle_emacs_lisp): Ditto. + (am_install_var): Ditto. + + * Released version 1.1e. + + * automake.in ($GNITS_VERSION_PATTERN): Handle non-alpha + releases. + + * configure.in: Version 1.1e. + + * automake.in (handle_texinfo): Distribute .info file. + +Sun Sep 8 09:00:37 1996 Tom Tromey + + * Makefile.am (EXTRA_DIST): New macro. + (maintainer-clean): Don't run "make check". + (pathchk): New target. + + * automake.in (check_gnits_standards): Only check version number + syntax at top level. + ($package_version_line): New variable. + (scan_configure): Set it. + (check_gnits_standards): Use am_conf_line_error. + (scan_configure): Remove extraneous whitespace from version + number. + (handle_dist): Handle distcheck-hook. + + * m4/AM_PROG_CC_STDC.m4: Applied patch from Jim Meyering. + + * automake.in (scan_configure): Handle AM_WITH_REGEX. + (handle_lib_objects): Require .h files in %libsources but don't + generate dependencies for them. + (scan_configure): Also require rx.h and regex.h. + + * m4/Makefile.am (m4data_DATA): Don't include AM_PROG_LIBTOOL, + AM_FEATURE_CTYPE, AM_FEATURE_ERRNO, AM_FEATURE_EXIT, + AM_SYSTEM_HEADER. + + * texi-version.am: Use "cp; rm" and not "mv", to work around + broken mvs. + + * automake.in ($package_version): New global. + (scan_configure): Set it. + (check_gnits_standards): Verify version string; require + README-alpha if alpha version. + (scan_configure): Recognize AM_FUNC_FNMATCH, + AM_REPLACE_GNU_GETOPT. + + * Makefile.am (installcheck-local): Check all scripts. + +Sat Sep 7 19:22:32 1996 Tom Tromey + + * tags-clean.am: Do deletions here again. + +Thu Sep 5 09:06:23 1996 Tom Tromey + + * automake.in (usage): Include bug-reporting information. + (handle_lib_objects): Error if LIBOBJS seen but never set. + + * aclocal.in ($acdir): Use @datadir@/aclocal. + (usage): Include bug-reporting information. + +Wed Sep 4 11:36:06 1996 Tom Tromey + + * automake.in (handle_source_transform): .deps no longer in + srcdir. + (handle_lib_objects): Ditto. + (handle_dist_worker): Pass --build-dir to automake. + ($build_directory): New global. + (parse_arguments): Handle --build-dir. + (initialize_global_constants): Include --build-dir in help. + (scan_dependency_file): New sub. + (handle_dependencies): Use it. Also, use $build_directory. + (initialize_global_constants): Added --srcdir-name. + (parse_arguments): Ditto. + (handle_dist_worker): Ditto. + ($srcdir_name): New global. + ($srcdir_rx): New global. + (parse_arguments): Set it. + + * depend2.am: Removed all mention of $(srcdir). + + * depend.am (MKDEP): Use gcc -M, not gcc -MM. + Removed all mention of $(srcdir); dependencies now put into build + dir. + + * depend2.am ($(srcdir)/.deps/%.P): Fixed computation of `top'. + Don't do work silently. + + * automake.in (handle_merge_targets): Error if invalid uninstall + targets are given. + (read_am_file): Fix for test block.test. + +Tue Sep 3 18:50:32 1996 Tom Tromey + + * texinfos.am (install-info): Added NORMAL_INSTALL. + * scripts.am (install-@DIR@SCRIPTS): Added NORMAL_INSTALL. + * programs.am (install-@DIR@PROGRAMS): Added NORMAL_INSTALL. + * lisp.am (install-@DIR@LISP): Added NORMAL_INSTALL. + * libraries.am (install-@DIR@LIBRARIES): Added NORMAL_INSTALL. + Also, use POST_INSTALL when running ranlib. + * header.am (install-@DIR@HEADERS): Added NORMAL_INSTALL. + * data.am (install-@DIR@DATA): Added NORMAL_INSTALL. + + * automake.in (handle_man_pages): Added NORMAL_INSTALL invocation. + (handle_merge_targets): Ditto. + (handle_merge_targets): Error if PRE_INSTALL, POST_INSTALL, or + NORMAL_INSTALL defined. + + * m4/AM_PROG_INSTALL.m4: INSTALL_SCRIPT defaults to + ${INSTALL_PROGRAM}. From François Pinard. + +Tue Aug 27 08:25:05 1996 Tom Tromey + + * automake.in (file_contents_with_transform): Correctly remove + @(UN)?MAINT@ from input when maintainer mode not active. + (handle_aclocal_m4): Handle no-maintainer-mode case. + + * remake-hdr.am ($(CONFIG_HEADER)): Removed @MAINT@. + + * m4/AM_SANITY_CHECK_CC.m4: New file (from Jim Meyering). + +Mon Aug 26 21:37:32 1996 Tom Tromey + + * automake.in (handle_lib_objects): Bug fix from Steve M Robbins. + (handle_libraries): Don't include libraries from EXTRA_LIBRARIES + in LIBFILES definition. Reported by Steve M Robbins. Test + alllib.test. + + * automake.in (variable_value_as_list): New sub. + (handle_source_transform): Use it. + (handle_lib_objects): Ditto. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (am_install_var): Ditto. + (handle_options): Ditto. + +Sat Aug 24 09:30:46 1996 Tom Tromey + + Reported by Jim Meyering: + * automake.in (get_object_extension): Look in "./" for ansi2knr if + no path found. + (handle_aclocal_m4): Protect aclocal.m4 rule with @MAINT@. + + * remake.am (.PHONY): New target. + + * m4/AM_MAINTAINER_MODE.m4: Also define UNMAINT. + + * automake.in (check_gnu_standards): Disallow no-installman, + no-installinfo. + (read_am_file): Sed out UNMAINT too. + (file_contents_with_transform): Ditto. + + * acinstall: New file. + + * m4/AM_INIT_AUTOMAKE.m4: Define PACKAGE and VERSION. + + * m4/AM_WITH_REGEX.m4: New version from François Pinard. + + * m4/AM_TYPE_PTRDIFF_T.m4: Use am_cv, not ac_cv. + * m4/AM_C_PROTOTYPES.m4: Ditto. + * m4/AM_FUNC_STRTOD.m4: Ditto. + * m4/AM_PROG_CC_STDC.m4: Ditto. + * m4/AM_PROG_LIBTOOL.m4: Ditto. + +Fri Aug 23 22:23:50 1996 Tom Tromey + + * m4/Makefile.am (m4datadir): New macro + (m4data_DATA): Renamed. + + * Makefile.am (cvs-dist): Depend on distcheck target. + +Mon Aug 19 15:37:32 1996 Tom Tromey + + * automake.in (initialize_global_constants): [common_files] + Include acinclude.m4. + + * m4/AM_PROG_CC_STDC.m4: Patch from Jim Meyering/Kaveh Ghazi. + +Sat Aug 17 11:27:14 1996 Tom Tromey + + * automake.in (handle_dependencies): Push `depend'-clean targets + on @clean. + * depend.am (mostlyclean-depend, clean-depend, distclean-depend, + maintainer-clean-depend): New targets. + +Tue Aug 13 17:53:58 1996 Tom Tromey + + * texinfos.am (.texinfo.info): New target. + (.texinfo.dvi): New target. + + From Jim Meyering: + * automake.in (handle_texinfo): Use `.info[-0-9]*' as pattern to + match info files. + (handle_texinfo): Handle `.texinfo' files. + +Mon Aug 12 10:28:46 1996 Tom Tromey + + * automake.in (require_file_internal): Special-case `.' when + finding files to distribute. Test libobj2.test. + + * aclocal.in (add_file): Fixed regexp for matching AC_DEFUN. Test + order.test. + + * m4/AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.m4: New file. + * m4/AM_SYS_POSIX_TERMIOS.m4: New file. + + * compile-kr.am: Removed duplicate ansi2knr rules. + +Sun Aug 11 00:20:16 1996 Tom Tromey + + * automake.in (handle_yacc_lex_cxx): Bug fix from Josh MacDonald. + (handle_yacc_lex_cxx): Put C++ extensions on suffix list. + (mkdir): Removed. + + * automake.in (initialize_global_constants): [common_files] + Include interlock and ylwrap. + + * Released version 1.1c. + + * aclocal.in (obsolete_macros): md_TYPE_PTRDIFF_T and + ud_PATH_LISPDIR are obsolete names. + + * m4/AM_LC_MESSAGES.m4, m4/AM_WITH_NLS.m4, m4/AM_GNU_GETTEXT.m4: + Removed. + + * automake.in (handle_lib_objects): Changed interface. Now + generates _DEPENDENCIES variable if appropriate. + (handle_emacs_lisp): Use AM_PATH_LISPDIR. + (scan_configure): Ditto. + + * Makefile.am (CLEANFILES): Removed. + + * automake.in (handle_configure): Define CONFIG_CLEAN_FILES. + + * clean.am (clean-generic): Remove $(CONFIG_CLEAN_FILES). + + * compile-vars.am (CC, CFLAGS, COMPILE, LINK): Removed. + + * automake.in (handle_yacc_lex_cxx): Require ylwrap in + multi-lex/yacc case. + (handle_source_transform): Changed return result. + (handle_programs): Use linker returned by + handle_source_transform. + (seen_prog_cc, seen_prog_cxx): New globals. + (scan_configure): Recognize AC_PROG_CC and AC_PROG_CXX. + (handle_yacc_lex_cxx): Error message if AC_PROG_CXX or + AC_PROG_YACC missing. + (seen_decl_yytext, seen_prog_lex): New globals. + (scan_configure): Set them. + (handle_yacc_lex_cxx): Warn about missing AC_PROG_LEX or + AC_DECL_YYTEXT. + (handle_yacc_lex_cxx): Use $(LEX_OUTPUT_ROOT). + (initialize_per_input): Initialize seen_c_source. + (handle_yacc_lex_cxx): Define CC, CFLAGS, COMPILE, LINK only when + C source seen. + (handle_source_transform): Set seen_c_source. + + * interlock: Changed usage. + + * ylwrap: New file. + + * automake.in (handle_yacc_lex_cxx): Renamed. + + * automake.in (handle_dependencies): Handle %cxx_extensions. + Include depend2.am when appropriate. + + * depend2.am: New file; contents from depend.am but templatized. + + * automake.in (initialize_per_input): Initialize + %cxx_extensions. + (handle_source_transform): Set %cxx_extensions. + +Sat Aug 10 10:29:30 1996 Tom Tromey + + * interlock: New file. + + * automake.in (handle_yacc_lex): New sub. + (handle_source_transform): Removed most yacc/lex handling. + (initialize_per_input): Init yacc_sources, lex_sources. + (generate_makefile): Run handle_yacc_lex. + (handle_merge_targets): Use `scalar' and not $# to find length of + array. + + * m4/AM_FEATURE_EXIT.m4: Wrote. + * m4/AM_FEATURE_CTYPE.m4: Wrote. + * m4/AM_FEATURE_ERRNO.m4: Wrote. + + * aclocal.in (macro_seen): New global. + (add_file): Set macro_seen entry. Only push required macro on + @rlist if not already seen. Test defun.test. + + * automake.in (get_object_extension): Handle directory prefix on + `ansi2knr' option. + + * kr-extra.am: New file. + + * kr-vars.am: Removed. + + * automake.in (handle_options): Handle directory prefix on + `ansi2knr' option. + + * automake.in (scan_configure): Recognize AM_FUNC_STRTOD. + + * aclocal.in (add_file): Error if macro is duplicated. Test + dup.test. + +Fri Aug 9 09:18:46 1996 Tom Tromey + + * automake.in (handle_programs): Substitute @XLINK@. Make sure + linker variable is transformed name. + * program.am (@PROGRAM@): Use @XLINK@ to link. + + * automake.in (handle_scripts): Fixed call to + am_primary_prefixes. + (handle_libraries): Better error message when AC_PROG_RANLIB + required. + + * automake.in (handle_libraries): Canonicalize library name. Test + canon4.test. + * library.am (lib@LIBRARY@.a): Use @XLIBRARY@ where appropriate. + (lib@LIBRARY@.a): Look at _DEPENDENCIES variable. + +Thu Aug 8 10:57:21 1996 Tom Tromey + + * automake.in (handle_scripts): Correctly compute + $scripts_installed. Test scripts.test. + +Wed Aug 7 12:13:15 1996 Tom Tromey + + * ansi2knr.c: New version. + +Tue Aug 6 10:58:37 1996 Tom Tromey + + * automake.in (handle_source_transform): Handle more C++ file + extensions. "Handle" Objective C. Handle more FORTRAN + extensions. + + * compile-vars.am (LEX): Removed. + (YACC): Removed. + + * automake.in (handle_source_transform): Correctly handle lex + source. Test lex.test. + (handle_source_transform): Skip more C++ headers. Generate macro + definitions for YACC and LEX on first use. + + * aclocal.in (parse_arguments): Mention GNU. + * automake.in (parse_arguments): Mention GNU. + +Mon Aug 5 00:12:45 1996 Tom Tromey + + * automake.in (handle_programs): Define program_LINK. + * program.am (@PROGRAM@): Use program_LINK to link. + + * Released version 1.1b + + * automake.in (scan_configure): AM_INIT_AUTOMAKE sets + seen_prog_install to `2'. + + * configure.in: Don't run AM_PROG_INSTALL. + + * automake.in (parse_arguments): Use $PACKAGE. + ($PACKAGE): New global. + ($am_c_prototypes): Renamed. + (get_object_extension): Use am_c_prototypes. + (scan_configure): Ditto. + (scan_configure): Use AM_MAINTAINER_MODE. + (scan_configure): Warn about obsolete macros. + + * aclocal.in (parse_arguments): Use $PACKAGE. + ($PACKAGE): New global. + + * Makefile.am (CLEANFILES): Added aclocal. + (ETAGS_ARGS): Added aclocal.in. + (TAGS_DEPENDENCIES): Ditto. + (maintainer-check): Depend on aclocal. + (maintainer-check): Check aclocal. + (bin_SCRIPTS): Include aclocal. + + * automake.in (scan_configure): Handle AM_INIT_AUTOMAKE. + (scan_configure): Use AM_PROG_INSTALL. + + * configure.in: Use AM_INIT_AUTOMAKE. + + * automake.in (keyed_aclocal_warning): Warning tells about + aclocal. + (handle_aclocal_m4): New sub. + (handle_configure): Use it. + + * aclocal.in (output_file): New global. + (usage): Handle --output. + (parse_arguments): Handle --output. + + * m4/AM_INIT_AUTOMAKE.m4: New file. + + * m4/AM_PROG_CC_STDC.m4: Require AC_PROG_CC. + Don't touch CFLAGS. + + * automake.in (handle_dist_worker): Reverted erroneous "-chmod". + (handle_texinfo): Don't generate `.info-[0-9]' as a filename. + + * texinfos.am (.texi.info): Force .info file to be built in + srcdir. From Franc,ois Pinard. + + From Jim Meyering: + * m4/AM_PROG_CC_STDC.m4: (fp_PROG_CC_STDC): Include sys/stat.h in + test program so that DYNIX/ptx V4.1.3 doesn't use `-Xc + -D__EXTENSIONS__' -- with those options on that system, sys/stat.h + gets compile errors. With help from Marcus Daniels. + + * automake.in (initialize_global_constants): Put elisp-comp into + @common_files. Bug from Glenn Amerine. + +Sun Aug 4 12:52:43 1996 Tom Tromey + + * automake.in (handle_dist_worker): Use fgrep, not grep. + + * m4/AM_C_PROTOTYPES.m4: Changes from François Pinard. + + * automake.in (handle_emacs_lisp): Include lisp-clean.am in + output. + (initialize_global_constants): [install_man_format] Don't hide + "ugliness" at install time. + + * lisp-clean.am: New file. + + * tags-clean.am (maintainer-clean-tags): Remove TAGS and ID here. + + * automake.in (handle_man_pages): Patch from Janos Farkas to fix + bug when installing man pages. Test man.test. + (initialize_global_constants): [install_man_format] Make sure man + page can actually be found in either source or build dirs. + (handle_dist_worker): Use "755" permissions on distdir. + + * automake.in (handle_dist): Allow chmod's to fail. + (am_primary_prefixes): New function. + (am_install_var): Use it. + (handle_libraries): Use it. Test libfiles.test. + (handle_dist): For dist-tarZ, assume traditional "tar" and + "compress". + + * m4/AM_FUNC_STRTOD.m4: New file. + + * automake.in (handle_dist): Only generate `distdir' variable if + it doesn't already exist. + + Fix for bug reported by Harlan Stenn. Test tags.test. + * automake.in (initialize_per_input): Define dir_holds_sources. + (handle_tags): Check dir_holds_headers. + (handle_headers): Set dir_holds_headers. + + * automake.in (handle_texinfo): Generate "version.texi" dependency + for .dvi file. Bug reported by Glenn Amerine. Test vtexi2.test. + + * automake.in (handle_configure): Require file $input, not + "$local.in". From Nyul Laszlo. Test colon.test. + +Sun Jul 28 11:14:52 1996 Tom Tromey + + * aclocal.in: New file. + * configure.in: Generate m4/Makefile, aclocal. + * Makefile.am (SUBDIRS): Include m4. + * m4/Makefile.am: New file. + +Fri Jul 19 10:12:27 1996 Tom Tromey + + * automake.in (initialize_global_constants): Put ansi2knr.c and + ansi2knr.1 into common_files. Bug report from François Pinard. + +Mon Jul 15 10:28:29 1996 Tom Tromey + + * install-sh: Updated copyright notice. + +Fri Jul 5 08:23:00 1996 Tom Tromey + + * subdirs.am (maintainer-clean-recursive): Don't be so noisy. + Report from Josh MacDonald. + + Bugs from Gord Matzigkeit: + * automake.in (handle_footer): Push contents of $(SUFFIXES), not + `$(SUFFIXES)'. + (handle_dist): Ignore chmod return results. + + * programs-clean.am (clean-@DIR@PROGRAMS): Work around failing + Solaris "rm -f". Bug from Kaveh R. Ghazi. + * libraries-clean.am (clean-@DIR@LIBRARIES): Likewise. + +Fri Jun 21 10:42:06 1996 Tom Tromey + + * texinfos.am (install-info): Use "if", not "&&", to avoid + install problem when glob doesn't match. + + * automake.in (initialize_global_constants): [USAGE] Added + --no-force. + (force_generation): New global. + (parse_arguments): Handle --no-force. + (generate_makefile): Handle --no-force. + + * Makefile.am (maintainer-check): Ensure all invocations of + mkinstalldirs are correct. + +Tue Jun 18 10:53:54 1996 Tom Tromey + + * automake.in (handle_tests): Don't directly generate site.exp. + +Sun Jun 16 22:21:16 1996 Harlan Stenn + + * automake.in: Treat an initial `#' on a word in AUTOMAKE_OPTIONS + as a comment start. Add support for a dist-tarZ target. + +Tue Jun 11 22:14:21 1996 Marcus Daniels + + * depend.am ($(srcdir)/.deps/%.P): Convert absolute $(top_srcdir) + paths into relative paths. + +Mon Jun 10 21:11:20 1996 Tom Tromey + + * texinfo.tex: New version. + + * automake.in: Look for AM_PROG_LIBTOOL. From Gord Matzigkeit. + (initialize_global_constants): Added libtool to + @common_sometimes. + (handle_source_transform): Pass YFLAGS to yacc and LFLAGS to lex. + +Sun Jun 9 17:45:48 1996 Tom Tromey + + * texinfos.am (install-info): Don't install ~ files. Bug report + from Greg McGary. + * automake.in (handle_texinfo): Don't push '.info*' onto + @infos_list. + + * automake.in (handle_gettext): Ensure po and intl in SUBDIRS when + using gettext. + (handle_dist): Pass --with-included-gettext to configure if using + gettext. + + * compile-kr.am (._c._o): Pass -c to $(COMPILE). + (.c._o): Ditto. + * compile.am (.c.o): Pass -c to $(COMPILE). + * compile-vars.am (COMPILE): Don't include -c. + + * remake.am ($(srcdir)/Makefile.in): Pass --strictness to + automake. + * automake.in (handle_configure): Supply --strictness arg to + automake. + +Fri Jun 7 12:31:31 1996 Tom Tromey + + * automake.in (handle_tests): Fix quoting on `pwd`. + (handle_options): Recognize no-installinfo option. + (handle_man_pages): Don't put man directory on @installdirs if + no-installman is specified. + (handle_texinfo): Handle no-installinfo option. + (handle_options): Compare version against $num_version, not + $VERSION. + (handle_source_transform): Generate rules for output of lex, + yacc. Bug report from Thomas Morgan. Test yacc.test. + (handle_dist): "distcheck" now runs "make dvi". + (handle_tests): Support $(TESTS_ENVIRONMENT). Idea from Ulrich + Drepper. + + * dejagnu.am (check-DEJAGNU): Depend on site.exp. + +Sun Jun 2 10:33:10 1996 Tom Tromey + + * automake.in (handle_emacs_lisp): New function. + (initialize_global_constants): Added elisp-comp to + @common_sometimes. + (seen_lispdir): New global. + (scan_configure): Handle ud_PATH_LISPDIR. + + * elisp-comp: New file. + + * lisp.am: New file. + + * automake.in (generate_makefile): Run handle_emacs_lisp. + + * aclocal.m4 (ud_PATH_LISPDIR): New macro, from Ulrich Drepper. + + * automake.in (initialize_global_constants): Removed version.texi + from common_sometimes. + (initialize_global_constants): Added texinfo.tex to common_files. + Test texinfo.test. + (handle_tests): Allow dejagnu- and automake-style test suites to + coexist. Test dejagnu.test. + (initialize_global_constants): New constants AC_CANONICAL_HOST, + AC_CANONICAL_SYSTEM. + (scan_configure): Use new constants. + (handle_tests): Put target specific information into site.exp if + AC_CANONICAL_* used. + (read_am_file): Generate some extra variables when AC_CANONICAL_* + used. + (handle_options): Allow version number to have letters appended. + (handle_tests): Error if RUNTEST, RUNTESTFLAGS defined but dejagnu + option not specd. + (initialize_global_constants): install_man_format changed to + handle built man pages. + +Wed May 29 10:35:01 1996 Tom Tromey + + * config.guess, config.sub: New versions. + +Tue May 28 19:27:11 1996 Tom Tromey + + * configure.in (VERSION): Upped to 1.0. + +Sat May 25 10:19:53 1996 Tom Tromey + + * automake.in (handle_tests): Handle dejagnu. + (handle_options): Recognize dejagnu option. + + * dejagnu.am: New file. + +Thu May 23 10:01:13 1996 Tom Tromey + + * automake.in (handle_dist): Run installcheck target from + distcheck. + + * configure.in (VERSION): Upped to 0.34. + + * automake.in (scan_configure): Always allow upgrading to + fp_PROG_INSTALL. Test fpinstall.test. + +Wed May 22 14:45:28 1996 Joshua Cowan + + (handle_dist): Make `distcheck' check `install' target, too. + +Wed May 22 09:49:27 1996 Tom Tromey + + * automake.in (initialize_per_input): Don't initialize + $output_directory here; initialize it globally. From Joshua + Cowan. Test outdir.test. + +Sat May 18 10:57:40 1996 Tom Tromey + + * automake.in (handle_tests): Don't push TESTS onto dist_common. + (initialize_global_constants): Put install-sh and mkinstalldirs + into @common_files. Test insh2.test. + +Fri May 17 09:02:02 1996 Tom Tromey + + * automake.in (handle_source_transform): Don't generate _OBJECTS + when no source files specified. Test number.test. + + From Joerg-Martin Schwarz: + * automake.in (seen_package, seen_version): New globals. + (scan_configure): Look for PACKAGE= and VERSION=. + + * automake.in (handle_options): Recognize dist-zip. + (handle_dist): Handle dist-zip. + (handle_options): Use ' ', not \s+, with split. Test + backsl.test. + (handle_source_transform): Likewise. + (handle_lib_objects): Likewise. + (handle_libraries): Likewise. + (handle_texinfo): Likewise. + (handle_man_pages): Likewise. + (handle_subdirs): Likewise. + (handle_gettext): Likewise. + (handle_footer): Likewise. + (handle_tests): Likewise. + (scan_configure): Likewise. + (am_install_var): Likewise. + + * Makefile.am (TAGS_DEPENDENCIES): New macro. + + * tags.am (tags-recursive): New target. + (TAGS): Depend on it. + + * automake.in (handle_tags): Put tags-recursive on @phony. + + * tags-subd.am (TAGS): Depend on HEADERS, SOURCES, + TAGS_DEPENDENCIES. + * tags.am (TAGS): Depend on HEADERS, SOURCES, TAGS_DEPENDENCIES. + +Thu May 16 09:21:48 1996 Tom Tromey + + * remake.am (configure): Depend on $(CONFIGURE_DEPENDENCIES). + + * automake.in (scan_configure): Look for install-sh and + mkinstalldirs here. + (initialize_global_constants): Moved mdate-sh from + common_sometimes to common_files. Test mdate2.test. + +Tue May 14 21:52:01 1996 Tom Tromey + + * automake.in (seen_maint_mode): New global. + (scan_configure): Handle jm_MAINTAINER_MODE. + (read_am_file): Handle seen_maint_mode. + (file_contents_with_transform): Handle seen_maint_mode. + (handle_source_transform): Changed interface, all callers. + + From Jim Meyering: + * remake-hdr.am, remake-subd.am, remake.am, texi-version.am: + Handle @MAINT@. + * aclocal.m4 (jm_MAINTAINER_MODE): New macro. + + * automake.in (handle_configure): Check $config_aux_dir against + empty string. From Markku Rossi. Test mkinstall.test. + +Fri May 10 14:38:47 1996 Gord Matzigkeit + + * automake.in (distcheck): Added new rule to top level + Makefile.in. + +Wed May 8 21:57:21 1996 Gord Matzigkeit + + * automake.in (scan_configure): Make sure that gm_PROG_LIBTOOL + sets seen_ranlib. + (generate_makefile): libtool, config.sub, and config.guess should + only ever appear in the top directory of a package. + +Tue May 14 10:24:30 1996 Tom Tromey + + * automake.in (initialize_global_constants): Added libversion.in + to @common_files. + + * configure.in (VERSION): Upped to 0.33. + + * automake.in (am_install_var): Fixed problem in EXTRA_ handling. + Test extra.test. + +Mon May 13 10:41:41 1996 Tom Tromey + + * install-sh (transformbasename): Correct misspelling of + transformbasename. From Ian Lance Taylor. + +Sat Apr 27 11:39:10 1996 Tom Tromey + + * automake.in (handle_configure): Set mkinstalldirs variable + here. + (handle_dist_worker): Explicitly set distdir in subdir makes. + (handle_dist): Handle separate distdir target. + (handle_dist_worker): Only generate distdir target. + + * texinfos.am (install-info): Use $(mkinstalldirs). + * scripts.am (install-@DIR@SCRIPTS): Use $(mkinstalldirs). + * programs.am (install-@DIR@PROGRAMS): Use $(mkinstalldirs). + * libraries.am (install-@DIR@LIBRARIES): Use $(mkinstalldirs). + * header.am (install-@DIR@HEADERS): Use $(mkinstalldirs). + * data.am (install-@DIR@DATA): Use $(mkinstalldirs). + + * automake.in (read_am_file): Set mkinstalldirs variable. + (handle_man_pages): Use it. + (handle_installdirs): Ditto. + +Fri Apr 26 15:10:48 1996 Tom Tromey + + * automake.in (handle_man_pages): Fix mkinstalldirs invocation. + +Thu Apr 25 18:40:06 1996 Tom Tromey + + * automake.in (handle_dist_worker): Use $(TAR), not tar. + (handle_merge_targets): Make sure config header is built before + recursing into subdirs. + (handle_libraries): Generate LIBFILES for check_LIBRARIES. + (handle_merge_targets): Handle case where nothing is installed but + something must be built -- "make install" must still work. + + * dist-vars.am (TAR): New macro. + + * automake.in (scan_configure): Support AC_REPLACE_GNU_GETOPT. + (handle_configure): Require stamp-h.in when config header used. + +Tue Apr 23 17:57:13 1996 Andreas Schwab + + * doc/mdate-sh: Extract the last field from the date output, not + the sixth, which will fail when the timezone name has more than + one word or is missing. + +Wed Apr 24 20:29:26 1996 Tom Tromey + + * automake.in (am_install_var): Use delete, not undef, to remove + EXTRA entry. From Gord Matzigkeit. + +Mon Apr 22 17:48:50 1996 Tom Tromey + + * automake.in (read_am_file): Handle case where last line doesn't + end in newline. + +Tue Apr 9 22:53:16 1996 Tom Tromey + + * automake.in (variable_defined): New function. + (read_am_file): Ensure a blank line comes before starting comments + from Makefile.am. + (initialize_per_input): Initialize %targets. + (read_am_file): Set appropriate entry in %targets. + Many changes to use variable_defined. + (check_gnu_standards): Only require ChangeLog at top level. From + Gord Matzigkeit. + (handle_tests): check-TESTS depends on $(TESTS). From Gord + Matzigkeit. + +Mon Apr 8 22:51:41 1996 Tom Tromey + + * automake.in (parse_arguments): Added short options. + (initialize_global_constants): Ditto. + +Fri Apr 5 00:22:14 1996 Tom Tromey + + * mkinstalldirs (errstatus): Don't necessarily die if mkdir + fails. + + * automake.in (handle_source_transform): Typo fix. + +Thu Apr 4 15:10:50 1996 Tom Tromey + + * automake.in (handle_dist_worker): Renamed dist-local to + dist-hook. + (handle_merge_targets): Added install-data-hook and + install-exec-hook. + (handle_source_transform): Handle EXTRA_prog_SOURCES form. + + * automake.in (handle_scripts): Never allow scripts_installed to + become 0. + + * scripts.am (install-@DIR@SCRIPTS): Scripts can be found in + srcdir. + + * automake.in (generate_makefile): Derived file names from given + input; don't assume Makefile.in and Makefile.am. + (am_file_name, in_file_name): New globals. + (read_am_file): Use them. + + * program.am (@PROGRAM@): Use transformed program name. + + * remake-hdr.am (stamp-h): Actually touch stamp-h. + +Wed Apr 3 15:16:06 1996 Tom Tromey + + * automake.in (require_file_internal): Use correct file for error + messages. Test insh.test. + +Mon Apr 1 09:47:44 1996 Tom Tromey + + * texinfos.am (.texi.info): Build output file in srcdir. + + * automake.in (require_file_internal): If $dir is ".",then look in + relative directory. + (handle_texinfo): Canonicalize name of texi file before looking + for dependency variable. + +Thu Mar 28 08:33:21 1996 Tom Tromey + + * automake.in (require_conf_file_with_conf_line): Yet another + function of this form. + (libtool_line): New variable. + (handle_libraries): Handle libtool. + + * libraries-vars.am: Removed. + + * automake.in (seen_libtool): New variable. + (scan_configure): Look for gm_PROG_LIBTOOL or AC_PROG_LIBTOOL. + + * automake.in (handle_dist_worker): Handle dist-local. + + * Makefile.am (maintainer-check): Do "make check" after all syntax + checks. + + * texi-version.am (stamp-@VTI@): Look for mdate-sh in appropriate + directory. + + * automake.in ($seen_arg_prog): New global. + (handle_programs): Error if AC_ARG_PROGRAM not seen. + (handle_scripts): Ditto. + (handle_configure): mkinstalldirs now a config file. + (handle_installdirs): Find mkinstalldirs in config_aux_dir. + (handle_dist_worker): Removed DIST_SUBDIRS. + (require_file_path): New variable. + (require_file_with_conf_line): Set it. + (require_file_with_line): Ditto. + (require_file): Ditto. + (require_file_internal): Incorporated code from + require_config_file. + (require_config_file): Rewrote. + (require_conf_file_with_line): New function. + (handle_texinfo): Use it for mdate-sh. + (handle_texinfo): Look for mdate-sh in appropriate directory. + +Tue Mar 26 13:47:54 1996 Tom Tromey + + * Makefile.am (cvs-dist): Find NEWS in srcdir. + * automake.in (handle_dist_worker): Find NEWS in srcdir. + ($RULE_PATTERN): Include chars "$(){}/" in allowable patterns in a + rule. + (require_config_file): Set config_aux_path when file found. + ($config_aux_dir): New variable. + (require_config_file): Set it. + (handle_man_pages): Find mkinstalldirs in config_aux_dir. + +Mon Mar 25 15:32:57 1996 Tom Tromey + + * data.am (install-@DIR@DATA): Also allow data to be in build + directory. + +Sun Mar 24 19:56:28 1996 Tom Tromey + + * automake.in (am_install_var): Don't look in EXTRA_primary + variable any more; it is handled in the main loop. + +Wed Mar 20 16:22:35 1996 Tom Tromey + + * data.am (install-@DIR@DATA): Find data in srcdir. + +Fri Mar 15 18:30:31 1996 Tom Tromey + + * automake.in (require_config_file): Use correct filename when + looking for errors. Also, install file in `.' if not found. Bug + reported by Gord Matzigkeit. Test installsh.test. + +Thu Mar 14 09:28:21 1996 Tom Tromey + + * Makefile.am (cvs-diff): New target. + + Fix for bug when install var substitutes empty. Test empty.test. + * header.am (install-@DIR@HEADERS): Allow empty list of headers. + (uninstall-@DIR@HEADERS): Ditto. + * scripts.am (install-@DIR@SCRIPTS): Allow empty list of scripts. + (uninstall-@DIR@SCRIPTS): Ditto. + * libraries.am (install-@DIR@LIBRARIES): Allow empty list of + libraries. + (uninstall-@DIR@LIBRARIES): Ditto. + * data.am (install-@DIR@DATA): Allow empty list of data. + (uninstall-@DIR@DATA): Ditto. + * programs.am (install-@DIR@PROGRAMS): Added missing semicolon. + From François Pinard. + (install-@DIR@PROGRAMS): Fixed bug when list of programs empty. + (uninstall-@DIR@PROGRAMS): Ditto. + +Wed Mar 13 19:50:23 1996 Tom Tromey + + * tags-subd.am (ID): Name of ID file must be flush against -f. + + * configure.in (VERSION): Version 0.32. + +Mon Mar 11 17:50:58 1996 Tom Tromey + + * automake.in (seen_linguas, all_linguas_line): New variables. + (handle_gettext): New function. + (generate_makefile): Run it. + (scan_configure): Recognize ALL_LINGUAS. + +Mon Mar 11 14:34:36 1996 Gord Matzigkeit + + * automake.texi: doc fix. + + * automake.in (am_install_var): Added support for check and + installcheck special prefixes. + +Sun Mar 10 10:44:42 1996 Tom Tromey + + * automake.in (handle_subdirs): Don't do SUBDIRS check for + gettext. + +Tue Mar 5 18:12:04 1996 Tom Tromey + + * automake.in (OBJECT_PATTERN): Removed. + (am_install_var): No error if name is invalid. + (handle_programs): Canonicalize program names. + (BOGUS_MACRO_PATTERN): New variable. + (read_am_file): Error if bad macro name given. + (require_file_internal): Use am_line_error, not am_conf_error. + + * program.am (@PROGRAM@): Recognize @PROGRAM@_DEPENDENCIES. + +Mon Mar 4 19:30:24 1996 Tom Tromey + + * automake.in (handle_lib_objects): New function. + (handle_libraries): Use it. + (handle_programs): Ditto. + (handle_dist_worker): Deprecate DIST_SUBDIRS. + (am_install_var): Allow extended directory mechanism to work. + Test exdir.test. + + * dist-vars.am (DISTFILES): Use EXTRA_DIST. + (DEP_DISTFILES): Ditto. + + * automake.in (OBJECT_PATTERN): New variable. + (am_install_var): Use it. + (handle_dist): DIST_OTHER is an anachronism. + +Sat Mar 2 17:04:38 1996 Tom Tromey + + * automake.in (handle_dist_worker): Only cause Automake to be + re-run if not making a distribution. Fixes bug reported by + Joerg-Martin Schwarz. + (require_file_with_line): New function. + (require_file): Use it. + (am_line_error): Don't print line number if $symbol is empty. + (get_object_extension): Use require_file_with_line. + (handle_libraries): Use require_file_with_line. + (handle_texinfo): Use require_file_with_line. + (handle_configure): Use am_conf_line_error and + require_file_with_conf_line. + (handle_subdirs): Use require_file_with_conf_line. + (handle_configure): Use require_file_with_conf_line. + (handle_tests): Push check-TESTS on @phony. + (am_conf_line_error): New function. + (require_file_with_conf_line): New function. + (require_file_internal): New function. + (require_file_with_line): Use it. + (require_file): Ditto. + (am_conf_line_error): Handle empty line number. + (ac_gettext_line, ac_output_line): New variables. + (scan_configure): Set them. + +Fri Mar 1 00:13:04 1996 Tom Tromey + + * automake.in (parse_arguments): Default strictness is gnu. + Changed `normal' to `foreign' everywhere. + (parse_arguments): Handle --foreign. + (initialize_global_constants): Document --foreign. + (handle_dependencies): Better error message. + (handle_texinfo): Don't push $vtexi on @texis. + (handle_texinfo): Only push $vtexi on @texi_deps if not null. + (handle_configure): install-sh is a config file; require it as + such. + (parse_arguments): Renamed --install-missing to --add-missing. + (add_missing): Renamed from install_missing. + (am_install_var): Check to make sure contents of install variable + are correct if primary requires it. Test badprog.test. + (initialize_global_constants): Initialize + %primary_uses_subobjects. + (handle_source_transform): Skip configure substitutions. Test + depend.test. Also, skip empty elements. + +Thu Feb 29 22:00:30 1996 Tom Tromey + + * texinfo.tex: New version. + + * automake.in (am_install_var): Allow extended range of + installation directories. + + * automake.in (get_object_extension): Don't allow + @CONFIG_INCLUDE_SPEC@ in the Makefile.in when config.h not used. + From Gord Matzigkeit. Test confincl.test. + + * texinfos.am (install-info): Changed usage of install-info (in + comment). Per Feb 25 GNU Standards document. + +Wed Feb 28 07:40:55 1996 Tom Tromey + + * automake.in (handle_tests): New function. + (generate_makefile): Call it. + (handle_subdirs): Skip directories whose names look like configure + substitutions. + (handle_subdirs): Require intl and po, not @INTLSUB@ and @POSUB@, + when using gettext. + (scan_configure): Clear in_ac_output if "]" found. Test + acoutqnl.test. + (require_config_file): New function. + (generate_makefile): Use require_config_file. + (config_aux_path): New variable. + (scan_configure): Check for AC_CONFIG_AUX_DIR. + (handle_merge_targets): Add install-strip rule. + +Tue Feb 27 20:00:36 1996 Tom Tromey + + * mdate-sh: New version from Ulrich Drepper. + + * automake.in (handle_source_transform): Changed fill back to + empty string. + (handle_libraries): Ditto. + (handle_dist): Ditto. + (handle_dependencies): Ditto. + (handle_footer): Ditto. + (handle_phony): Ditto. + + * Makefile.am (DIST_SUBDIRS): Removed. + (installcheck-local): Use Perl, not test -x. + (PERL): New macro. + (maintainer-check): Use $(PERL), not @PERL@. + + * configure.in (VERSION): Upped to 0.31. + +Sat Feb 24 18:02:19 1996 Tom Tromey + + * automake.in (scan_configure): AC_CHECK_TOOL requires config.sub + and config.guess. + + * automake.in: Use keyed_aclocal_warning when warning about + fp_PROG_INSTALL. + (get_object_extension): Use keyed_aclocal_warning when warning + about fp_C_PROTOTYPES. + (keyed_aclocal_warning): New function. + + * Makefile.am (pkgdata_DATA): Install aclocal.m4. + * aclocal.m4: Include fp_C_PROTOTYPES, fp_PROG_CC_STDC. + + * automake.in (get_object_extension): Only give error about + fp_C_PROTOTYPES once. + + * automake.in (seen_ranlib): New variable. + (scan_configure): Recognized AC_PROG_RANLIB. + (handle_libraries): Error if ranlib not checked for. + + * automake.in (default_strictness): Default to GNU. + (default_strictness_name): Ditto. + +Wed Feb 21 18:15:02 1996 Tom Tromey + + * automake.in (read_am_file): Removed @kr@ support. + (get_object_extension): Ditto. + + * Makefile.am (pkgdata_DATA): Include ansi2knr.c and ansi2knr.1. + +Tue Feb 20 17:25:18 1996 Tom Tromey + + * depend.am ($(srcdir)/.deps/%.P): Regexp fix. + +Mon Feb 19 19:53:09 1996 Tom Tromey + + * remake.am ($(srcdir)/Makefile.in): Depend on configure.in. + * remake-subd.am ($(srcdir)/Makefile.in): Depend on configure.in. + + * automake.in (handle_scripts): Ensure $scripts_installed set to + boolean value. Test proginst.test. + + * Makefile.am (installcheck-local): New target. + + * automake.in (require_file): No error if missing file is + installed. + +Sun Feb 18 17:10:00 1996 Tom Tromey + + * automake.in (handle_scripts): SCRIPTS no longer automatically + cleaned. Now possible to install scripts in pkgdatadir. + ($seen_canonical): New variable. + (generate_makefile): Check for config.guess and config.sub here; + fixes bug reported by Gord Matzigkeit. + + * Makefile.am (pkgdata_SCRIPTS): New variable. + (CLEANFILES): New macro. + + * scripts-clean.am: Removed. + +Sat Feb 17 00:15:20 1996 Tom Tromey + + * automake.in (am_install_var): Error if primary variable actually + defined. + (am_install_var): Skip elements that look like configure + substitutions. + (am_install_var): "EXTRA" is a valid prefix. + (am_install_var): Push contents EXTRA_PRIMARY onto @result. + (handle_merge_targets): Treat "all" target like "install". + (handle_subdirs): Don't push all-recursive. + + * header.am (install-@DIR@HEADERS): Don't depend on all. + * data.am (install-@DIR@DATA): Don't depend on all. + * libraries.am (install-@DIR@LIBRARIES): Don't depend on all. + * programs.am (install-@DIR@PROGRAMS): Don't depend on all. + * scripts.am (install-@DIR@SCRIPTS): Don't depend on all. + + * automake.in (am_install_var): Push generated install targets + onto @phony. + + * subdirs.am: No longer depend on Makefile and $(CONFIG_HEADER). + * automake.in (handle_merge_targets): Correctly handle recursive + calls of uninstall, install-exec, and install-data. + (handle_merge_targets): Put Makefile, and possibly $config_name, + onto @all. + (handle_merge_targets): Push 'all' onto @install as appropriate. + +Fri Feb 16 18:27:04 1996 Tom Tromey + + * automake.in (handle_configure): config.status is in + $(top_builddir), not $(top_srcdir). Reported by Anthony Green. + + * automake.in (scan_configure): Recognize (AC|fp)_FUNC_FNMATCH. + +Thu Feb 15 19:12:45 1996 Tom Tromey + + * automake.in: (seen_prog_yacc): New variable. + (scan_configure): Look for yacc. + (handle_source_transform): Skipp C++ header files. + (handle_source_transform): .cxx is a C++ source file. + +Wed Feb 14 08:36:02 1996 Tom Tromey + + * depend.am ($(srcdir)/.deps/.P): Use "echo", not ":". + + Implemented --verbose feature; idea from Greg Woods: + * automake.in (verbose): New global. + (generate_makefile): Print creating message if verbose. + (grep_for_vers_texi): Print message if verbose. + (handle_dependencies): Ditto. + (scan_configure): Ditto. + (read_am_file): Ditto. + (parse_arguments): Added --verbose. + (initialize_global_constants): Ditto. + + * automake.in (get_object_extension): Use am_line_error. + (handle_source_transform): Ditto. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (handle_dist): Ditto. + (handle_dist): Ditto. + (handle_subdirs): Ditto. + (handle_configure): Ditto. + (handle_merge_targets): Ditto. + (am_install_var): Ditto. + (am_line_error): Allow actual line number as argument. + (handle_configure): Use am_line_error. + (scan_configure): Set config_header_line. + (config_header_line): New global. + Use @PERL@ to find perl during exec. From Greg Woods. + +Tue Feb 13 22:06:51 1996 Tom Tromey + + * automake.in (initialize_per_input): Init %content_lines. + (read_am_file): Set appropriate content_lines elements while + reading. + (am_line_error): New function. + (read_am_file): Use it. + (handle_options): Ditto. + + * automake.in (scan_configure): Handle case where more than one .o + is put into LIBOBJS at once. Test libobj.test. + +Mon Feb 12 20:39:28 1996 Tom Tromey + + * automake.in (scan_configure): Ignore "\" in AC_OUTPUT line. + Test acouttbs.test. + (handle_subdirs): Restored intl, po warnings. + + * automake.in (scan_configure): Delete everything after "," or + ")". Test acoutnoq.test. + (handle_dist): Use $relative_dir, not nonexistent $subdir. + (handle_subdirs): 'po' and 'intl' are sometimes substituted into + SUBDIRS; don't warn about their absence. + +Sun Feb 11 16:55:15 1996 Tom Tromey + + * automake.in (handle_texinfo): Removed bogus error message. + + * automake.in (handle_texinfo): Push $(INFO_DEPS), not 'info', + onto @all. + (handle_options): Handle version number. + + * automake.in ($maint_charset, $dist_charset): New variables. + (initialize_per_input): Init $local_maint_charset. + (handle_dist): Handle DIST_CHARSET and MAINT_CHARSET. + (generate_makefile): Don't print "creating...". + +Sat Feb 10 16:45:07 1996 Tom Tromey + + * automake.in (get_object_extension): Substitute + @CONFIG_INCLUDE_SPEC@ if CONFIG_HEADER defined. + (handle_source_transform): Use $1, not \1. + (pretty_print_internal): Handle Tabs in fill when computing indent + on new line. + (handle_merge_targets): Always generate install-exec and + install-data targets. Test instexec.test. + Fixed error message if fp_PROG_INSTALL missing. + + * compile-vars.am (DEFS): Include -I., -I$(srcdir), and + @CONFIG_INCLUDE_SPEC@. + + * automake.in (scan_configure): Delete everything after "]". Test + acoutput.test. + + * configure.in (AC_OUTPUT): Create tests/Makefile. + * Makefile.am (SUBDIRS): New macro. + + * automake.in (handle_texinfo): Put $vtexi on texi_deps. From Jim + Meyering. + + * configure.in (AC_OUTPUT): Ensure automake is executable. + +Thu Feb 8 17:30:29 1996 Tom Tromey + + * automake.in (handle_subdirs): Error if directory in SUBDIRS does + not exist. + + * automake.in (handle_configure): Handle AC_OUTPUT ":" syntax. + + From Jim Meyering: + * libraries.am (install-@DIR@LIBRARIES): Depend on all, not + (@DIR@_LIBFILES). + * header.am (install-@DIR@HEADERS): Depend on all, not + $(@DIR@_HEADERS). + * data.am (install-@DIR@DATA): Depend on all, not $(@DIR@_DATA). + * scripts.am (install-@DIR@SCRIPTS): Depend on all, not + $(@DIR@_SCRIPTS). + * programs.am (install-@DIR@PROGRAMS): Depend on all, not + $(@DIR@_PROGRAMS). + + * automake.in (initialize_per_input): Initialize + $use_dependencies. + ($seen_path_xtra): New variable. + (scan_configure): Look for AC_PATH_XTRA. + (get_object_extension): Add variables to output if X seen. + +Thu Feb 8 10:02:45 1996 Greg A. Woods + + * automake.in (handle_programs): add pkglib to list of + directories for C + (various): include a tab as fill for continuation lines + printed with pretty_print*, esp. for macro variable assignments. + [ changed to 4 spaced by me ] + +Wed Feb 7 18:00:29 1996 Tom Tromey + + * configure.in (VERSION): Upped to 0.30. + + * Makefile.am (automake): Removed. + (DIST_OTHER): Removed. + + * automake.in (handle_source_transform): All dep_files are + relative to $(srcdir). + (handle_libraries): Ditto. + (scan_configure): Test for AC_PROG_INSTALL as well as + fp_PROG_INSTALL. Don't error here. + (seen_prog_install): Now global. + (scripts_installed): New global. + (handle_scripts): Set it. + Give error if appropriate install macro not seen. + (handle_subdirs): Ensure $seen_gettext before requiring + gettext-specific files. + (handle_configure): Automatically rebuild + + From Jim Meyering: + * automake.in (handle_source_transform): Use \W when quoting + regexp. When blah_SOURCES not explicitly defined, still create + entry in %deps. + * depend.am ($(srcdir)/.deps/%.P): Don't use \< in regexp. + * subdirs.am (maintainer-clean-recursive): Now depends on + $(CONFIG_HEADER) and Makefile. + + * automake.in (handle_source_transform): Skip macro references. + +Mon Feb 5 14:58:58 1996 Tom Tromey + + * automake.in (handle_texinfo): Include "rm" when deleting files. + + * Makefile.am (maintainer-check): Expect only one ${...}. + * texinfos.am (install-info): Remove unneeded ${...}. From Jim + Meyering. + + * automake.in (handle_configure): Only define CONFIG_HEADER if + $config_name. + ($seen_gettext): New variable. + (handle_subdirs): Do all gettext-related checking here. + (scan_configure): Just set $seen_gettext. + (handle_man_pages): Properly quote $(MANS). + +Wed Jan 31 09:51:30 1996 Tom Tromey (tromey@gerbil.cygnus.com) + + * depend.am: Don't use srcdir anywhere. + * automake.in (handle_libraries): Don't make .deps relative to + srcdir. + (handle_options): Recognize no-dependencies. + + * depend.am (MKDEP): From Jim Meyering: Do nothing if srcdir is + ".". Properly quote regexp. + +Tue Jan 30 12:19:09 1996 Tom Tromey (tromey@gerbil.cygnus.com) + + * automake.in (handle_configure): Only defined CONFIG_HEADER if + $config_name. + (read_am_file): Quote regexp when substituting top_builddir. + (handle_source_transform, handle_libraries): Look in + $(srcdir)/.deps for .P files. + +Fri Jan 26 00:15:25 1996 Tom Tromey + + * automake.in (am_conf_error): New function. + (scan_configure): Use it. + (scan_configure): A comma also ends AC_OUTPUT macro. + + * automake.in (read_am_file): Compute top_builddir when including + header-vars.am. + (handle_configure): Use $top_builddir, not $top_reldir. + (other_input_files): New variable. + (dirname): Fixed bug where dirname of 'a/b/c' was 'a', not 'a/b'. + + Changes from Gord Matzigkeit to enabled hierarchies deeper than 2: + * automake.in (input_files, seen_make_set): Declare globally. + (parse_arguments): Use input_files, not make_list. + Only scan configure.in once. + (handle_dist): Use SUBDIRS to determine when to make + subdirectories and recurisvely dist. Use $(topdir), not "..", to + find top of dist tree. + (handle_configure): Check for AC_PROG_MAKE_SET here. Don't require + configure.in (done elsewhere). + (scan_configure): seen_make_set is global. Allow arbitrary space + in LIBOBJS assignment. + (top_builddir): New variable. + * header-vars.am (top_builddir): New variable. + * remake-subd.am (Makefile): Look in top_builddir, not .., when + remaking. + * automake.in (handle_merge_targets): Run 'all' before + check-recursive. + + * automake.in (file_contents_with_transform): Changed error + message. + (handle_configure): Define $contents{'CONFIG_HEADER'}. + + * texi-version.am: Many changes to support multiple .texi files. + Replaced "version.texi" with "@VTEXI@". Replaced "vti" with + "@VTI@". + * automake.in (handle_configure): install.sh is an anachronism. + (handle_texinfo): Generalized for multiple .texi files. Handle + 'clean-info' internally. + * texi-clean.am: Removed. + * Makefile.am: Updated for removal. + +Wed Jan 24 22:55:32 1996 Tom Tromey + + * automake.in (grep_for_vers_texi): New function. + (handle_texinfo): Use grep_for_vers_texi, not system("grep"). + (handle_texinfo): Changes to generalize to multiple .texi files. + +Tue Jan 23 14:22:16 1996 Tom Tromey + + Fixes from Gord Matzigkeit: + * libraries.am (install-@DIR@LIBRARIES): Use top_srcdir, not + topsrcdir. + * header.am: New file. + * Makefile.am (pkgdata_DATA): Install header.am. + * automake.in (handle_headers): Use header.am, not data.am. + (am_install_var): Allow pattern to be compiled multiple times. + + * config.guess, config.sub: New files. + * Makefile.am (pkgdata_DATA): Install config.guess and + config.sub. + * automake.in (scan_configure): Recognize AC_CANONICAL_HOST and + AC_CANONICAL_SYSTEM. + +Sun Jan 21 15:51:48 1996 Tom Tromey + + * automake.in (handle_texinfo): Use info_TEXINFOS, not TEXINFOS. + (handle_man_pages): Use man_MANS, not MANS. + + * Makefile.am (info_TEXINFOS): Renamed. + + * automake.in (scan_configure): Remove comments from input line. + (am_variable): Removed. + + * remake-hdr.am (stamp-h): Use new macro CONFIG_HEADER_IN. + + * automake.in (config_name, config_header): New globals. + (scan_configure): Look for AC_CONFIG_HEADER. + (handle_configure): Handle more uses of AC_CONFIG_HEADER. + +Sat Jan 20 15:54:24 1996 Tom Tromey + + * automake.in (handle_dist_worker): Bug fix. + +Fri Jan 19 00:50:29 1996 Tom Tromey + + * automake.in (require_file): Install missing files only according + to desired strictness. + (initialize_per_input): Don't init libsources. + (scan_configure): Reinit libsources. + (handle_libraries): Search _LIBADD for @LIBOBJS@ and @ALLOCA@. + (fp_c_prototypes): New global. + (scan_configure): Set it. + (get_object_extension): Error if fp_C_PROTOTYPES not in + configure.in when using ansi2knr. + (handle_source_transform): Skip header files. + + * automake.in (handle_dist_worker): Explicitly make 'dist' in + subdirs. + +Thu Jan 18 00:25:56 1996 Tom Tromey + + From François Pinard: + * automake.in (handle_source_transform): Transform $o file into .P + file. + (handle_dist_worker): Handle case where DISTFILES includes + wildcard. Bug fix in subdir case. + + * automake.in (parse_arguments): Initialize strictness to + 'normal'. + +Sun Jan 14 13:54:16 1996 Tom Tromey + + * automake.in (scan_configure): Look for NLS support. + + Changes from François Pinard: + * texinfos.am (install-info): Correctly install when build dir is + not srcdir. + * tags-subd.am (ID): Indentation change. + * kr-vars.am (o): Use ".@U@o", not "@U@o". + * depend.am ($(srcdir)/.deps/%.P): Remove temporary file. + * automake.in (handle_dist_worker): Fixlets. + (handle_dist): Sort keys going into dist_common. + +Sat Jan 13 00:18:06 1996 Tom Tromey + + * automake.in (handle_dist_worker): If Gnits, don't allow release + until NEWS is updated. + + * configure.in (VERSION): Version 0.29. + + * Makefile.am (maintainer-check): Look for perl4.036 in path. + + * dist-vars.am (DISTFILES): Include BUILT_SOURCES. + (DEP_DISTFILES): Ditto. + + * automake.in (handle_dist_worker): Depend on DEP_DISTFILES. + * dist-vars.am (DEP_DISTFILES): New variable. + + * automake.in (handle_options): Support dist-shar option. + (handle_dist_worker): New function. + (handle_dist): Use it. + + * texi-version.am (mostlyclean-vti): Remove version.tmp, not + *.tmp. + + * automake.in (handle_dist): Chmod distdir 777. From François + Pinard. + + * automake.in (scan_configure): New function. + (initialize_per_input): Init libsources. + (generate_makefile): Run handle_configure first. + (handle_configure): Run scan_configure. + (handle_configure): Don't look for AC_PROG_MAKE_SET here. + +Thu Jan 11 23:14:18 1996 Tom Tromey + + * Makefile.am (AUTOMAKE_OPTIONS): New variable. + + * automake.in (strictness, strictness_name): Renamed. + (initialize_per_input): Set strictness, strictness_name. + Initialize %options. + (generate_makefile): Run handle_options. + (handle_options): New function. + (handle_man_pages): Make install-man depend on $(MANS). Turn off + man page install if no-installman option given. + (read_am_file): Deprecate @kr@. + (get_object_extension): Look at ansi2knr option. + (parse_arguments): Take global strictness from command-line + options. + +Tue Jan 9 11:24:14 1996 Tom Tromey + + Fixes from François Pinard: + * depend.am ($(srcdir)/.deps/%.P): Handle deansification. + * automake.in (get_object_extension): Use $o, not $(kr)o. + (handle_source_transform): Don't look for $(kr)c files. + * kr-vars.am (o): New macro. + (kr): Removed. + + * depend.am (DEP_FILES): Removed. + * automake.in (handle_source_transform): Push .P file onto + dep_files. + (initialize_per_input): New variable %dep_files. + (handle_dependencies): Generate DEP_FILES here. + +Mon Jan 8 22:27:33 1996 Tom Tromey + + * automake.in (do_one_clean_target): Only remove config.status in + top-level directory. + (handle_tags): Removed 'id' from .PHONY list. From Jim Meyering. + + * clean.am (maintainer-clean-generic): Remove BUILT_SOURCES. + + * automake.in (handle_dist): Make "ln" quiet. + + * tags-subd.am (ID): Depend on HEADERS and SOURCES. + +Sat Jan 6 10:58:23 1996 Tom Tromey + + * automake.in (handle_merge_targets): 'check' shouldn't depend on + 'all' at top level. + (file_contents_with_transform): New function. + (am_install_var): Use file_contents_with_transform. + (handle_programs): Ditto. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_merge_targets): Let 'install' depend on 'all' if no other + dependencies exist. From Jim Meyering. + (check_gnu_standards): GNU requires AUTHORS file. (See + maintain.text). + (require_file): Put body in loop. + (get_object_extension): Only call require_file once. + (handle_configure): Ditto. + + From Jim Meyering: + * depend.am ($(srcdir)/.deps/.P): Depend on $(BUILT_SOURCES). + * tags-subd.am (id): Removed. + +Fri Jan 5 10:31:19 1996 Tom Tromey + + * Added copyright notice to each .am file. + + * automake.in: Cleanups from François Pinard to avoid $#. + (require_argument): Fixed sense of test. + (set_strictness): Bug fix. + +Thu Jan 4 21:21:29 1996 Tom Tromey + + * Makefile.am (pkgdata_DATA): Removed old dist files. + + * dist-subd-top.am, dist-subd.am, dist.am: Removed. + + * automake.in (set_strictness): Set $strictness_name. + (strictness_name): New variable. + (handle_dist): Substantially rewrote. + + * configure.in: Point AC_INIT at automake.in. + + * automake.in (generate_makefile): Report errors against + Makefile.in, not Makefile.am. + +Wed Jan 3 00:05:40 1996 Tom Tromey + + * mdate-sh: Bug fix from Jim Meyering. + + * dist.am (dist): Changed in parallel with dist-subd-top.am. + + * mkinstalldirs: Reverted. + + * automake.in (initialize_global_constants): Allow COPYING.LIB + again. + (check_gnits_standards): Disallow COPYING.LIB. + + * texinfos.am (install-info): Only look in $(srcdir) for info + files. + + * automake.in (initialize_global_constants): New variable + gen_copyright. + (read_am_file): Put a copyright in each Makefile.in. + + * dist-vars.am (DISTFILES): Put DIST_COMMON first. + + * automake.in (am_install_var): Put space before "=". + (handle_dist): Put README first in DIST_COMMON. + + * Makefile.am (pkgdata_DATA): Include COPYING. + + * COPYING: New file. + + * automake.in (parse_arguments): Added --gnu and --gnits as + synonyms. + (initialize_global_constants): Ditto. + (initialize_global_constants): Don't auto-distribute COPYING.LIB. + (initialize_global_constants): Look for README first. + (initialize_global_constants): Auto-distribute AUTHORS, BACKLOG, + ABOUT-GNU. + (check_gnu_standards): Require file COPYING. + + From François Pinard: + * automake.in (file_contents): Comment out "warn"s. + (usage): Use 4 columns. + (USAGE_FORMAT): Ditto. + + * texinfos.am (install-info): Look for info file relative to $$d. + + * Makefile.am (cvs-dist): Suppress output of "grep". + + * configure.in (VERSION): Version 0.28. + + * automake.in (pretty_print_internal): Fix for Perl 4 + compatibility. + + * configure.in (VERSION): Version 0.27. + + * depend.am ($(srcdir)/.deps/%.P): Must regexp-quote srcdir in sed + invocation. + + * automake.in (initialize_global_constants): Don't quote "@" in + $install_man_format. + (handle_merge_targets): use "@:" as empty command, not ":". + +Tue Jan 2 23:33:24 1996 Tom Tromey + + * texinfos.am (install-info): Look in $d for info files. From + François Pinard. + + * depend.am ($(srcdir)/.deps/%.P): Fixed regexp. + + * automake.in (read_am_file): Correctly deal with continued + variable definitions. + +Mon Jan 1 15:43:25 1996 Tom Tromey + + * automake.in (handle_merge_targets): 'check' target depends on + 'all'. + (file_contents): Don't be so verbose. + (read_am_file): Ditto. + (read_am_file): Must use substr to check for trailing \. + (am_install_var): Use push_phony_cleaners. + (file_contents): Set $was_rule when assuming a rule is seen. + (read_am_file): Ditto. + (do_one_clean_target): Removed spurious newline. + + Some changes from François Pinard: + * Removed trailing whitespace from all '.am' files. + * tags-subd.am (ID): Use &&, not ;. + (TAGS): Ditto. + * automake.in (parse_arguments): Removed useless message. + (parse_arguments): Don't explicitly referenced STDERR. + (require_argument): Ditto. + (am_error): Ditto. + (set_strictness): Ditto. + (file_contents): Ditto. + (read_am_file): Ditto. + (generate_makefile): Style tweaks. + (handle_programs): Ditto. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (handle_tags): Ditto. + (handle_dist): Ditto. + (handle_subdirs): Ditto. + (handle_configure): Ditto. + (handle_footer): Don't put newline before footer.am contents. + (handle_merge_targets): Style tweaks. + (do_one_clean_target): Ditto. + (dirname): Ditto. + (am_variable): Ditto. + Defined some new constants. + (generate_makefile): Don't call generate_header. + (generate_header): Removed. + (file_contents): Rewrote. + (read_am_file): Rewrote. + + * automake.in (generate_makefile): Handle phony target. + (do_one_clean_target): Pretty-print dependencies. + (handle_installdirs): Pretty-print rule. + + * Makefile.am (maintainer-check): Made some commands silent. + + * automake.in (initialize_global_constants): Don't install or + uninstall cat'd man pages. + (initialize_per_input): Added phony target. + (push_phony_cleaners): New function. + (get_object_extension): Handle phony targets. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (handle_tags): Ditto. + (handle_dist): Ditto. + (handle_subdirs): Ditto. + (handle_installdirs): Ditto. + (handle_merge_targets): Ditto. + (handle_clean): Ditto. + (do_one_merge_target): Ditto. + (am_install_var): Ditto. + (handle_phony): New function. + (generate_makefile): Call it. + (pretty_print_internal): New function. + (pretty_print_rule): Ditto. + +Sun Dec 31 13:04:59 1995 Tom Tromey + + * automake.in (initialize_global_constants): Don't print body of + loop at make time. + + Changes from François Pinard: + * depend.am (MKDEP): Include DEFS, INCLUDES, CPPFLAGS, CFLAGS. + (DEP_FILES): Put dependency files in $(srcdir). + Look in $(srcdir) when including dependency files. + ($(srcdir)/.deps/.P): .deps/.P is in $(srcdir). + (.deps/%.P): MKDEP includes all macro expansions. + * dist-subd-top.am (dist): Get absolute path for distdir. Don't + be so verbose. + * dist-subd.am (dist): Don't be so verbose. + * dist.am (dist): Don't be so verbose. + + * automake.in (do_one_clean_target): Remove config.status in + maintainer-clean. From Jim Meyering. + + * programs-clean.am (clean-@DIR@PROGRAMS): Bug fix. From Jim + Meyering. + + * automake.in (handle_merge_targets): Add dummy command for empty + install target. From Jim Meyering. + +Tue Dec 12 10:06:28 1995 Tom Tromey + + * texinfos.am (uninstall-info): Bug fix. + + * Makefile.am (maintainer-check): Error if ${...} used. + * depend.am (DEP_FILES): Prefer $(...). + + * scripts.am (install-@DIR@SCRIPTS): Only install script if it + exists. + * libraries.am (install-@DIR@LIBRARIES): Only install library if + it exists. + * programs.am (install-@DIR@PROGRAMS): Only install program if it + exists. + + * texinfos-vars.am (TEXFILES): Removed. + + * Makefile.am (pkgdata_DATA): Removed libprograms.am. + + * automake.in (do_one_merge_target): Never generate trailing + whitespace. + (pretty_print): New function. + (handle_footer): Prettyprint definitions. + (am_install_var): Ditto. + (handle_source_transform): Ditto. + (handle_dist): Ditto. + (handle_libraries): Ditto. + (read_am_file): Put comments nearer appropriate code. + + * texi-clean.am (mostlyclean-info): Use continued lines, not + multiple rm's. From Jim Meyering. + +Sun Dec 10 11:59:33 1995 Tom Tromey + + * Makefile.am (pkgdata_DATA): Cause INSTALL, install-sh, mdate-sh, + mkinstalldirs, texinfo.tex to be installed. + * automake.in (symlink_exists): New global. + (install_missing): Ditto. + (require_file): Install missing files if possible. + (parse_arguments): Handle --install-missing option. + (initialize_global_constants): Document --install-missing. + + * Makefile.am (cvs-dist): Don't release unless NEWS updated. + Ensure 'checks' pass before release. + (maintainer-check): Renamed. Look in $(srcdir) for sources. From + Franc,ois Pinard. + (cvs-dist): Depend on maintainer-check instead of explicitly + running check. + + * configure.in (VERSION): Version 0.26. + + * Makefile.am (check-local): Only look at [a-z]*.am. Fixed sense + of 'if' test. + + * depend.am (DEP_FILES): Bug fix. + + * automake.in (do_one_clean_target): Typo. + + * Makefile.am (check-local): Run syntax check under Perl 4. + + * automake.in: Fixes for Perl 4, from Gord Matzigkeit. + (handle_source_transform): Loop variable is now $_. From Gor + + * Makefile.am (check-local): Check for 'true' in source. + * texinfos.am (install-info): Can't use "true" in any rule. + +Sat Dec 9 10:16:48 1995 Tom Tromey + + * Makefile.am (cvs-dist): New target. + + * tags.am (TAGS): Use "test -z ... ||" to avoid spurious + failures. + + * texinfos.am (install-info): Don't do install-info for now. + + * clean.am (distclean-generic): Don't remove config.status here. + * automake.in (do_one_clean_target): Remove config.status later, + for 'make -j2'. From Jim Meyering. + +Fri Dec 8 16:30:48 1995 Tom Tromey + + * configure.in (VERSION): Version 0.25. + + * automake.in (handle_texinfo): Use "$? >> 8", not "$?". + (handle_configure): Check for AC_PROG_MAKE_SET. + + * depend.am (DEP_FILES): Handle deANSIfication case. From Jim + Meyering. + + * automake.in (am_install_var): Changed how 'clean' handled for + uniform name targets. + * Makefile.am (pkgdata_DATA): Added new files. + * data-clean.am: New file. + * scripts-clean.am: New file. + * libraries-clean.am: New file. + * programs-clean.am: New file. + +Wed Dec 6 00:06:11 1995 Tom Tromey + + * automake.in (am_install_var): Error if variable name + "misspelled". + (handle_source_transform): Automatically include .c file + corresponding to .y or .l. + +Tue Dec 5 00:46:14 1995 Tom Tromey + + * programs.am: Changed for uniform naming scheme. + + * automake.in (read_am_file): Allow '-' and '.' in target names. + (generate_makefile): Don't pass arguments to handle_libraries. + (initialize_per_input): Define @sources, @objects. + (generate_makefile): Init @sources, @objects if needed. + (handle_source_transform): Push onto @sources, @objects here. + (am_install_var): Push primary onto @all, for configure-time + customization. + (handle_programs): Use new uniform naming scheme. + + * Makefile.am (check-local): New target. + + * automake.in (handle_libraries): Use uniform naming scheme. + + * libraries.am: Rewrote for uniform naming scheme. + + * scripts.am: Updated names of all clean targets. + + * automake.in (handle_programs): Split on all whitespace. + (handle_libraries): Ditto. + (handle_texinfo): Ditto. + (handle_man_pages): Ditto. + (am_install_var): Changed return result. + (am_install_var): Changed interface. + (am_install_var): Push onto @clean@ if requested. + (handle_scripts): Pass -clean to am_install_var. + +Mon Dec 4 11:55:36 1995 Tom Tromey + + * automake.in (am_install_var): Push target onto @all. + (get_object_extension): Use $(...). + (handle_source_transform): Ditto. + (handle_programs): Ditto. + + * automake.in (require_argument): New function. + (parse_arguments): Use it. + (push_dist_common): New function. + (generate_makefile): Use it. + (handle_texinfo): Ditto. + (handle_dist): Ditto. + (handle_configure): Ditto. + (require_file): Ditto. + (generate_makefile): Don't pass arguments to handle_scripts. + (handle_configure): Require configure.in. + (check_gnu_standards): New function. + (check_gnits_standards): Ditto. + (generate_makefile): Check standards. + + * Makefile.am (bin_SCRIPTS): Changed name from SCRIPTS. + + * automake.in (LENIENT, GNU, GNITS): New constants. + (initialize_per_input): New function. + (generate_makefile): Use it. + (initialize_global_constants): Renamed from init_globals. + (require_file): Added strictness argument. + (parse_arguments): Added --strict option. + (set_strictness): New function. + (parse_arguments): use it. + (initialize_global_constants): Document --strictness. + + * automake.in: Use ${1+"$@"} to preserve quoting when running + under sh. + + * texinfos.am (install-info): Don't use "true". + * tags.am (TAGS): Don't use "true". + + * dist.am, dist-subd-top.am, remake-hdr.am, remake-subd.am, + remake.am, subdirs.am, texinfos.am: Use "&&" after cd. + + * program.am (@PROGRAM@): Use LINK macro. + * compile.am (.c.o): Use COMPILE macro. + + * clean.am, remake-hdr.am, remake.am, texinfos.am: Use $(...), not + ${...}. + + * subdirs.am (RECURSIVE): Removed macro. + + * clean.am: Changed to not be so verbose. + + * Makefile.am (pkgdata_DATA): Include texi-clean.am. + * automake.in (handle_texinfo): Transform texi-clean and put into + output rules. + * texinfos-vars.am (TEXFILES): Removed. + * texinfos.am: Removed 'clean' targets. + * texi-clean.am: New file. + + * Makefile.am (ETAGS_ARGS): Just use 'automake.in'. + + * texinfos-vars.am (TEXFILES): Added *.op. + + * dist-vars.am (DISTFILES): Renamed from DIST_FILES, per GNU + standards. + * dist.am (dist): Use DISTFILES. + * dist-subd.am (dist): Use DISTFILES. + * dist-subd-top.am (dist): Use DISTFILES. + +Sun Dec 3 00:24:08 1995 Tom Tromey + + * Makefile.am (ETAGS_ARGS): Define. + + * depend.am (.deps/.P): Use ":", not "echo timestamp". From Jim + Meyering. + + * dist-vars.am (DIST_FILES): Removed PACKAGEDATA. + + * automake.in (handle_scripts): Use am_install_var. + + * scripts.am: Rewrote for new uniform naming scheme. + + * Makefile.am (pkgdata_DATA): Removed libscripts.am. + + * libscripts.am: Removed. + + * packagedata.am: Removed. + + * Makefile.am (PACKAGEDATA): Removed packagedata.am. + (pkgdata_DATA): Renamed from PACKAGEDATA. + + * automake.in (handle_data): Use am_install_var. + (init_globals): Init %exec_dir_p. + + * data.am: Rewrote for new uniform naming scheme. + + * automake.in (get_object_extension): New function. + (handle_programs): Use it. + (dir_holds_sources): Changed interpretation. + (handle_headers): New function. + (am_install_var): New function. + (generate_makefile): Call handle_headers. + + * header-vars.am (pkgdatadir): New macro. + (pkglibdir): Ditto. + (pkgincludedir): Ditto. + + * automake.in (handle_source_transform): New function. + (am_error): New function. + (generate_makefile): Use it. + (handle_source_transform): Ditto. + (handle_texinfo): Ditto. + (handle_dependencies): Ditto. + (handle_merge_targets): Ditto. + (require_file): Ditto. + +Sat Dec 2 21:39:56 1995 Tom Tromey + + * automake.in: Updated FSF address. From Jim Meyering. + * header-vars.am: Updated FSF address. + + * distname.am: Removed. + + * automake.in (file_contents): Strip "##" comments. + * Various files: Added "##" comments for strange things. + + * automake.in (handle_tags): Generate TAGS rule for every + directory. + + * subdirs.am (RECURSIVE): Include installcheck-recursive. + * automake.in (installcheck): New variable. + (generate_makefile): Initialize it. + (handle_subdirs): Push 'installcheck-recursive'. + (handle_merge_targets): Handle installcheck target. + +Thu Nov 30 20:13:16 1995 Tom Tromey + + * automake.in ($PACKAGE): Removed. + + * header-vars.am (ALL): Removed. + + * automake.in: Reworked 'all' target handling. + + * automake.in (generate_makefile): + Don't use AM_ forms in call to am_variable. + + * automake.in: Changes for Perl 5, from Gord Matzigkeit + + * clean.am (MOSTLYCLEANFILES, MAINTAINERCLEANFILES): New variables. + + * automake.in (handle_footer): Allow SUFFIXES variable. + + * automake.in (am_variable): New function. + (handle_texinfo): Use it. + (generate_makefile): Use it. + + * configure.in: Version 0.24. + +Wed Nov 29 23:50:14 1995 Tom Tromey + + * automake.in (handle_libraries): + Generate blah_LIBADD defines if required. + + * library.am (lib@LIBRARY@.a): Look at $(@LIBRARY@_LIBADD) + + * libraries-vars.am (LIBOBJS, ALLOCA): Removed. + + * compile-kr.am: ($(OBJECTS)): Depend on $(ANSI2KNR), not ansi2knr. + + * configure.in: Version 0.23 + + * dist-subd-top.am (dist): Don't die if a subdirectory already exists. + + * dist-subd-top.am, dist.am (dist): Give automake --output-dir option. + + * automake.in: New option --output-dir + + * automake.in (handle_configure): Fixed typo. + + * automake.in (handle_installdirs): Always make installdirs target. + + * subdirs.am (RECURSIVE): Removed uninstall-data-recursive and + uninstall-exec-recursive. Added installdirs-recursive. + + * automake.in (handle_installdirs): Handle installdirs-recursive. + (handle_man_pages): 'all' depends on $(MANS) + + * Makefile.am: Removed mans.am. + + * automake.in: More man-related fixes + + * automake.in: Bug fixes + + * automake.in: Rewrote man page handling. + + * texi-version.am, remake-hdr.am, depend.am: Don't use touch. + + * automake.in (handle_installdirs): New function. + (@installdirs): New global. + Many changes to deal with installdirs. + + * clean.am (clean-generic): Always supply 'else' clause to 'if' + + * automake.in (generate_header): Don't use header.am. + (handle_dist): Don't use dist-subd-vars.am. + + * Makefile.am (PACKAGEDATA): Removed dist-subd-vars.am, header.am. + + * Makefile.am (DISTCLEANFILES): Removed. + + * clean.am (clean-generic): Bug fix. + + * clean.am (clean-generic): Only remove CLEANFILES if nonempty + + * texi-version.am (clean-vti): No such macro as VTI + +Tue Nov 28 19:56:07 1995 Tom Tromey + + * automake.in: Bug fix for maintainer-clean + + * automake.in (do_one_clean_target): + Print special text in maintainer-clean. + (handle_clean): Always include clean.am + + * clean.am: Use -generic clean targets. + + * compile.am: Added clean targets. + + * configure.in: Version 0.22. + + * automake.in (handle_dependencies): + Put trailing newline after all deps. + + * automake.in (handle_dependencies): Another dependency bug fix. + + * automake.in (handle_dependencies): + Bug fix when including dependencies. + + * automake.in (handle_configure): + Verify existence of install-sh, mkinstalldirs + + * automake.in (handle_texinfo): Include stamp-vti in distribution + + * dist-subd-vars.am, dist-vars.am (DIST_FILES): + Include DATA, PACKAGEDATA. + + * Makefile.am: Nothing + + * Makefile.am (DIST_OTHER): Don't distribute gettext-sh + + * automake.in (handle_texinfo): Typo + + * automake.in: If script ends up in shell, feed to perl + + * automake.in: Rewrote 'clean' rules. + Documentation made and installed first. + 'all' depends on 'info' + +Mon Nov 27 23:57:29 1995 Tom Tromey + + * configure.in, Makefile.am: Turned off internationalization. + + * clean-kr.am: Rewrote for new clean scheme. + + * tags-clean.am: Remove TAGS in distclean, not maintainer-clean + + * Makefile.am (PACKAGEDATA): Include tags-clean.am + + * subdirs.am: Removed bogus local clean targets + + * tags-clean.am: Initial revision + + * texi-version.am: Added clean targets + + * texinfos.am: Fixes to clean targets. + + * texinfos.am, libscripts.am, scripts.am, libraries.am, libprograms.am, programs.am: + Added clean targets + + * compile-kr.am (ansi2knr.o): Depend on CONFIG_HEADER + + * automake.in: Completely revamped automatic de-ANSI-fication + + * compile-kr.am: (ansi2knr, $(OBJECTS)): New targets + + * compile-vars.am (LINK): New macro + + * kr-vars.am: Trailing blank line + + * compile-kr.am: Rewrote + + * compile-vars.am (COMPILE): New macro + + * compile-vars.am (ANSI2KNR): Removed + + * Makefile.am (PACKAGEDATA): Removed all sed scripts. Added kr-vars.am + + * kr-vars.am: Initial revision + + * automake.in (require_file): New function. + (handle_texinfo): Require 'mdate-sh' + (common_sometimes): New variable + (usage): Use it. + + * texi-version.am (stamp-vti): Use Ulrich's mdate-sh script + + * mdate-sh: Initial revision + + * automake.in (handle_footer): Don't define SOURCES or OBJECTS if empty + + * automake.in (generate_makefile): + Put Makefile.in, Makefile.am in @dist_common + (handle_configure): Use @dist_common as appropriate + + * dist-subd-vars.am, dist-vars.am (DIST_CONF): Removed + + * configure.in: Abort if perl not found + + * configure.in: Look for perl + + * automake.in: Reimplemented in Perl + + * automake.in: Fixlet + +Sun Nov 26 08:09:30 1995 Tom Tromey + + * automake.in: Always print ".SUFFIXES:" rule. + + * automake.in: Distribution config.h.in if required + + * automake.in: Bug fix when including texi-version.am + + * automake.in: Bug fix when looking for .texi file in $am_reldir + + * depend.am: Comment fix + + * automake.in: Look for .texi file in $am_reldir + + * automake.in: Fixlet + + * automake.in: Blank line after targets from user's Makefile.am + + * automake.in: Move footer items to actual footer + + * automake.in: Include stamp-h.in in DIST_COMMON if necessary + + * automake.in (common): + Don't include acconfig.h, config.h.top, config.h.bot + + * Makefile.am (CONFIG_HEADER): Renamed from CONFIG_H + + * Makefile.am (CONFIG_H): Define + + * acconfig.h: Initial revision + + * configure.in: Use AC_CONFIG_HEADER. + + * automake.in: Put blah_TEXINFOS into DIST_COMMON + + * automake.in: .info file explicitly depends on primary .texi file + + * texinfos.am (install-info): Always supply 'else' clause to 'if' + + * tags.am (TAGS): Always supply 'else' clause to 'if' + + * subdirs.am (.NOEXPORT): Removed (now in footer.am) + + * automake.in: Always include footer.am in output + + * mans.am (install-man): Always supply 'else' clause to 'if' + + * automake.in: More version.texi fixes + + * automake.in: Only do version.texi processing if requested. + + * automake.in: Minor internationalization fixes. + Subshell can now exit with nonzero status. + Fixed up .texi handling; now uses texi-version.am + Make sure '.c' and '.o' are in .SUFFIXES if required. + + * Makefile.am (PACKAGEDATA): Include texi-version.am + (stamp-vti, version.texi): Removed + (TEXINFOS): Don't reference version.texi + + * texi-version.am: Initial revision + + * dist.am, dist-subd-top.am (dist): + [DIST_SUBDIRS] Follow symlinks when copying. + + * dist-subd-top.am (dist): Removed unneeded subdir= option to make + +Sat Nov 25 23:23:39 1995 Tom Tromey + + * automake.in: Added --amdir option + + * Makefile.am, configure.in: Turned on internationalization + + * Makefile.am: Set EDITION + + * configure.in: Version 0.21 + + * tags.am, tags-subd.am: Don't use double-colon rules + + * automake.in: Redid install-data, install-exec, uninstall handling + + * configure.in: Turn off i18n + +Fri Nov 24 23:51:37 1995 Tom Tromey + + * automake.in (common): Remove NLS + + * automake.in (common): Include ABOUT-NLS. + + * automake.in: Test for install-sh and mkinstalldirs + + * automake.in: Blank line after OBJECTS= line + + * automake.in: Start subshell in loop after check for Makefile.am + + * automake.in: --use-deps now the default + + * automake.in (am_dir): Don't apply transform to install directory name + + * packagedata.am: Don't apply transform to install directory name + + * Makefile.am (SUBDIRS): Hold off on internationalization + +Thu Nov 23 18:02:38 1995 Tom Tromey + + * automake.in: + Write 'SOURCES =' line after copying Makefile.am variables + + * automake.in: Fixed bug in "--" option processing + + * subdirs.am: ($(RECURSIVE)): Removed trailing \ from last line + + * Makefile.am (DIST_OTHER): Include gettext-sh + + * Makefile.am (SUBDIRS): Define + + * configure.in: Include internationalization bits + + * automake.in: Many changes to avoid double-colon rules. + + * subdirs.am: ($(RECURSIVE)): Print name of target actually used + + * subdirs.am: Removed "::" rules + + * header.am: Removed install, uninstall + + * header.am: Added install, uninstall targets + + * hack-make.sed: Rewrite targets like "all-local" to "all_local" + + * header.am, libraries.am, mans.am, texinfos.am, footer.am: + Removed "::" rules + + * Makefile.am (PACKAGEDATA): Include libscripts.am + + * libprograms.am: Don't install libscripts here + + * libscripts.am: Initial revision + + * scripts.am, programs.am, libprograms.am: Removed "::" rules + + * automake.in (am_dir): Run package name through name transform. + + * automake.in: Don't use packagedata.sed or data.sed + + * Makefile.am (PACKAGEDATA): Removed data.sed, packagedata.sed. Added + packagedata.am + + * data.am: No longer run through sed + + * packagedata.am: Initial revision + +Wed Nov 22 22:31:02 1995 Tom Tromey + + * automake.in: No blank line after Usage + + * automake.in: Removed "NLS nuisances" section. + Now uniformly uses $echo for user-visible messages (in advance of + internationalization) + + * subdirs.am (maintainer-clean): Don't use realclean-local + + * Makefile.am: Use PACKAGEDATA, not custom code + + * data.am: Use @LONG@, not $(@LONG@) + + * automake.in: Handle DATA and PACKAGEDATA + + * packagedata.sed: Initial revision + + * data.am: Use @DIR@, not $(@DIR@) + + * data.sed: Use $(datadir), not datadir + + * data.sed: Initial revision + + * data.am: Wrote uninstall targets + + * data.am: Initial revision + + * dist-subd.am (dist): Don't link a file that has already been linked + + * dist-subd-top.am, dist.am (dist): + Run `automake --include-deps' before making distribution + + * automake.in: More dependency-tracking bug fixes + + * dist-vars.am (DIST_FILES): Rearranged to be like dist-vars-subd.am + + * dist-subd-vars.am (DIST_FILES): Include DIST_COMMON + + * tags-subd.am, tags.am: Added trailing blank line + + * depend.am: Use ".P", not "empty.P", as placeholder. + + * automake.in: Only include depend.am if SOURCES not empty + + * automake.in: Added --use-deps and --include-deps options. + Handle auto-generating dependencies. + + * Makefile.am (am_DATA): Include depend.am + + * depend.am: Initial revision + + * automake.in: Look for acconfig.h, config.h.top, and config.h.bot + + * automake.in: Put blank line after .SUFFIXES + + * scripts.am: Added blank line at end + + * scripts.am: Removed unnecessary comment + + * scripts.am: Removed unnecessary workarounds + + * automake.in: Don't include programs.am if PROGRAMS empty + + * header-vars.am (INSTALL_SCRIPT): Typo + + * texinfos.am, compile-kr.am: Don't include .SUFFIXES + + * automake.in: Handle .SUFFIXES here. + + * configure.in: Use fp_PROG_INSTALL + + * header-vars.am: Changes for autoconf 2.5. + Now includes INSTALL_SCRIPTS. + + * texinfos.am (install-info): Bug fix + + * automake.in: + Include scripts.am or libscripts.am in output if appropriate + + * programs.am (install-programs, uninstall-programs): + Don't install SCRIPTS + + * Makefile.am (am_DATA): Include scripts.am + + * scripts.am: Initial revision + +Tue Nov 21 09:11:38 1995 Tom Tromey + + * automake.in: + Cleaned up how "prog_SOURCES" variable is found in input. + Ditto prog_OBJECTS. + Put static sed scripts into separate, installed files. + + * Makefile.am (am_DATA): Include hack-make.sed and nl-remove.sed + + * hack-make.sed, nl-remove.sed: Initial revision + + * texinfos.am (install-info): Rewrote + + * subdirs.am (all-recursive): Put with other -recursive rules + + * configure.in: Version 0.20 + + * automake.in: Another bug fix + + * automake.in: Bug fix when looking for texinfo.tex + + * texinfo.tex: Initial revision + + * automake.in: + If TEXINFOS defined but texinfo.tex does not exist, give warning. + + * subdirs.am (all): Renamed from _all. Now uses all-recursive + (all-recursive): Don't fail immediately if -k specified. + +Mon Nov 20 22:48:03 1995 Tom Tromey + + * subdirs.am (_all): + New target. Now use Jim Meyering's formulation of AIX + workaround. + (install-exec, install-data): New targets + +Sat Nov 18 19:07:30 1995 Tom Tromey + + * remake.am (Makefile.in): automake "Makefile", not "Makefile.am" + + * automake.in: Use @datadir@ + + * automake.in: Added @configure_input@ line + +Fri Nov 17 23:32:43 1995 Tom Tromey + + * automake.in: "--help" option now prints auto-recognized file names. + Allow AM_ overriding of more variables. + + * texinfos.am (install-info): + Don't cd to srcdir to avoid breaking install-sh + Other bug fixes + + * Makefile.am: Handle automake.texi + +Thu Nov 16 18:43:43 1995 Tom Tromey + + * subdirs.am (all): Separated out due to AIX 3.2.5 bug. + + * tags.am (TAGS): bug fix + + * automake.in: Use am_dir, not AM_DIR. + Use version, not VERSION. + Bug fix in TAGS code. + + * Makefile.am (am_DATA): Include tags.am and tags-subd.am + + * subdirs.am: TAGS target now in tags.am + + * footer.am: TAGS and ID targets now in tags-subd.am + + * tags-subd.am, tags.am: Initial revision + + * automake.in: Cleaned up AM_PROGRAM code. + Handle TAGS target better + + * remake.am, remake-subd.am (Makefile.in): Bug fix. + + * automake.in (usage): Updated + + * remake-subd.am, remake.am: + Added rule where Makefile.in depends on Makefile.am + + * automake.in: Entire body of 'for' loop now in subshell + + * automake.in (common): config.guess and config.sub are common files. + + * dist-subd-top.am, dist.am (dist): Bug fix. + + * Makefile.am (DIST_OTHER): Don't include TODO + + * automake.in: Auto-include TODO and THANKS files. + + * dist-subd-top.am, dist.am (dist): Don't depend on DIST_DIRS + + * automake.in: More bug fixes in "look for Makefile.am" code. + + * automake.in: Bug fix in "look for Makefile.am" code. + + * automake.in: + If no arguments given, look for all Makefile.am's in this + directory and in immediate subdirs + + * automake.in: Bug fixes for LDADD-override feature. + + * program.am: Use @PROGRAM@_LDADD, and put after LDFLAGS + + * automake.in: Allow `prog_LDADD', if specified, to override LDADD. + + * automake.in: Use AM_PROGRAMS, not ALLPROGRAMS, and invert sense. + + * header-vars.am (ALL): Use PROGRAMS, not ALLPROGRAMS. + +Wed Nov 15 01:54:43 1995 Tom Tromey + + * automake.in: No longer look for _SOURCES or _OBJECTS + + * header-vars.am: + Remove "automatically created" header (now in automake). + Updated copyright. + + * automake.in: Put version info in Makefile header + +Tue Nov 14 23:38:17 1995 Tom Tromey + + * automake.in: Minor cleanups + + * dist-subd-top.am, dist.am (dist): + Don't link or copy file if it already exists. + + * automake.in: + Look for _SOURCES (common sources) and generate _OBJECTS. + + * footer.am (ID, TAGS): Include HEADERS + + * dist-vars.am, dist-subd-vars.am (DIST_FILES): Include HEADERS + +Mon Nov 13 22:20:02 1995 Tom Tromey + + * dist-subd.am (distdir): Is relative to ".." + + * dist-subd-vars.am (PACKAGE, VERSION): Define + + * dist-subd.am (dist): Don't handle DIST_DIRS. + + * mans.am (uninstall-man): Another bug fix. + + * mans.am (uninstall-man): Bug fix. + + * dist.am, dist-subd-top.am (dist): Bug fix + + * Makefile.am (DIST_SUBDIRS): New macro + + * dist-subd-top.am, dist.am (dist): Handle DIST_SUBDIRS + + * Makefile.am (DIST_OTHER): Include automake.in + + * Makefile.am (DISTCLEANFILES): New macro. + + * automake.in (common): Include COPYING.LIB + + * Makefile.am (automake): New rule. + + * texinfos.am (install-info): Changed per GNU standards + + * remake-hdr.am (stamp-h.in): + Use "touch", not "date", per GNU standards. + + * automake.in (common): Include texinfo.tex + +Sun Nov 12 23:59:08 1995 Tom Tromey + + * automake.in: More fixes when finding common files. + + * Makefile.am (DIST_OTHER): Another removal. + + * automake.in: Special-case when amdir=. + + * Makefile.am (DIST_OTHER): Removed auto-detected files. + + * automake.in: + Search for commonly-used files and auto-include them in distribution + + * dist-vars.am (DIST_FILES): Include DIST_COMMON. + (DIST_CONF): Removed files searched for by automake. + + * automake.in: More arg-parsing bug fixes. + + * Makefile.am (DIST_OTHER): Include install-sh + + * Makefile.am (DIST_OTHER): Don't include auto-included files. + + * automake.in: Bug fixes to argument parsing code. + + * automake.in: Handle --version and --help. + NLS stuff from autoconf. + + * Makefile.am (amdatadir): Fixed typo. + (install): Make install directories + + * Makefile.am: Use "install::", not "install:" + + * install-sh, mkinstalldirs: Initial revision + + * configure.in: Use AC_PROG_INSTALL + + * automake.in: Set AM_DIR based on configure results. + + * Makefile.am (install): New target. + (amdatadir): New variable. + + * automake.in: Use "#! /", not "#!/". + + * Makefile.am, configure.in: Initial revision + + * automake.in: Renamed from "automake". + Set VERSION. + + * dist.am (PACKAGE, VERSION): Now in dist-vars.am + + * automake.in: Insert remake-subd.am if appropriate. + + * subdirs.am (TAGS): Include $(CONFIG_HEADER) when making tags. + + * automake.in: Handle ALLPROGRAMS variable. + + * header-vars.am (ALL): Use ALLPROGRAMS, not PROGRAMS. + + * automake.in: Fixlet when printing "subdir=DIR" + + * automake.in: Put "subdir=DIR" into subdir Makefile + + * automake.in: Don't refer to distname.am. + Only put footer.am in subdir Makefiles. + + * subdirs.am (id, ID): New target. + (.NOEXPORT): Copied from footers.am. + + * subdirs.am (TAGS): Bug fixes. + + * subdirs.am (TAGS): Don't fail if a subdir doesn't have TAGS target. + + * subdirs.am (maintainer-clean-local): Remove TAGS + + * subdirs.am (TAGS): Make tags file that includes all subdir tags files + + * subdirs.am: Use maintainer-clean, per GNU standards + + * dist-subd-top.am: Some variables defined in dist-vars.am + + * dist-vars.am (PACKAGE, VERSION): + New variables, initialized by configure + + * footer.am (id, ID): New targets + (TAGS): Put TAGS file in build, not source, directory + + * remake-subd.am (Makefile): Don't assume subdir is 'src' + + * dist.am: Changed to assume PACKAGE and VERSION are set by configure. + + * dist-subd.am: Changed to conform to new top-level dist target. + + * dist-subd-top.am: + Changed to assume PACKAGE and VERSION are set by configure. + + * clean-kr.am, clean.am (maintainer-clean): + Updated rules per GNU standards. + + * clean.am, clean-kr.am (maintainer-clean): Renamed from realclean. + +Sat Nov 5 14:39:50 1994 djm + + * automake.in, texinfos.am: kludge for multiple-part info files + +Thu Nov 3 13:33:44 1994 djm + + * clean.am, clean-kr.am: remove INFOS + +Wed Nov 2 06:15:42 1994 djm + + * texinfos.am: add path + + * remake.am, remake-hdr.am: account for VPATH limitations + +Mon Oct 24 23:01:59 1994 djm + + * automake.in, dist-subd-top.am, dist-subd.am, dist.am, header-vars.am, libprograms.am, programs.am: + handle SCRIPTS and LIBSCRIPTS similar to PROGRAMS + +Sun Oct 23 01:50:41 1994 djm + + * texinfos.am: install-info depends on info files + + * dist-subd-vars.am, dist-vars.am: distrib info files + +Sun Oct 2 02:03:06 1994 djm + + * clean-kr.am, clean.am: fix up distclean + + * subdirs.am: fix typo + + * clean.am: do more in distclean + +Sat Oct 1 23:52:51 1994 djm + + * libraries.am: make install depend on all + + * automake.in: fix typo + +Wed Sep 28 21:15:26 1994 djm + + * dist-subd-vars.am, dist-vars.am, header-vars.am: fix doc bugs + + * automake.in, compile-vars.am, dist.am: fix dist for no subdirs + + * dist-subd-top.am: Initial revision + + * automake.in, header-vars.am, libraries-vars.am, mans-vars.am, texinfos-vars.am: + centralize prefix var setting + + * header-vars.am: set all the std vars based on prefix + +Tue Sep 27 01:32:22 1994 djm + + * automake.in: don't add kr stuff if not needed + + * dist-vars.am: add config vars to dist + +Mon Sep 26 23:09:09 1994 djm + + * program.am: add LDADD + + * compile-vars.am: remove LDADD from LDFLAGS + + * clean.am: move knr stuff to another file + + * automake.in: use different clean file for ansi2knr + + * clean-kr.am: Initial revision + +Thu Sep 22 03:45:02 1994 djm + + * automake.in, dist-subd.am, dist.am: fix rules and dist + +Tue Sep 20 21:29:40 1994 djm + + * compile.am, automake.in: split out knr + + * compile-kr.am: Initial revision + + * libprograms.am: fix typo + + * automake.in, clean.am, compile-vars.am, header-vars.am, libprograms.am: + make libprograms work + + * libprograms.am: Initial revision + + * automake.in, compile.am, header-vars.am: fix little bugs + + * compile.am: allow parallel K&R + + * clean.am: remove kerb temps + + * automake.in: fix recognizing start of rules + + * dist-subd.am, dist.am: fix dist + + * automake.in, compile.am, footer.am, texinfos.am: fix ansi2knr + +Mon Sep 19 23:39:21 1994 djm + + * automake.in: works on m4 too + + * automake.in, mans.am: works on fileutils + + * automake.in, clean.am, compile.am, dist-subd.am, dist.am, footer.am, header-vars.am, header.am, libraries.am, library.am, mans-vars.am, mans.am, programs.am, remake-hdr.am, remake-subd.am, remake.am, subdirs.am, texinfos.am: + works on fileutils except for all + + * automake.in: vars thing + + * header-vars.am: Initial revision + + * texinfos-vars.am, mans-vars.am, libraries-vars.am, dist-vars.am, dist-subd-vars.am: + entered into RCS + + * compile-vars.am: Initial revision + + * automake.in: many improvements + + * footer.am: Initial revision + + * dist.am: remove distname + + * automake.in: namespace cleanup + + * distname.am: Initial revision + + * automake.in, clean.am, compile.am, dist-subd.am, dist.am, header.am, libraries.am, library.am, mans.am, program.am, programs.am, remake-hdr.am, remake.am, subdirs.am, texinfos.am: + might work + + * mans.am, libraries.am, texinfos.am, library.am, compile.am, program.am, programs.am, clean.am, subdirs.am, remake-subd.am, remake.am, remake-hdr.am, dist.am, dist-subd.am, header.am, automake.in: + Initial revision diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..616eabd --- /dev/null +++ b/Makefile.am @@ -0,0 +1,158 @@ +## Process this file with automake to create Makefile.in + +AUTOMAKE_OPTIONS = 1.4 +MAINT_CHARSET = latin1 + +## We need `.' in SUBDIRS because we want `check' to build `.' before +## tests. +SUBDIRS = . m4 tests + +bin_SCRIPTS = automake aclocal +info_TEXINFOS = automake.texi + +amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \ +data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \ +footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \ +library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \ +ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \ +program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \ +subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am + +pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles) + +## These must all be executable when installed. However, if we use +## _SCRIPTS, then the program transform will be applied, which is not +## what we want. So we make them executable by hand. +scriptdir = $(pkgvdatadir) +script_DATA = config.guess config.sub install-sh mdate-sh missing \ +mkinstalldirs elisp-comp ylwrap acinstall + +install-data-hook: + @for prog in $(script_DATA); do \ + chmod +x $(DESTDIR)$(scriptdir)/$$prog; \ + done + +## Make versioned links. We only run the transform on the root name; +## then we make a versioned link with the transformed base name. This +## seemed like the most reasonable approach. +install-exec-hook: + @$(POST_INSTALL) + @for p in $(bin_SCRIPTS); do \ + f="`echo $$p|sed '$(transform)'`"; \ + fv="$$f-$(APIVERSION)"; \ + rm -f $(DESTDIR)$(bindir)/$$fv; \ + echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \ + $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \ + done + +uninstall-hook: + @for p in $(bin_SCRIPTS); do \ + f="`echo $$p|sed '$(transform)'`"; \ + fv="$$f-$(APIVERSION)"; \ + rm -f $(DESTDIR)$(bindir)/$$fv; \ + done + +EXTRA_DIST = acinstall $(pkgvdata_DATA) $(script_DATA) + +# The following requires a fixed version of the Emacs 19.30 etags. +ETAGS_ARGS = automake.in aclocal.in --lang=none \ + --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi +TAGS_DEPENDENCIES = automake.in aclocal.in automake.texi + +## `test -x' is not portable. So we use Perl instead. If Perl +## doesn't exist, then this test is meaningless anyway. +installcheck-local: + for file in $(script_DATA); do \ + $(PERL) -e "exit ! -x '$(pkgvdatadir)/$$file';" || exit 1; \ + done + +################################################################ +## +## Everything past here is useful to the maintainer, but probably not +## to anybody else +## + +# Run the test suite using Perl 4. +perl4-check: automake aclocal + @if $(SHELL) -c 'perl4.036 -v' > /dev/null 2>&1; then \ + $(MAKE) PERL=perl4.036 check; \ + else :; fi + +# Some simple checks, and then ordinary check. These are only really +# guaranteed to work on my machine. +maintainer-check: automake aclocal +## This check avoids accidental configure substitutions in the source. +## There are exactly 8 lines that should be modified. This works out +## to 24 lines of diffs. + @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 24; then \ + echo "found too many diffs between automake.in and automake"; 1>&2; \ + diff -c $(srcdir)/automake.in automake; \ + exit 1; \ + fi +## Syntax check with default Perl (on my machine, Perl 5). + $(PERL) -c -w automake + $(PERL) -c -w aclocal +## expect no instances of '${...}'. However, $${...} is ok, since that +## is a shell construct, not a Makefile construct. +## The backslash in `$${' is needed for some versions of bash. + @if test `fgrep '\$${' $(srcdir)/[:lower:]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ + echo "found too many uses of '\$${'" 1>&2; \ + exit 1; \ + else :; fi +## Make sure all invocations of mkinstalldirs are correct. + @if test `fgrep 'mkinstalldirs' $(srcdir)/[:lower:]*.am | fgrep -v '$$(mkinstalldirs)' | wc -l` -ne 0; then \ + echo "found incorrect use of mkinstalldirs" 1>&2; \ + exit 1; \ + else :; fi +## Another syntax check, this time with Perl 4, if it exists. + @if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \ + perl4.036 -c -w automake; \ + perl4.036 -c -w aclocal; \ + else :; fi +## We never want to use "undef", only "delete". + @if grep undef $(srcdir)/automake.in > /dev/null 2>&1; then \ + echo "Found undef in automake.in; use delete instead" 1>&2; \ + exit 1; \ + fi +## We never want split (/ /,...), only split (' ', ...). + @if fgrep 'split (/ /' $(srcdir)/automake.in > /dev/null 2>&1; then \ + echo "Found bad split in automake.in" 1>&2; \ + exit 1; \ + fi + +# Tag before making distribution. Also, don't make a distribution if +# checks fail. Also, make sure the NEWS file is up-to-date. +cvs-dist: maintainer-check perl4-check distcheck + @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1; \ + fi + cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'` + $(MAKE) dist + +cvs-diff: + thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \ + if test -z "$$OLDVERSION"; then \ + prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \ + else prevno="$$OLDVERSION"; fi; \ + prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \ + cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \ + > $(PACKAGE)-$$prevno-$(VERSION).diff + +## Check our path lengths. +path-check: distdir + (cd $(distdir) && \ +## FIXME there's got to be a better way! pathchk should take the list +## of files on stdin, at least. + find . -print | xargs pathchk -p); \ + status=$$?; \ + rm -rf $(distdir); \ + exit $$status + +## Just get the .am files into TAGS. We don't really care too much if +## any interesting tags show up. +ETAGS_ARGS = $(amfiles) +TAGS_DEPENDENCIES = $(ETAGS_ARGS) + +## A temporary hack for the release. +DISTCLEANFILES = automake.cm automake.ov diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..6483593 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,663 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 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. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +APIVERSION = @APIVERSION@ +LN = @LN@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +TAR = @TAR@ +VERSION = @VERSION@ +pkgvdatadir = @pkgvdatadir@ + +AUTOMAKE_OPTIONS = 1.4 +MAINT_CHARSET = latin1 + +SUBDIRS = . m4 tests + +bin_SCRIPTS = automake aclocal +info_TEXINFOS = automake.texi + +amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am footer.am header-vars.am header.am java-clean.am java.am kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am + + +pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles) + +scriptdir = $(pkgvdatadir) +script_DATA = config.guess config.sub install-sh mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall + + +EXTRA_DIST = acinstall $(pkgvdata_DATA) $(script_DATA) + +ETAGS_ARGS = $(amfiles) +TAGS_DEPENDENCIES = $(ETAGS_ARGS) + +DISTCLEANFILES = automake.cm automake.ov +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = automake aclocal +SCRIPTS = $(bin_SCRIPTS) + +TEXI2DVI = texi2dvi +INFO_DEPS = automake.info +DVIS = automake.dvi +TEXINFOS = automake.texi +DATA = $(pkgvdata_DATA) $(script_DATA) + +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +Makefile.in NEWS THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 \ +ansi2knr.c automake.in config.guess config.sub configure configure.in \ +elisp-comp install-sh mdate-sh missing mkinstalldirs stamp-vti \ +texinfo.tex version.texi ylwrap + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +.SUFFIXES: .dvi .info .ps .texi .texinfo .txi +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +automake: $(top_builddir)/config.status automake.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +aclocal: $(top_builddir)/config.status aclocal.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; fi; \ + done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + list='$(bin_SCRIPTS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + done + +$(srcdir)/version.texi: stamp-vti + @: + +$(srcdir)/stamp-vti: automake.texi $(top_srcdir)/configure.in + @echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/automake.texi`" > vti.tmp + @echo "@set EDITION $(VERSION)" >> vti.tmp + @echo "@set VERSION $(VERSION)" >> vti.tmp + @cmp -s vti.tmp $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi"; \ + cp vti.tmp $(srcdir)/version.texi) + -@rm -f vti.tmp + @cp $(srcdir)/version.texi $@ + +mostlyclean-vti: + -rm -f vti.tmp + +clean-vti: + +distclean-vti: + +maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi + +automake.info: automake.texi version.texi +automake.dvi: automake.texi version.texi + + +DVIPS = dvips + +.texi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texi.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.texi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.texinfo.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + +.txi.dvi: + TEXINPUTS=.:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +.dvi.ps: + $(DVIPS) $< -o $@ + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + d=$(srcdir); \ + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi + +uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + d=$(srcdir); \ + for file in `cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + +mostlyclean-aminfo: + -rm -f automake.aux automake.cp automake.cps automake.dvi automake.fn \ + automake.fns automake.ky automake.kys automake.ps \ + automake.log automake.pg automake.toc automake.tp \ + automake.tps automake.vr automake.vrs automake.op automake.tr \ + automake.cv automake.cn + +clean-aminfo: + +distclean-aminfo: + +maintainer-clean-aminfo: + cd $(srcdir) && for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done + +install-pkgvdataDATA: $(pkgvdata_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pkgvdatadir) + @list='$(pkgvdata_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgvdatadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgvdatadir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgvdatadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(pkgvdatadir)/$$p; \ + fi; fi; \ + done + +uninstall-pkgvdataDATA: + @$(NORMAL_UNINSTALL) + list='$(pkgvdata_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pkgvdatadir)/$$p; \ + done + +install-scriptDATA: $(script_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(scriptdir) + @list='$(script_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(scriptdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(scriptdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(scriptdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(scriptdir)/$$p; \ + fi; fi; \ + done + +uninstall-scriptDATA: + @$(NORMAL_UNINSTALL) + list='$(script_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(scriptdir)/$$p; \ + done + +# 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. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" != "." || dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info +info-am: $(INFO_DEPS) +info: info-recursive +dvi-am: $(DVIS) +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: installcheck-local +installcheck: installcheck-recursive +install-exec-am: install-binSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec: install-exec-recursive + +install-data-am: install-info-am install-pkgvdataDATA install-scriptDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-binSCRIPTS uninstall-info uninstall-pkgvdataDATA \ + uninstall-scriptDATA +uninstall: uninstall-recursive +all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \ + $(DESTDIR)$(pkgvdatadir) $(DESTDIR)$(scriptdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-vti mostlyclean-aminfo mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-vti clean-aminfo clean-tags clean-generic \ + mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-vti distclean-aminfo distclean-tags \ + distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-vti maintainer-clean-aminfo \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: uninstall-binSCRIPTS install-binSCRIPTS mostlyclean-vti \ +distclean-vti clean-vti maintainer-clean-vti install-info-am \ +uninstall-info mostlyclean-aminfo distclean-aminfo clean-aminfo \ +maintainer-clean-aminfo uninstall-pkgvdataDATA install-pkgvdataDATA \ +uninstall-scriptDATA install-scriptDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-local installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +install-data-hook: + @for prog in $(script_DATA); do \ + chmod +x $(DESTDIR)$(scriptdir)/$$prog; \ + done + +install-exec-hook: + @$(POST_INSTALL) + @for p in $(bin_SCRIPTS); do \ + f="`echo $$p|sed '$(transform)'`"; \ + fv="$$f-$(APIVERSION)"; \ + rm -f $(DESTDIR)$(bindir)/$$fv; \ + echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \ + $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \ + done + +uninstall-hook: + @for p in $(bin_SCRIPTS); do \ + f="`echo $$p|sed '$(transform)'`"; \ + fv="$$f-$(APIVERSION)"; \ + rm -f $(DESTDIR)$(bindir)/$$fv; \ + done + +installcheck-local: + for file in $(script_DATA); do \ + $(PERL) -e "exit ! -x '$(pkgvdatadir)/$$file';" || exit 1; \ + done + +################################################################ + +# Run the test suite using Perl 4. +perl4-check: automake aclocal + @if $(SHELL) -c 'perl4.036 -v' > /dev/null 2>&1; then \ + $(MAKE) PERL=perl4.036 check; \ + else :; fi + +# Some simple checks, and then ordinary check. These are only really +# guaranteed to work on my machine. +maintainer-check: automake aclocal + @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 24; then \ + echo "found too many diffs between automake.in and automake"; 1>&2; \ + diff -c $(srcdir)/automake.in automake; \ + exit 1; \ + fi + $(PERL) -c -w automake + $(PERL) -c -w aclocal + @if test `fgrep '\$${' $(srcdir)/[:lower:]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \ + echo "found too many uses of '\$${'" 1>&2; \ + exit 1; \ + else :; fi + @if test `fgrep 'mkinstalldirs' $(srcdir)/[:lower:]*.am | fgrep -v '$$(mkinstalldirs)' | wc -l` -ne 0; then \ + echo "found incorrect use of mkinstalldirs" 1>&2; \ + exit 1; \ + else :; fi + @if $(SHELL) -c 'perl4.036 -v' >/dev/null 2>&1; then \ + perl4.036 -c -w automake; \ + perl4.036 -c -w aclocal; \ + else :; fi + @if grep undef $(srcdir)/automake.in > /dev/null 2>&1; then \ + echo "Found undef in automake.in; use delete instead" 1>&2; \ + exit 1; \ + fi + @if fgrep 'split (/ /' $(srcdir)/automake.in > /dev/null 2>&1; then \ + echo "Found bad split in automake.in" 1>&2; \ + exit 1; \ + fi + +# Tag before making distribution. Also, don't make a distribution if +# checks fail. Also, make sure the NEWS file is up-to-date. +cvs-dist: maintainer-check perl4-check distcheck + @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1; \ + fi + cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'` + $(MAKE) dist + +cvs-diff: + thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \ + if test -z "$$OLDVERSION"; then \ + prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \ + else prevno="$$OLDVERSION"; fi; \ + prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \ + cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \ + > $(PACKAGE)-$$prevno-$(VERSION).diff + +path-check: distdir + (cd $(distdir) && \ + find . -print | xargs pathchk -p); \ + status=$$?; \ + rm -rf $(distdir); \ + exit $$status + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..09e4828 --- /dev/null +++ b/NEWS @@ -0,0 +1,219 @@ +New in 1.4-p6: +* Versioned install support back-ported from 1.6 + +New in 1.4-p5: +* Allow AM_PROG_LIBTOOL again. +* Diagnose AC_CONFIG_HEADERS the same as AC_CONFIG_HEADER. +* Display distributed file list correctly in usage message. +* Allow numbers in macro names. +* Bugfixes. + +New in 1.4-p4: +* Deal with configure.ac as well as configure.in -- this time for real! +* The version numbering system now allows three point version numbers, + such as 1.4.4, without thinking they are alpha release numbers. + +New in 1.4-p3: +* Deal with configure.ac as well as configure.in. +* Don't complain if `version.texi' is included in multiple places. + +New in 1.4-p2: +* Deal with AC_CONFIG_FILES from autoconf-2.50. +* Improvements to f77 support. +* DESTDIR now works for script targets. +* distcheck-hook works correctly. + +New in 1.4-p1: +* The version numbering system now allows fork identifiers (such as + the p1 in this version of automake). +* Cope gracefully with various versions of libtool which may or may not + require ltconfig, ltcf-c.sh, ltcf-cxx.sh or ltcf-gcj.sh. +* Bugfixes. + +New in 1.4: +* Added support for the Fortran 77 programming language. +* Re-indexed the Automake Texinfo manual. +* Added `AM_FOOFLAGS' variable for each compiler invocation; + e.g. AM_CFLAGS can be used in Makefile.am to set C compiler flags +* Support for latest autoconf, including support for objext +* Can now put `.' in SUBDIRS to control build order +* `include' command and `+=' support for macro assignment +* Dependency tracking no long susceptible to deleted header file problem +* Maintainer mode now a conditional. @MAINT@ is now an anachronism. +* Bug fixes + +New in 1.3: +* Bug fixes +* Better Cygwin32 support +* Support for suffix rules with _SOURCES variables +* New options `readme-alpha' and `check-news'; Gnits mode sets these +* @LEXLIB@ no longer required when lex source seen + Lex support in `missing', and new lex macro. Update your missing script. +* Built-in support for assembly +* aclocal gives error if `AM_' macro not found +* Passed YFLAGS, not YACCFLAGS, to yacc +* AM_PROG_CC_STDC does not have to come before AC_PROG_CPP +* Dependencies computed as a side effect of compilation +* Preliminary support for Java +* DESTDIR support at "make install" time +* Improved ansi2knr support; you must use the latest ansi2knr.c (included) + +New in 1.2: +* Bug fixes +* Better DejaGNU support +* Added no-installinfo option +* Added Emacs Lisp support +* Added --no-force option +* Included `aclocal' program +* Automake will now generate rules to regenerate aclocal.m4, if appropriate +* Now uses `AM_' macro names everywhere +* ansi2knr option can have directory prefix (eg `../lib/ansi2knr') + ansi2knr now works correctly on K&R sources +* Better C++, yacc, lex support +* Will compute _DEPENDENCIES variables automatically if not supplied +* Will interpolate $(...) and ${...} when examining contents of a variable +* .deps files now in build directory, not source directory; dependency + handling generally rewritten +* DATA, MANS and BUILT_SOURCES no longer included in distribution +* can now put config.h into a subdir +* Added dist-all target +* Support for install-info program (see texinfo 3.9) +* Support for "yacc -d" +* configure substitutions are automatically discovered and included + in generated Makefile.in +* Special --cygnus mode +* OMIT_DEPENDENCIES can now hold list of dependencies to be omitted + when making distribution. Some dependencies are auto-ignored. +* Changed how libraries are specified in _LIBRARIES variable +* Full libtool support, from Gord Matzigkeit +* No longer have to explicitly touch stamp-h when using AC_CONFIG_HEADER; + AM_CONFIG_HEADER handles it automatically +* Texinfo output files no longer need .info extension +* Added `missing' support +* Cygwin32 support +* Conditionals in Makefile.am, from Ian Taylor + +New in 1.0: +* Bug fixes +* distcheck target runs install and installcheck targets +* Added preliminary support for DejaGNU. + +New in 0.33: +* More bug fixes +* More checking +* More libtool fixes from Gord Matzigkeit; libtool support is still + preliminary however +* Added support for jm_MAINTAINER_MODE +* dist-zip support +* New "distcheck" target + +New in 0.32: +* Many bug fixes +* mkinstalldirs and mdate-sh now appear in directory specified by + AC_CONFIG_AUX_DIR. +* Removed DIST_SUBDIRS, DIST_OTHER +* AC_ARG_PROGRAM only required when an actual program exists +* dist-hook target now run before distribution packaged up; idea from + Dieter Baron. Other hooks exist, too. +* Preliminary (unfinished) support for libtool +* Added short option names. +* Better "dist" support when gluing together multiple packages + +New in 0.31: +* Bug fixes +* Documentation updates (many from François Pinard) +* strictness `normal' now renamed to `foreign' +* Renamed --install-missing to --add-missing +* Now handles AC_CONFIG_AUX_DIR +* Now handles TESTS macro +* DIST_OTHER renamed to EXTRA_DIST +* DIST_SUBDIRS is deprecated +* @ALLOCA@ and @LIBOBJS@ now work in _LDADD variables +* Better error messages in many cases +* Program names are canonicalized +* Added "check" prefix; from Gord Matzigkeit + +New in 0.30: +* Bug fixes +* configure.in scanner knows about AC_PATH_XTRA, AC_OUTPUT ":" syntax +* Beginnings of a test suite +* Automatically adds -I options for $(srcdir), ".", and path to config.h +* Doesn't print anything when running +* Beginnings of MAINT_CHARSET support +* Can specify version in AUTOMAKE_OPTIONS +* Most errors recognizable by Emacs' M-x next-error +* Added --verbose option +* All "primary" variables now obsolete; use EXTRA_PRIMARY to supply + configure-generated names +* Required macros now distributed in aclocal.m4 +* New documentation +* --strictness=gnu is default + +New in 0.29: +* Many bug fixes +* More sophisticated configure.in scanning; now understands ALLOCA and + LIBOBJS directly, handles AC_CONFIG_HEADER more precisely, etc. +* TEXINFOS and MANS now obsolete; use info_TEXINFOS and man_MANS instead. +* CONFIG_HEADER variable now obsolete +* Can handle multiple Texinfo sources +* Allow hierarchies deeper than 2. From Gord Matzigkeit. +* HEADERS variable no longer needed; now can put .h files directly into + foo_SOURCES variable. +* Automake automatically rebuilds files listed in AC_OUTPUT. The + corresponding ".in" files are included in the distribution. + +New in 0.28: +* Added --gnu and --gnits options +* More standards checking +* Bug fixes +* Cleaned up 'dist' targets +* Added AUTOMAKE_OPTIONS variable and several options +* Now scans configure.in to get some information (preliminary) + +New in 0.27: +* Works with Perl 4 again + +New in 0.26: +* Added --install-missing option. +* Pretty-prints generated macros and rules +* Comments in Makefile.am are placed more intelligently in Makefile.in +* Generates .PHONY target +* Rule or macro in Makefile.am now overrides contents of Automake file +* Substantial cleanups from François Pinard + +New in 0.25: +* Bug fixes. +* Works with Perl 4 again. + +New in 0.24: +* New uniform naming scheme. +* --strictness option +* Works with Perl 5 +* '.c' files corresponding to '.y' or '.l' files are automatically + distributed. +* Many bug fixes and cleanups + +New in 0.23: +* Allow objects to be conditionally included in libraries via lib_LIBADD. + +New in 0.22: +* Bug fixes in 'clean' code. +* Now generates 'installdirs' target. +* man page installation reworked. +* 'make dist' no longer re-creates all Makefile.in's. + +New in 0.21: +* Reimplemented in Perl +* Added --amdir option (for debugging) +* Texinfo support cleaned up. +* Automatic de-ANSI-fication cleaned up. +* Cleaned up 'clean' targets. + +New in 0.20: +* Automatic dependency tracking +* More documentation +* New variables DATA and PACKAGEDATA +* SCRIPTS installed using $(INSTALL_SCRIPT) +* No longer uses double-colon rules +* Bug fixes +* Changes in advance of internationalization diff --git a/README b/README new file mode 100644 index 0000000..513c47a --- /dev/null +++ b/README @@ -0,0 +1,31 @@ +This is Automake, a Makefile generator. It was inspired by the 4.4BSD +make and include files, but aims to be portable and to conform to the +GNU standards for Makefile variables and targets. + +Automake is a Perl script. The input files are called Makefile.am. +The output files are called Makefile.in; they are intended for use +with Autoconf. Automake requires certain things to be done in your +configure.in. + +Variable assignment lines in Makefile.am pull in defaults from various +little *.am files. + +To use Automake, replace your Makefile.in files with Makefile.am +files. Read the documentation to see what to do. + +This package also includes the "aclocal" program. aclocal is a +program to generate an `aclocal.m4' based on the contents of +`configure.in'. It is useful as an extensible, maintainable mechanism +for augmenting autoconf. It is intended that other package authors +will write m4 macros which can be automatically used by aclocal. + +The mailing list automake@gnu.org is for discussion of +Automake, Autoconf, and other configuration/portability tools (e.g., +libtool). Write to automake-request@gnu.org if you want to +join. + +Automake has a page on the web. See: + + http://www.gnu.org/software/automake/ + +Mail suggestions and bug reports to bug-automake@gnu.org. diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..ab1c5e5 --- /dev/null +++ b/THANKS @@ -0,0 +1,88 @@ +Automake was originally written by David J. MacKenzie . +It would not be what it is today without the invaluable help of these +people: + +Akim Demaille demaille@inf.enst.fr +Alexander V. Lukyanov lav@yars.free.net +Alexandre Oliva oliva@dcc.unicamp.br +Andreas Schwab schwab@lamothe.informatik.uni-dortmund.de +Andrew Cagney cagney@tpgi.com.au +Anthony Green green@cygnus.com +Assar Westerlund assar@sics.se +Bernard Urban Bernard.Urban@meteo.fr +Bill Currie bcurrie@tssc.co.nz +Bill Fenner fenner@parc.xerox.com +Brian Jones cbj@nortel.net +Chris Provenzano proven@io.proven.org +David A. Swierczek swiercze@mr.med.ge.com +David Zaroski cz253@cleveland.Freenet.Edu +Dieter Baron dillo@stieltjes.smc.univie.ac.at +Doug Evans devans@cygnus.com +Eleftherios Gkioulekas lf@amath.washington.edu +Erez Zadok ezk@cs.columbia.edu +Erick Branderhorst branderh@iaehv.nl +François Pinard pinard@iro.umontreal.ca +Fred Fish fnf@ninemoons.com +Garrett D'Amore garrett@qualcomm.com +Garth Corral garthc@inktomi.com +Gary V Vaughan gvaughan@oranda.demon.co.uk +Glenn Amerine glenn@pie.mhsc.org +Gord Matzigkeit gord@gnu.ai.mit.edu +Greg A. Woods woods@most.weird.com +H.J. Lu hjl@lucon.org +Harlan Stenn Harlan.Stenn@pfcs.com +Henrik Frystyk Nielsen frystyk@w3.org +Ian Lance Taylor ian@cygnus.com +Janos Farkas chexum@shadow.banki.hu +Jason Molenda crash@cygnus.co.jp +Jeff Bailey Jbailey@phn.ca +Jeff Garzik jgarzik@pobox.com +Jerome Santini santini@chambord.univ-orleans.fr +Jim Meyering meyering@na-net.ornl.gov +Joel N. Weber II nemo@koa.iolani.honolulu.hi.us +Joerg-Martin Schwarz jms@jms.prima.ruhr.de +Johan Danielsson joda@pdc.kth.se +John W. Coomes jcoomes@eng.Sun.COM +Josh MacDonald jmacd@cs.berkeley.edu +Joshua Cowan jcowan@jcowan.reslife.okstate.edu +Juergen A. Erhard jae@laden.ilk.de +Karl Berry kb@cs.umb.edu +Karl Heuer kwzh@gnu.org +Kevin Dalley kevin@aimnet.com +Kevin Street street@iname.com +L. Peter Deutsch ghost@aladdin.com +Maciej W. Rozycki macro@ds2.pg.gda.pl +Maciej Stachowiak mstachow@mit.edu +Marcus G. Daniels mgd@ute.santafe.edu +Marius Vollmer mvo@zagadka.ping.de +Mark Eichin eichin@cygnus.com +Mark Galassi rosalia@nis.lanl.gov +Markku Rossi mtr@ngs.fi +Markus F.X.J. Oberhumer k3040e4@wildsau.idv-edu.uni-linz.ac.at +Matt Leach mleach@cygnus.com +Matthew D. Langston langston@SLAC.Stanford.EDU +Michael Brantley Michael-Brantley@deshaw.com +Motoyuki Kasahara m-kasahr@sra.co.jp +Nelson H. F. Beebe beebe@math.utah.edu +Noah Friedman friedman@gnu.ai.mit.edu +Nyul Laszlo nyul@sol.cc.u-szeged.hu +Paul D. Smith psmith@BayNetworks.COM +Paul Eggert eggert@twinsun.com +Per Bothner bothner@cygnus.com +Per Cederqvist ceder@lysator.liu.se +Peter Mattis petm@scam.XCF.Berkeley.EDU +Petter Reinholdtsen pere@hungry.com +Phil Nelson phil@cs.wwu.edu +Raja R Harinath harinath@cs.umn.edu +Ralph Schleicher rs@purple.UL.BaWue.DE +Ramón García Fernández ramon@jl1.quim.ucm.es +Rob Savoye rob@cygnus.com +Robert Bihlmeyer robbe@orcus.priv.at +Sergey Vlasov vsu@mivlgu.murom.ru +Seth Alves alves@hungry.com +Steve M. Robbins steve@nyongwa.montreal.qc.ca +Tatu Ylonen ylo@ssh.fi +The Crimson Binome steve@nyongwa.montreal.qc.ca +Thomas Morgan tmorgan@pobox.com +Tim Goodwin tjg@star.le.ac.uk +Ulrich Drepper drepper@gnu.ai.mit.edu diff --git a/TODO b/TODO new file mode 100644 index 0000000..e327c05 --- /dev/null +++ b/TODO @@ -0,0 +1,636 @@ +* Run automake before libtool. It will report an error but + still won't put the file into the disty. This is wrong. + From Mark H Wilkinson + +* AM_CONFIG_HEADER might generate the wrong stamp file names + when given multiple headers. Write a test. + +* Currently don't correctly handle multiple inputs to a config header. + +* header stamp files still in wrong dirs. + stamp-h.in must be in dir with h.in file + stamp-h must be in dir with output file + +* foo=bar + if cond + foo += joe + endif + ... this ought to work. The fix is probably complicated + +* `distcheck' and `dist' should depend on `all' + +* Document why putting @FOO@ in _SOURCES doesn't work. + +* Add code to generate foo-config script like gnome, gtk + +* right now automake sets `TAR' when automake is configured + this loses in some situations. + however, checking for it in every configure.in also seems lame. + probably should just give in on this; meanwhile people can + override TAR themselves. + +* `DEFS += foo' won't work. + That's because DEFS is defined in header-vars.am, which is read + after the user's Makefile.am. + This will be a problem for any macro defined internally + [ fixing this will probabl fix the nasty `exeext redefines + foo_PROGRAMS' hack that is in there right now ] + +* document user namespace for macro/target names + adopt some conventions and use uniformly + [ this is a good thing for the rewrite ] + +* make distcheck uses directories like `=build'. + Some (very rare) POSIX systems don't support `=' in filenames. + If this ever becomes a problem, fix it + +* distclean must remove config.status + can't this cause problems for maintainer-clean? + shouldn't maintainer-clean print the message before running + any part of the make? (just to slow things down long enough + for the user to stop it) + (maybe doesn't matter since people who even know about + maintainer-clean already have a clue) + +* There are probably more bugs in variable_conditions_sub along + the lines of the one that caused cond4.test to fail. + +* give user more control over -I flags + in particular document a way to override the defaults + +* reintroduce AM_FUNC_FNMATCH which sets LIBOBJS + Then have automake know about fnmatch.h. + [ probably should wait for autoconf to get right functionality ] + +* Add a conditional for dependency tracking + (what to name it is the biggest problem here) + (because we want it to flag dist/no-dist -- not just deps) + [ this might not really be correctly doable. + instead we need a compile-time conditional for this + yuck ] + +* Allow per-object cflags: + bin_PROGRAMS = foo + foo_CFLAGS = -DFOO +* At the same time, allow sources in subdirs: + foo_SOURCES = x/y.c + This requires `mkdir x' at build time + [ both of these require per-file rules, and not pattern rules ] + [ use user-written suffix rules to generate the per-file rules in + an automatic way -- this would be mucho cool ] + +* Allow for multiple translations of a texinfo file: + LL_info_TEXINFOS = ... + will put info files for language LL into $(infodir)/LL. + +* If you suppress an internal variable by specifying a variable + in a Makefile.am, but the variable is conditional, then automake + should generate the internal variable conditionally. + You have to scan the map of all conditions and fill in the holes here + +* Every program foo has FOOFLAGS right now. + It should also have AM_FOOFLAGS, which can be set in Makefile.am. +DONE: but needs to be documented + +* Should be able to update files that would be installed with -a + (--force?) + +* "make diff" capability + look at gcc's Makefile.in to see what to do + or look at maint program + +* Karl wants to be able to set LIBS and LDFLAGS at build time, like CFLAGS + maybe we need something more general? + +* add $(srcdir)/ before some dependencies? + +* define LINK if a program is mentioned, even if no C sources appear + +* BUILT_SOURCES should not be distributed, even when they appear in + another _SOURCES line. [? or maybe just leave this up to the + to-be-defined generic distribution method ] + must completely revisit the entire BUILT_SOURCES idea + +* in --cygnus, clean-info not generated at top level + +* what if an element of a scanned variable looks like + $(FOO).$(BAR) ? + or some other arbitrary thing? + right now we try to cope, but not very well + +* if `interlock' exists, that should be an error (?) + should also warn about using new ylwrap and not old one + only do this when looking for ylwrap + +** make sure every variable that is used is also defined + +* make sure `missing' defines are generated +* if no AM_INIT_AUTOMAKE, then don't handle `missing' stuff. + Yuck! +* missing should handle install -d and rmdir -p (for uninstall) + +* a couple ways to be smarter: + - notice when a .c file is a target somewhere, and auto-add it to + BUILT_SOURCES + - notice a target of the form `.x.y:' and assume it is a suffix rule + + +* NORMAL_INSTALL / NORMAL_UNINSTALL -vs- recursive rules + [ requires changes to the standard ] + +* cross-compilation support: + programs built and used by the build process need to be + built for CC_FOR_BUILD + introduce a new variable for this + +* if foo.y is a source, foo.h isn't auto-distributed? + +* copyrights on m4 files, aclocal output + +* is there a way to add a directory and then have "make" do all the + updating? think. + +* put standards.texi into distribution + + +* should not put texiname_TEXINFOS into distribution + should rename this macro anyway, to foo_texi_DEPENDENCIES + +* *all* installed scripts should support --version, --help + +For now I guess I'll just have automake give an error if it encounters +non-C source in a libtool library specification. + +* must split $obj into two parts: one for libtool and one for + deansification. Otherwise .S files will be deansified! + +* ansi2knr must currently appear in a directory that has some source + +* if program has the same name as a target, do something sensible: + - if the target is internal, rename it + - if the target is mandated (eg, "info"), tell the user + consider auto-modifying the program name to work around this + +* should separate actual options from strictness levels + strictness should only cover requirements + You should be able to pick and choose options + +should clean up texinfos.am; one rule is repeated 3 times, but +shouldn't be + +should always use perl -w + +rewrite in guile (RMS request) +at the same time, consider adding a GUI +could use the same parsing code for the GUI and the standalone version +that means figuring out a better representation of internal state +[ that's easy -- anything is better than what we have now ] + +having just one Makefile for a project would give a big speed increase +for a project with many directories, eg glibc. ideally (?) you'd +still be able to have a Makefile.am in each directory somehow; this +might make editing conceptually easier. + +* finish up TAGS work +* `acinstall' +* put parser.h into distribution if "yacc -d" is used + +* only remove libtool at top level? + +* clean up source directory by moving stuff into subdirs + +* consider adding pkglibexecdir, maybe others? + requests for pkg-dirs with version included + +Avoid loops when installing; instead unroll them in automake + +* for new autoconf: + * completely handle multi-":" mode for AC_CONFIG_HEADER + * Scan multiple input files when Makefile is generated? + This would provide flexibility for large projects; subsumes + the "Makefile.tmpl" idea + + [ can't do this. must explain why in manual. + basically, solving all the problems is too hard + like: how to remove redundancies between generated .in files + instead should implement `include' directive for Makefile.am ] +* for multi-":" mode and AC_OUTPUT, it might be good to pick the + first input file that has a corresponding .am file. + +Some long-term projects: +* if $(FOO) is used somewhere, ensure FOO is defined, either by + user or by automake if possible + +[ include, += support ] +* even better would be allowing targets in different included + fragments to be merged. e.g., `install-local'. + +consider putting all check-* targets onto @check? +To support --help/--version checking? + +take diff-n-query code from libit + +Per Bothner says: +Per> 1) Being able to build a set of non-source programs +Per> from source programs, without necessarily linking them together. +Per> I.e. one should be able to say something like: +Per> dummy_SOURCES=foo.c bar.c +Per> and automake should realize that it needs to build foo.o and bar.o. +Per> 2) Being intelligent about new kinds of suffixes. +Per> If it sees: +Per> SUFFIXES = .class .java +Per> and a suffix rule of the form: +Per> .java.class: +Per> then it should be able to realize it can build .class files from +Per> .java files, and thus be able to generate a list of +Per> .class files from a list of .java source files. + +!! Must fix require_file stuff. It is really gross, and I don't + understand it any more. + +* error messages should print ``[info blah blah]'' command when a + certain part of the standards apply. saw idea in message from + Craig Burley. wouldn't it be really cool if compile-mode in Emacs + understood this convention, and you could click on such text to + go to the appropriate info page? [ I think you can ] + +Jim's idea: should look for @setfilename and warn if filenames too long +* guess split size + +** many requests for a way to omit a file from the distribution. + Should be done like `!foo' or `~foo' in _SOURCES, etc. + Such files should be removed explicitly after the copy step! + Doing this requires rewriting macros before generating Makefile.in. + +from joerg-martin schwarz: + -- If Makefile.am contains $(CC), $(COMPILE), $(YLWRAP), .... + in an explicitly written rule, you should emit the corresponding + Makefile variables automatically. + +Configuring in the large: +* allow hierarchy of dirs to share one aclocal.m4 + How? + +consider printing full file name of Makefile.am or configure.in when +giving error. This would help for very large trees with many +configure.in scripts + +From the GNU Standards. These things could be checked, and probably +should be if --gnu. +* Make sure that the directory into which the distribution unpacks (as +well as any subdirectories) are all world-writable (octal mode 777). +* Make sure that no file name in the distribution is more than 14 +characters long. +* Don't include any symbolic links in the distribution itself. + (ditto hard links) +* Make sure that all the files in the distribution are world-readable. +** also, check --help output and --version output. Idea from François +* standards no longer prohibit ANSI C. What does this imply + for the de-ansi-fication feature? [ must keep it -- some users rely on it ] + +should be able to determine what is built by looking at rules (and +configure.in). Then built man pages (eg) could automatically be +omitted from the distribution. + +Idea from Joerg-Martin Schwarz: allow passing different -D flags to +different compiles. This can be done, but with the restriction that a +.c cannot appear in 2 different "objects" (programs/libraries) +compiled with different -D options (because -c and -o do not always +work together and parallel makes must work). This could be +implemented by noticing whenever a ".o" target with no rules is being +emitted, and adding the appropriate compilation rule as appropriate. +This should work with targets from Makefile.am as well as from .P +files, which means rewriting so that the Makefile.am contents aren't +copied into the output immediately. + [ this could be probably done more directly by examining the sources + as we scan Makefile.am ] + +Henrik Frystyk Nielsen says: +Henrik> 4) Flags like --include-deps are lost when you make changes to +Henrik> Makefile.am files and automake is run automatically. It would +Henrik> be nice to keep these flags as I now have to redo everything +Henrik> manually. +... what about other options here too? + +Think about: maybe "make check" should just bomb if error occurs? +Then user must use "make -k check". This is probably more natural. + +Consider: "cvs" option adds some cvs-specific rules? + +Right now, targets generated internally (eg "install") are not +overridable by user code. This should probably be possible, even +though it isn't very important. This could be done by generating all +internal rules via a function call instead of just appending to +$output_rules. + [ this will be harder to implement when scanning a rule like all-recursive + from subdirs.am ] + +* Should be a way to have "nobuild_PROGRAMS" which aren't even built, + but which could be by running the magic make command. + +Other priorities: +* Must rewrite am_install_var. Should break into multiple functions. + This will allow the callers to be a little smarter. +* Rewrite clean targets. +* Must rewrite error handling code. Right now it is a real mess + Should fix up require_file junk at the same time + +djm wants ``LINKS'' variable; list of things to link together after +install. In BSD environment, use: + LINKS = from1 to1 from2 to2 ... + +Need way to say there are no suffixes in a Makefile (Franc,ois' +"override" idea suffices here) + +Check to make sure various scripts are executable (IE when looking for +them in a directory) + +Use recode in dist target when MAINT_CHARSET specified. Read caveats +in automake.in before doing this. Note the same problem used to apply +to the no-dependencies option; maybe it still should? Note also that +each Makefile.am must be rewritten at "make dist" time if +MAINT_CHARSET and DIST_CHARSET are not identical. NOTE: gettext must +arrange for all .po files not to be recoded. In the long term this +might be a problem (consider when some systems use Unicode but the +rest do not) + MAINT_CHARSET *must* be local to each Makefile.am, to enable + merged distributions. + DIST_CHARSET must be passed down to subdir makes during a "make dist" + +Handle dist-zoo. Generally add more DOS support. Maybe run "doschk" +(why isn't this merged with "pathchk"?) when doing a dist. Do +whatever else François says here... + +Add support for html via an option. Use texi2html. Use +"html_TEXINFOS", and htmldir = .../html. Include html files in +distribution. Also allow "html_DATA", for raw .html files. + [ when will texinfo directly support html? ] + +uninstall and pkg-dirs should rm -rf the dir. + +a potential bug: configure puts "blah.o" into LIBOBJS, thus implying +these files can't be de-ansified. Not a problem? + [ fix by using ansi2knr wrapper program ] + +In general most .am files should be merged into automake. For +instance all the "clean" targets could be merged by keeping lists of +things to be removed. This would be a lot nicer looking. Note that +the install targets probably should not be merged; it is sometimes +useful to only install a small part. + +Clean up the output: +* Order rules sensibly +* Ensure every line has a purpose. Omit unused stuff +* Eliminate extraneous rules when possible (eg 'install-am' stuff) +* Make sure vertical spacing is correct +Omit program transform vars from header if no program installed. This +is currently pretty hard to do. (But with beautification code it +would probably be easy) + +Lex, yacc support: +* It would be nice to automatically support using bison's better features + to rename the output files. This requires autoconf support +* Consider supporting syntax from autoconf "derived:source", eg: + y.tab.c:perly.y + for yacc and lex source +* what if you use flex and the option to avoid -lfl? + should support this? + +Multi-language support: +* should have mapping of file extensions to languages +* should automatically handle the linking issue (special-case C++) +* must get compile rules for various languages; FORTRAN probably + most important unimplemented language +This should be integrated in some way with Per's idea. +Eg .f.o rules should be recognized & auto-handled in _SOURCES +That way any random language can be treated with C/C++ on a first-class +basis (maybe) + +It might be cool to generate .texi dependencies by grepping for +@include. (If done, it should be done the same way C dependencies are +done) + +It would be good to check some parts of GNU standards. Already check +for install-sh and mkinstalldirs. What else is required to be in +package by GNU standards or by automake? +Some things for --strictness=gnits: +* "cd $(foo); something" is an error in a rule. Should be: + "cd $(foo) && something" +* Look for 'ln -s' and warn about using $(LN) and AC_PROG_LN_S +* Look for $(LN) and require AC_PROG_LN_S + +Auto-distribute "ChangeLog.[0-9]+"? "ChangeLog.[a-z]+"? + +Internationalize. [ gettext doesn't have the necessary machinery yet ] +am_error should use printf-style arguments (for eventual gettext scheme) + +François says the ordering of files in a distribution should be as follows: +* README +* source files +* derived files +I agree, but I don't see how to implement this yet. +It might be easier if "derived files" is limited to those that +Automake itself knows about, eg output of yacc. + +Check all source files to make sure that FSF address is up-to-date. +--gnits or --gnu only. + +Merge each -vars.am file with corresponding ".am" file. Can do this +because of changes to &file_contents. + +Should libexec programs have the name transform done on them? + +Order the output rules sensibly, so FOO_SOURCES and FOO_OBJECTS are +together and rules are in the usual order. + +Make the output minimal: only output definitions for variables that +are used. + +djm says: +David> To avoid comments like the one about subdirs getting buried in +David> the middle of a Makefile.in, how about pushing comments that +David> start with ### to the top of the Makefile.in (in order)? Sort +David> of like how Autoconf uses diversions to force initialization +David> code to the top of configure. + +Karl Berry says: +Karl> 2) Your Makefile variable names are generally uppercase, but GNU +Karl> generally uses lowercase. Not that it matters :-). + +================================================================ + +Stuff for aclocal: + +probably should put each group of m4 files into a subdir owned by the +containing application. + +================================================================ + +Document: + +AM_MISSING_PROG + +how to use the generated makefiles + - standard targets + - required targets + - NORMAL_INSTALL junk + +what goes in AC_CONFIG_AUX_DIR + +multi-":" mode in AC_OUTPUT -- automake only looks at the first file + also a note on how a .am file is found in this case + +rationale for avoiding + make CFLAGS="$CFLAGS" ... +in subdirs make rule + +a package that installs its own aclocal macros + +write example of using automake with dejagnu +follow calc example in dejagnu docs + +document which variables are actually scanned and which are not. + +Document customary ordering of Makefile.am. From François. + +Should include extended version of diagram from Autoconf (suggested by +Greg Woods) + +Make a definition of the term "source" + +document how to use Automake with CVS. Idea from Mark Galassi. Also +include Greg Woods' more sophisticated "cvs-dist" target. + +document rebuilding configure. CONFIGURE_DEPENDENCIES +CONFIG_STATUS_DEPENDENCIES + +-- must document all variables that are supposed + to be public knowledge + +must document the targets required for integration with +non-automake-using subdirs + +document the "make SHELL='/bin/sh -x'" trick for debugging + +section on relationship to GNU make. include notes on parallel makes + +add a concept index + +move discussion of cygwin32, etags, mkid under other gnu tools + +CCLD, CXXLD, FLD + +================================================================ + +Things to do for gcc: + +Regularize dependency generation. Add new flags: + +-MH Generate a dummy dependency for each header file mentioned. +-MT NAME + Set name of target +-MF NAME + Set name of output file + +Then automake can use -MD -MH -MT 'foo.o foo.lo' -MF .deps/... + +================================================================ + +Things to do for autoconf: + +* patch autoreconf to run automake and aclocal. I've done this but it is + not really available. It can't be made available until automake + is officially released + +================================================================ + +Libraries: + +* Should support standalone library along with subdir library in same + Makefile.am. Maybe: turn off "standalone" mode if library's Makefile.am + is not only one specd? [ add an option for this ] + +================================================================ + +Longer term: + +Would it be useful to integrate in some way with the Debian package +building utility? Must check. maybe it would be possible to deal +with all the different package utilities somehow. Lately I've been +hearing good things about the RedHat packaging utilities. Why are +there so many of these? Are they fun to write or something? +The RedHat package utility is called RPM; see + ftp://ftp.redhat.com/pub/code/rpm +It actually has problems, like no configure script and no documentation. + +For Cygnus it would probably be good to be able to handle the native +package utility on each platform. There are probably 3 or 4 of these +(sysv, solaris?, aix?) + +tcl/unix/Makefile.in has some code to generate a Solaris package. + +Automake probably can't do all of this on its own. A new tool might +be a better idea + +I have some notes from a Debian developer on how the integration +should work + +================================================================ + +A tool to guess what the local Makefile.am should look like: +(see Gord's Maint program!) + +* Probably integrate with autoscan +* Use various simple rules to determine what to do: + * get name of top directory, sans version info + * search for .c files with 'main' in them + * if in main.c, use directory name for program + * if in more than one, generate multiple programs + * if not found, generate a library named after directory + * order subdir searches correctly: lib first, src last + * assume 'testsuite' dir means we are using dejagnu +* maybe be smart about reading existing Makefile.am, so tool + can be run for incremental changes? You could imagine: + + Makefile.am: + autoproject --incremental + +================================================================ + +Stuff NOT to do, and why: + +consider auto-including any file that matches "*.in". + [ no: po/Makefile.in shouldn't be included ] + +must look at mkid to see how it works (for subdir usage) + [ right now, it doesn't. i don't see a simple fix right now ] + +if configure.in not found, move up a directory and try again? This +could eliminate a common source of problems. + [ this is just a bad idea ] + +* scripts are installed in $exec_prefix/bin, not $prefix/bin + Bug or feature? + [ the consensus on Gnits is that this isn't required. + doubters can work around it anyway ] + +* make the auto-dep code crash if GNU make not in use? + (doesn't it already?) + +Looked at a program called 'ezmake', which seems to do something +similar. The only idea there that is possibly worth stealing is using +globs in definitions. Also has negations. Eg in a directory with +files a.c, b.c and c.c, the line: + foo_SOURCES = *.c ~c.c +would be equivalent to: + foo_SOURCES = a.c b.c +Is this worth implementing? + [ No... it is more reliable to spell everything out. ] + +Scan source directories and warn about missing files, eg .c/.h files +that aren't mentioned? + [ distcheck makes this less useful ] + +* quoting bugs + - how to install file with a space in its name? + [ don't bother with this -- make is just too losing ] diff --git a/acinstall b/acinstall new file mode 100755 index 0000000..edb8ddd --- /dev/null +++ b/acinstall @@ -0,0 +1,35 @@ +#! /bin/sh + +# Install an aclocal-style M4 file. A script is needed to do this +# because we want to do serial-number checking; newer versions of +# macro files should always be preferred. + +# Usage: +# acinstall file directory installprogram [install-args]... + +file="$1" +dir="$2" +shift +shift + +localserial=`grep '^# serial ' $file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'` +if test -z "$localserial"; then + echo "acinstall: no serial number in $file" 1>&2 + exit 1 +fi + +# Maybe if the installed file has no serial number we should just +# assume it is ancient. +instserial=`grep '^# serial ' $dir/$file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'` +if test -z "$instserial"; then + echo "acinstall: no serial number in $dir/$file" 1>&2 + exit 1 +fi + +if test $localserial -lt $instserial; then + # Installed file is newer. + exit 0 +fi + +# Install the file. +$* $file $dir/$file diff --git a/aclocal.in b/aclocal.in new file mode 100644 index 0000000..9a94839 --- /dev/null +++ b/aclocal.in @@ -0,0 +1,455 @@ +#!@PERL@ +# -*- perl -*- +# @configure_input@ + +# aclocal - create aclocal.m4 by scanning configure.ac +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Written by Tom Tromey . + +eval 'exec @PERL@ -S $0 ${1+"$@"}' + if 0; + +# aclocal - scan configure.ac and generate aclocal.m4. + +# Some constants. +$VERSION = "@VERSION@"; +$APIVERSION = "@APIVERSION@"; +$PACKAGE = "@PACKAGE@"; +$prefix = "@prefix@"; +# Note that this isn't pkgdatadir, but a separate directory. +# Note also that the versioned directory is handled later. +$acdir = "@datadir@/aclocal"; +$default_acdir = $acdir; + +# Some globals. + +# Exit status. +$exit_status = 0; + +# Text to output. +$output = ''; + +# Output file name. +$output_file = 'aclocal.m4'; + +# Which macros have been seen. +%macro_seen = (); + +# Which files have been seen. +%file_seen = (); + +# Map macro names to file names. +%map = (); + +# Map file names to file contents. +%file_contents = (); + +# How much to say. +$verbosity = 0; + +# Name of the top autoconf input: `configure.ac' or `configure.in' +$configure_ac = ''; + +@obsolete_macros = + ( + 'AC_FEATURE_CTYPE', + 'AC_FEATURE_ERRNO', + 'AC_FEATURE_EXIT', + 'AC_SYSTEM_HEADER', + 'fp_C_PROTOTYPES', + 'fp_FUNC_FNMATCH', + 'fp_PROG_CC_STDC', + 'fp_PROG_INSTALL', + 'fp_WITH_DMALLOC', + 'fp_WITH_REGEX', + 'gm_PROG_LIBTOOL', + 'jm_MAINTAINER_MODE', + 'md_TYPE_PTRDIFF_T', + 'ud_PATH_LISPDIR', + 'ud_GNU_GETTEXT', + + # Now part of autoconf proper, under a different name. + 'AM_FUNC_FNMATCH', + 'AM_SANITY_CHECK_CC', + 'AM_PROG_INSTALL', + 'AM_EXEEXT', + 'AM_CYGWIN32', + 'AM_MINGW32', + +# These aren't quite obsolete. +# 'md_PATH_PROG', +# 'ud_LC_MESSAGES', +# 'ud_WITH_NLS' + ); + +$obsolete_rx = '\b(' . join ('|', @obsolete_macros) . ')\b'; + +# Matches a macro definition. +$ac_defun_rx = "AC_DEFUN\\(\\[?([^],)\n]+)\\]?"; + +# Matches an AC_REQUIRE line. +$ac_require_rx = "AC_REQUIRE\\(\\[?([^])]*)\\]?\\)"; + + + +local (@dirlist) = &parse_arguments (@ARGV); +&scan_m4_files (@dirlist); +&scan_configure; +if (! $exit_status) +{ + &write_aclocal; +} +&check_acinclude; + +exit $exit_status; + +################################################################ + +# Print usage and exit. +sub usage +{ + local ($status) = @_; + + print "Usage: aclocal [OPTIONS] ...\n\n"; + print "Generate aclocal.m4 by scanning configure.ac\n + --acdir=DIR directory holding config files + --help print this help, then exit + -I DIR add directory to search list for .m4 files + --output=FILE put output in FILE (default aclocal.m4) + --print-ac-dir print name of directory holding m4 files + --verbose don't be silent + --version print version number, then exit + +Report bugs to .\n"; + + exit $status; +} + +# Parse command line. +sub parse_arguments +{ + local (@arglist) = @_; + local (@dirlist); + local ($print_and_exit) = 0; + + while (@arglist) + { + if ($arglist[0] =~ /^--acdir=(.+)$/) + { + $acdir = $1; + } + elsif ($arglist[0] =~/^--output=(.+)$/) + { + $output_file = $1; + } + elsif ($arglist[0] eq '-I') + { + shift (@arglist); + push (@dirlist, $arglist[0]); + } + elsif ($arglist[0] eq '--print-ac-dir') + { + $print_and_exit = 1; + } + elsif ($arglist[0] eq '--verbose') + { + ++$verbosity; + } + elsif ($arglist[0] eq '--version') + { + print "aclocal (GNU $PACKAGE) $VERSION\n\n"; + print "Copyright (C) 1999, 2001 Free Software Foundation, Inc.\n"; + print "This is free software; see the source for copying conditions. There is NO\n"; + print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"; + print "Written by Tom Tromey \n"; + exit 0; + } + elsif ($arglist[0] eq '--help') + { + &usage (0); + } + else + { + die "aclocal: unrecognized option -- \`$arglist[0]'\nTry \`aclocal --help' for more information.\n"; + } + + shift (@arglist); + } + + if ($print_and_exit) + { + print $acdir, "\n"; + exit 0; + } + + # Search the versioned directory near the end, and then the + # unversioned directory last. Only do this if the user didn't + # override acdir. + push (@dirlist, "$acdir-$APIVERSION") + if $acdir eq $default_acdir; + + # By default $(datadir)/aclocal doesn't exist. We don't want to + # get an error in the case where we are searching the default + # directory and it hasn't been created. + push (@dirlist, $acdir) + unless $acdir eq $default_acdir && ! -d $acdir; + + return @dirlist; +} + +################################################################ + +sub scan_configure +{ + warn "aclocal: both `configure.ac' and `configure.in' present:" + . " ignoring `configure.in'\n" + if -f 'configure.ac' && -f 'configure.in'; + $configure_ac = 'configure.in' + if -f 'configure.in'; + $configure_ac = 'configure.ac' + if -f 'configure.ac'; + die "aclocal: `configure.ac' or `configure.in' is required\n" + if !$configure_ac; + + open (CONFIGURE, $configure_ac) + || die "aclocal: couldn't open \`$configure_ac': $!\n"; + + # Make sure we include acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { + &add_file ('acinclude.m4'); + } + + while () + { + # Remove comments from current line. + s/\bdnl\b.*$//; + s/\#.*$//; + + if (/$obsolete_rx/o) + { + chop; + warn "aclocal: $configure_ac: $.: obsolete macro \`$_'\n"; + $exit_status = 1; + next; + } + + # Search for things we know about. The "search" sub is + # constructed dynamically by scan_m4_files. + if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)/) + { + # Macro not found, but AM_ prefix found. + warn "aclocal: $configure_ac: $.: macro \`$2' not found in library\n"; + $exit_status = 1; + } + } + + close (CONFIGURE); +} + +################################################################ + +# Check macros in acinclude.m4. If one is not used, warn. +sub check_acinclude +{ + local ($key); + + foreach $key (keys %map) + { + next unless $map{$key} eq 'acinclude.m4'; + if (! $macro_seen{$key}) + { + # FIXME: should print line number of acinclude.m4. + warn "aclocal: macro \`$key' defined in acinclude.m4 but never used\n"; + } + } +} + +################################################################ + +# Scan all the installed m4 files and construct a map. +sub scan_m4_files +{ + local (@dirlist) = @_; + + # First, scan acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { + $file_contents{'acinclude.m4'} = &scan_file ('acinclude.m4'); + } + + local ($m4dir); + foreach $m4dir (@dirlist) + { + opendir (DIR, $m4dir) + || die "aclocal: couldn't open directory \`$m4dir': $!\n"; + local ($file, $fullfile, $expr); + foreach $file (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'; + + $fullfile = $m4dir . '/' . $file; + $file_contents{$fullfile} = &scan_file ($fullfile); + } + closedir (DIR); + } + + # Construct a new function that does the searching. We use a + # function (instead of just evalling $search in the loop) so that + # "die" is correctly and easily propagated if run. + local ($search, $expr, $key) = ''; + foreach $key (reverse sort keys %map) + { + # EXPR is a regexp matching the name of the macro. + ($expr = $key) =~ s/(\W)/\\$1/g; + $search .= ("if (/" . $expr . "/) { & add_macro (" . $key + . "); return 1; }\n"); + } + $search .= "return 0;\n"; + eval 'sub search { ' . $search . '};'; + die "internal error: $@\n search is $search " if $@; +} + +################################################################ + +# Add a macro to the output. +sub add_macro +{ + local ($macro) = @_; + + # We want to ignore AC_ macros. However, if an AC_ macro is + # defined in (eg) acinclude.m4, then we want to make sure we mark + # it as seen. + return if $macro =~ /^AC_/ && ! defined $map{$macro}; + + if (! defined $map{$macro}) + { + warn "aclocal: macro \`$macro' required but not defined\n"; + $exit_status = 1; + return; + } + + print STDERR "saw macro $macro\n" if $verbosity; + $macro_seen{$macro} = 1; + &add_file ($map{$macro}); +} + +# Add a file to output. +sub add_file +{ + local ($file) = @_; + + # Only add a file once. + return if ($file_seen{$file}); + $file_seen{$file} = 1; + + $output .= $file_contents{$file} . "\n"; + local ($a, @rlist); + foreach (split ("\n", $file_contents{$file})) + { + # This is a hack for Perl 4. + $a = $_; + if ($a =~ /$ac_require_rx/g) + { + push (@rlist, $1); + } + + # This function constructed dynamically. + if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)/) + { + # Macro not found, but AM_ prefix found. + warn "aclocal: $configure_ac: $.: macro \`$2' not found in library\n"; + $exit_status = 1; + } + } + + local ($macro); + foreach $macro (@rlist) + { + &add_macro ($macro); + } +} + +# Scan a single M4 file. Return contents. +sub scan_file +{ + local ($file) = @_; + + open (FILE, $file) + || die "aclocal: couldn't open \`$file': $!\n"; + local ($contents) = ''; + while () + { + # Ignore `##' lines. + next if /^##/; + + $contents .= $_; + + if (/$ac_defun_rx/) + { + if (!defined $map{$1}) + { + $map{$1} = $file; + } + + # 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. + + print STDERR "Found macro $1 in $file: $.\n" if $verbosity; + } + } + close (FILE); + + return $contents; +} + +################################################################ + +# Write output. +sub write_aclocal +{ + return if ! length ($output); + + print STDERR "Writing $output_file\n" if $verbosity; + + open (ACLOCAL, "> " . $output_file) + || die "aclocal: couldn't open \`$output_file' for writing: $!\n"; + print ACLOCAL "dnl $output_file generated automatically by aclocal $VERSION\n"; + print ACLOCAL "\ +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +"; + print ACLOCAL $output; + close (ACLOCAL); +} diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..6271694 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,134 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p6 + +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# Copyright 2002 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.4-p6])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN([AM_MISSING_PROG], +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + diff --git a/ansi2knr.1 b/ansi2knr.1 new file mode 100644 index 0000000..f9ee5a6 --- /dev/null +++ b/ansi2knr.1 @@ -0,0 +1,36 @@ +.TH ANSI2KNR 1 "19 Jan 1996" +.SH NAME +ansi2knr \- convert ANSI C to Kernighan & Ritchie C +.SH SYNOPSIS +.I ansi2knr +[--varargs] input_file [output_file] +.SH DESCRIPTION +If no output_file is supplied, output goes to stdout. +.br +There are no error messages. +.sp +.I ansi2knr +recognizes function definitions by seeing a non-keyword identifier at the left +margin, followed by a left parenthesis, with a right parenthesis as the last +character on the line, and with a left brace as the first token on the +following line (ignoring possible intervening comments). It will recognize a +multi-line header provided that no intervening line ends with a left or right +brace or a semicolon. These algorithms ignore whitespace and comments, except +that the function name must be the first thing on the line. +.sp +The following constructs will confuse it: +.br + - Any other construct that starts at the left margin and follows the +above syntax (such as a macro or function call). +.br + - Some macros that tinker with the syntax of the function header. +.sp +The --varargs switch is obsolete, and is recognized only for +backwards compatibility. The present version of +.I ansi2knr +will always attempt to convert a ... argument to va_alist and va_dcl. +.SH AUTHOR +L. Peter Deutsch wrote the original ansi2knr and +continues to maintain the current version; most of the code in the current +version is his work. ansi2knr also includes contributions by Francois +Pinard and Jim Avera . diff --git a/ansi2knr.c b/ansi2knr.c new file mode 100644 index 0000000..148f7af --- /dev/null +++ b/ansi2knr.c @@ -0,0 +1,609 @@ +/* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */ + +/*$Id: ansi2knr.c $*/ +/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ + +/* +ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY. No author or distributor accepts responsibility to anyone for the +consequences of using it or for whether it serves any particular purpose or +works at all, unless he says so in writing. Refer to the GNU General Public +License (the "GPL") for full details. + +Everyone is granted permission to copy, modify and redistribute ansi2knr, +but only under the conditions described in the GPL. A copy of this license +is supposed to have been given to you along with ansi2knr so you can know +your rights and responsibilities. It should be in a file named COPYLEFT, +or, if there is no file named COPYLEFT, a file named COPYING. Among other +things, the copyright notice and this notice must be preserved on all +copies. + +We explicitly state here what we believe is already implied by the GPL: if +the ansi2knr program is distributed as a separate set of sources and a +separate executable file which are aggregated on a storage medium together +with another program, this in itself does not bring the other program under +the GPL, nor does the mere fact that such a program or the procedures for +constructing it invoke the ansi2knr executable bring any other part of the +program under the GPL. +*/ + +/* + * Usage: + ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] + * --filename provides the file name for the #line directive in the output, + * overriding input_file (if present). + * If no input_file is supplied, input is read from stdin. + * If no output_file is supplied, output goes to stdout. + * There are no error messages. + * + * ansi2knr recognizes function definitions by seeing a non-keyword + * identifier at the left margin, followed by a left parenthesis, + * with a right parenthesis as the last character on the line, + * and with a left brace as the first token on the following line + * (ignoring possible intervening comments), except that a line + * consisting of only + * identifier1(identifier2) + * will not be considered a function definition unless identifier2 is + * the word "void". ansi2knr will recognize a multi-line header provided + * that no intervening line ends with a left or right brace or a semicolon. + * These algorithms ignore whitespace and comments, except that + * the function name must be the first thing on the line. + * The following constructs will confuse it: + * - Any other construct that starts at the left margin and + * follows the above syntax (such as a macro or function call). + * - Some macros that tinker with the syntax of the function header. + */ + +/* + * The original and principal author of ansi2knr is L. Peter Deutsch + * . Other authors are noted in the change history + * that follows (in reverse chronological order): + lpd 1998-11-09 added further hack to recognize identifier(void) + as being a procedure + lpd 1998-10-23 added hack to recognize lines consisting of + identifier1(identifier2) as *not* being procedures + lpd 1997-12-08 made input_file optional; only closes input and/or + output file if not stdin or stdout respectively; prints + usage message on stderr rather than stdout; adds + --filename switch (changes suggested by + ) + lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with + compilers that don't understand void, as suggested by + Tom Lane + lpd 1996-01-15 changed to require that the first non-comment token + on the line following a function header be a left brace, + to reduce sensitivity to macros, as suggested by Tom Lane + + lpd 1995-06-22 removed #ifndefs whose sole purpose was to define + undefined preprocessor symbols as 0; changed all #ifdefs + for configuration symbols to #ifs + lpd 1995-04-05 changed copyright notice to make it clear that + including ansi2knr in a program does not bring the entire + program under the GPL + lpd 1994-12-18 added conditionals for systems where ctype macros + don't handle 8-bit characters properly, suggested by + Francois Pinard ; + removed --varargs switch (this is now the default) + lpd 1994-10-10 removed CONFIG_BROKETS conditional + lpd 1994-07-16 added some conditionals to help GNU `configure', + suggested by Francois Pinard ; + properly erase prototype args in function parameters, + contributed by Jim Avera ; + correct error in writeblanks (it shouldn't erase EOLs) + lpd 1989-xx-xx original version + */ + +/* Most of the conditionals here are to make ansi2knr work with */ +/* or without the GNU configure machinery. */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if HAVE_CONFIG_H + +/* + For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). + This will define HAVE_CONFIG_H and so, activate the following lines. + */ + +# if STDC_HEADERS || HAVE_STRING_H +# include +# else +# include +# endif + +#else /* not HAVE_CONFIG_H */ + +/* Otherwise do it the hard way */ + +# ifdef BSD +# include +# else +# ifdef VMS + extern int strlen(), strncmp(); +# else +# include +# endif +# endif + +#endif /* not HAVE_CONFIG_H */ + +#if STDC_HEADERS +# include +#else +/* + malloc and free should be declared in stdlib.h, + but if you've got a K&R compiler, they probably aren't. + */ +# ifdef MSDOS +# include +# else +# ifdef VMS + extern char *malloc(); + extern void free(); +# else + extern char *malloc(); + extern int free(); +# endif +# endif + +#endif + +/* + * The ctype macros don't always handle 8-bit characters correctly. + * Compensate for this here. + */ +#ifdef isascii +# undef HAVE_ISASCII /* just in case */ +# define HAVE_ISASCII 1 +#else +#endif +#if STDC_HEADERS || !HAVE_ISASCII +# define is_ascii(c) 1 +#else +# define is_ascii(c) isascii(c) +#endif + +#define is_space(c) (is_ascii(c) && isspace(c)) +#define is_alpha(c) (is_ascii(c) && isalpha(c)) +#define is_alnum(c) (is_ascii(c) && isalnum(c)) + +/* Scanning macros */ +#define isidchar(ch) (is_alnum(ch) || (ch) == '_') +#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') + +/* Forward references */ +char *skipspace(); +int writeblanks(); +int test1(); +int convert1(); + +/* The main program */ +int +main(argc, argv) + int argc; + char *argv[]; +{ FILE *in = stdin; + FILE *out = stdout; + char *filename = 0; +#define bufsize 5000 /* arbitrary size */ + char *buf; + char *line; + char *more; + char *usage = + "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; + /* + * In previous versions, ansi2knr recognized a --varargs switch. + * If this switch was supplied, ansi2knr would attempt to convert + * a ... argument to va_alist and va_dcl; if this switch was not + * supplied, ansi2knr would simply drop any such arguments. + * Now, ansi2knr always does this conversion, and we only + * check for this switch for backward compatibility. + */ + int convert_varargs = 1; + + while ( argc > 1 && argv[1][0] == '-' ) { + if ( !strcmp(argv[1], "--varargs") ) { + convert_varargs = 1; + argc--; + argv++; + continue; + } + if ( !strcmp(argv[1], "--filename") && argc > 2 ) { + filename = argv[2]; + argc -= 2; + argv += 2; + continue; + } + fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); + fprintf(stderr, usage); + exit(1); + } + switch ( argc ) + { + default: + fprintf(stderr, usage); + exit(0); + case 3: + out = fopen(argv[2], "w"); + if ( out == NULL ) { + fprintf(stderr, "Cannot open output file %s\n", argv[2]); + exit(1); + } + /* falls through */ + case 2: + in = fopen(argv[1], "r"); + if ( in == NULL ) { + fprintf(stderr, "Cannot open input file %s\n", argv[1]); + exit(1); + } + if ( filename == 0 ) + filename = argv[1]; + /* falls through */ + case 1: + break; + } + if ( filename ) + fprintf(out, "#line 1 \"%s\"\n", filename); + buf = malloc(bufsize); + line = buf; + while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) + { +test: line += strlen(line); + switch ( test1(buf) ) + { + case 2: /* a function header */ + convert1(buf, out, 1, convert_varargs); + break; + case 1: /* a function */ + /* Check for a { at the start of the next line. */ + more = ++line; +f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ + goto wl; + if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) + goto wl; + switch ( *skipspace(more, 1) ) + { + case '{': + /* Definitely a function header. */ + convert1(buf, out, 0, convert_varargs); + fputs(more, out); + break; + case 0: + /* The next line was blank or a comment: */ + /* keep scanning for a non-comment. */ + line += strlen(line); + goto f; + default: + /* buf isn't a function header, but */ + /* more might be. */ + fputs(buf, out); + strcpy(buf, more); + line = buf; + goto test; + } + break; + case -1: /* maybe the start of a function */ + if ( line != buf + (bufsize - 1) ) /* overflow check */ + continue; + /* falls through */ + default: /* not a function */ +wl: fputs(buf, out); + break; + } + line = buf; + } + if ( line != buf ) + fputs(buf, out); + free(buf); + if ( out != stdout ) + fclose(out); + if ( in != stdin ) + fclose(in); + return 0; +} + +/* Skip over space and comments, in either direction. */ +char * +skipspace(p, dir) + register char *p; + register int dir; /* 1 for forward, -1 for backward */ +{ for ( ; ; ) + { while ( is_space(*p) ) + p += dir; + if ( !(*p == '/' && p[dir] == '*') ) + break; + p += dir; p += dir; + while ( !(*p == '*' && p[dir] == '/') ) + { if ( *p == 0 ) + return p; /* multi-line comment?? */ + p += dir; + } + p += dir; p += dir; + } + return p; +} + +/* + * Write blanks over part of a string. + * Don't overwrite end-of-line characters. + */ +int +writeblanks(start, end) + char *start; + char *end; +{ char *p; + for ( p = start; p < end; p++ ) + if ( *p != '\r' && *p != '\n' ) + *p = ' '; + return 0; +} + +/* + * Test whether the string in buf is a function definition. + * The string may contain and/or end with a newline. + * Return as follows: + * 0 - definitely not a function definition; + * 1 - definitely a function definition; + * 2 - definitely a function prototype (NOT USED); + * -1 - may be the beginning of a function definition, + * append another line and look again. + * The reason we don't attempt to convert function prototypes is that + * Ghostscript's declaration-generating macros look too much like + * prototypes, and confuse the algorithms. + */ +int +test1(buf) + char *buf; +{ register char *p = buf; + char *bend; + char *endfn; + int contin; + + if ( !isidfirstchar(*p) ) + return 0; /* no name at left margin */ + bend = skipspace(buf + strlen(buf) - 1, -1); + switch ( *bend ) + { + case ';': contin = 0 /*2*/; break; + case ')': contin = 1; break; + case '{': return 0; /* not a function */ + case '}': return 0; /* not a function */ + default: contin = -1; + } + while ( isidchar(*p) ) + p++; + endfn = p; + p = skipspace(p, 1); + if ( *p++ != '(' ) + return 0; /* not a function */ + p = skipspace(p, 1); + if ( *p == ')' ) + return 0; /* no parameters */ + /* Check that the apparent function name isn't a keyword. */ + /* We only need to check for keywords that could be followed */ + /* by a left parenthesis (which, unfortunately, is most of them). */ + { static char *words[] = + { "asm", "auto", "case", "char", "const", "double", + "extern", "float", "for", "if", "int", "long", + "register", "return", "short", "signed", "sizeof", + "static", "switch", "typedef", "unsigned", + "void", "volatile", "while", 0 + }; + char **key = words; + char *kp; + int len = endfn - buf; + + while ( (kp = *key) != 0 ) + { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) + return 0; /* name is a keyword */ + key++; + } + } + { + char *id = p; + int len; + /* + * Check for identifier1(identifier2) and not + * identifier1(void). + */ + + while ( isidchar(*p) ) + p++; + len = p - id; + p = skipspace(p, 1); + if ( *p == ')' && (len != 4 || strncmp(id, "void", 4)) ) + return 0; /* not a function */ + } + /* + * If the last significant character was a ), we need to count + * parentheses, because it might be part of a formal parameter + * that is a procedure. + */ + if (contin > 0) { + int level = 0; + + for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) + level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); + if (level > 0) + contin = -1; + } + return contin; +} + +/* Convert a recognized function definition or header to K&R syntax. */ +int +convert1(buf, out, header, convert_varargs) + char *buf; + FILE *out; + int header; /* Boolean */ + int convert_varargs; /* Boolean */ +{ char *endfn; + register char *p; + /* + * The breaks table contains pointers to the beginning and end + * of each argument. + */ + char **breaks; + unsigned num_breaks = 2; /* for testing */ + char **btop; + char **bp; + char **ap; + char *vararg = 0; + + /* Pre-ANSI implementations don't agree on whether strchr */ + /* is called strchr or index, so we open-code it here. */ + for ( endfn = buf; *(endfn++) != '('; ) + ; +top: p = endfn; + breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); + if ( breaks == 0 ) + { /* Couldn't allocate break table, give up */ + fprintf(stderr, "Unable to allocate break table!\n"); + fputs(buf, out); + return -1; + } + btop = breaks + num_breaks * 2 - 2; + bp = breaks; + /* Parse the argument list */ + do + { int level = 0; + char *lp = NULL; + char *rp; + char *end = NULL; + + if ( bp >= btop ) + { /* Filled up break table. */ + /* Allocate a bigger one and start over. */ + free((char *)breaks); + num_breaks <<= 1; + goto top; + } + *bp++ = p; + /* Find the end of the argument */ + for ( ; end == NULL; p++ ) + { switch(*p) + { + case ',': + if ( !level ) end = p; + break; + case '(': + if ( !level ) lp = p; + level++; + break; + case ')': + if ( --level < 0 ) end = p; + else rp = p; + break; + case '/': + p = skipspace(p, 1) - 1; + break; + default: + ; + } + } + /* Erase any embedded prototype parameters. */ + if ( lp ) + writeblanks(lp + 1, rp); + p--; /* back up over terminator */ + /* Find the name being declared. */ + /* This is complicated because of procedure and */ + /* array modifiers. */ + for ( ; ; ) + { p = skipspace(p - 1, -1); + switch ( *p ) + { + case ']': /* skip array dimension(s) */ + case ')': /* skip procedure args OR name */ + { int level = 1; + while ( level ) + switch ( *--p ) + { + case ']': case ')': level++; break; + case '[': case '(': level--; break; + case '/': p = skipspace(p, -1) + 1; break; + default: ; + } + } + if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) + { /* We found the name being declared */ + while ( !isidfirstchar(*p) ) + p = skipspace(p, 1) + 1; + goto found; + } + break; + default: + goto found; + } + } +found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) + { if ( convert_varargs ) + { *bp++ = "va_alist"; + vararg = p-2; + } + else + { p++; + if ( bp == breaks + 1 ) /* sole argument */ + writeblanks(breaks[0], p); + else + writeblanks(bp[-1] - 1, p); + bp--; + } + } + else + { while ( isidchar(*p) ) p--; + *bp++ = p+1; + } + p = end; + } + while ( *p++ == ',' ); + *bp = p; + /* Make a special check for 'void' arglist */ + if ( bp == breaks+2 ) + { p = skipspace(breaks[0], 1); + if ( !strncmp(p, "void", 4) ) + { p = skipspace(p+4, 1); + if ( p == breaks[2] - 1 ) + { bp = breaks; /* yup, pretend arglist is empty */ + writeblanks(breaks[0], p + 1); + } + } + } + /* Put out the function name and left parenthesis. */ + p = buf; + while ( p != endfn ) putc(*p, out), p++; + /* Put out the declaration. */ + if ( header ) + { fputs(");", out); + for ( p = breaks[0]; *p; p++ ) + if ( *p == '\r' || *p == '\n' ) + putc(*p, out); + } + else + { for ( ap = breaks+1; ap < bp; ap += 2 ) + { p = *ap; + while ( isidchar(*p) ) + putc(*p, out), p++; + if ( ap < bp - 1 ) + fputs(", ", out); + } + fputs(") ", out); + /* Put out the argument declarations */ + for ( ap = breaks+2; ap <= bp; ap += 2 ) + (*ap)[-1] = ';'; + if ( vararg != 0 ) + { *vararg = 0; + fputs(breaks[0], out); /* any prior args */ + fputs("va_dcl", out); /* the final arg */ + fputs(bp[0], out); + } + else + fputs(breaks[0], out); + } + free((char *)breaks); + return 0; +} diff --git a/automake.in b/automake.in new file mode 100755 index 0000000..8eceea7 --- /dev/null +++ b/automake.in @@ -0,0 +1,7332 @@ +#!@PERL@ +# -*- perl -*- +# @configure_input@ + +eval 'exec @PERL@ -S $0 ${1+"$@"}' + if 0; + +# automake - create Makefile.in from Makefile.am +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Originally written by David Mackenzie . +# Perl reimplementation by Tom Tromey . + + +# Parameters set by configure. Not to be changed. NOTE: assign +# VERSION as string so that eg version 0.30 will print correctly. +$VERSION = "@VERSION@"; +$PACKAGE = "@PACKAGE@"; +$prefix = "@prefix@"; +$am_dir = "@datadir@/@PACKAGE@-@APIVERSION@"; +$TAR = "@TAR@"; + +# String constants. +$IGNORE_PATTERN = "^##([^#].*)?\$"; +$WHITE_PATTERN = "^[ \t]*\$"; +$COMMENT_PATTERN = "^#"; +$RULE_PATTERN = "^([\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*) *:([^=].*|)\$"; +$SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z]+)\\.([a-zA-Z]+)\$"; +$MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*([:+]?)=[ \t]*(.*)\$"; +$BOGUS_MACRO_PATTERN = "^([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$"; +# 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. +$GNITS_VERSION_PATTERN = '[0-9]+\.[0-9]+([a-z]|\.[0-9]+)?(-[A-Za-z0-9]+)?'; +$IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$"; +$ELSE_PATTERN = "^else[ \t]*\(#.*\)?\$"; +$ENDIF_PATTERN = "^endif[ \t]*\(#.*\)?\$"; +$PATH_PATTERN='(\\w|/|\\.)+'; +# This will pass through anything not of the prescribed form. +$INCLUDE_PATTERN = "^include[ \t]+((\\\$\\\(top_srcdir\\\)/${PATH_PATTERN})|(\\\$\\\(srcdir\\\)/${PATH_PATTERN})|([^/\\\$]${PATH_PATTERN}))[ \t]*(#.*)?\$"; + +# Some regular expressions. One reason to put them here is that it +# makes indentation work better in Emacs. +$AC_CONFIG_AUX_DIR_PATTERN = "AC_CONFIG_AUX_DIR\\(([^)]+)\\)"; +$AM_INIT_AUTOMAKE_PATTERN = "AM_INIT_AUTOMAKE\\([^,]*,([^,)]+)[,)]"; +$AM_PACKAGE_VERSION_PATTERN = "^\\s*\\[?([^]\\s]+)\\]?\\s*\$"; +# Note that there is no AC_PATH_TOOL. But we don't really care. +$AC_CHECK_PATTERN = "AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\\(\\[?(\\w+)"; +$AM_MISSING_PATTERN = "AM_MISSING_PROG\\(\\[?(\\w+)"; +# Just check for alphanumeric in AC_SUBST. If you do AC_SUBST(5), +# then too bad. +$AC_SUBST_PATTERN = "AC_SUBST\\(\\[?(\\w+)"; +$AM_CONDITIONAL_PATTERN = "AM_CONDITIONAL\\((\\w+)"; + +# Constants to define the "strictness" level. +$FOREIGN = 0; +$GNU = 1; +$GNITS = 2; + + + +# Variables global to entire run. + +# TRUE if we should always generate Makefile.in. +$force_generation = 1; + +# Strictness level as set on command line. +$default_strictness = $GNU; + +# Name of strictness level, as set on command line. +$default_strictness_name = 'gnu'; + +# This is TRUE if GNU make specific automatic dependency generation +# code should be included in generated Makefile.in. +$cmdline_use_dependencies = 1; + +# This is the name of a dependency makefile bit (usually for inclusion in a +# SMakefile or similar); empty if not set. +$generate_deps = ''; + +# TRUE if in verbose mode. +$verbose = 0; + +# This holds our (eventual) exit status. We don't actually exit until +# we have processed all input files. +$exit_status = 0; + +# From the Perl manual. +$symlink_exists = (eval 'symlink ("", "");', $@ eq ''); + +# TRUE if missing standard files should be installed. +$add_missing = 0; + +# TRUE if we should copy missing files; otherwise symlink if possible. +$copy_missing = 0; + +# Name of the top autoconf input: `configure.ac' or `configure.in' +$configure_ac = ''; + +# Files found by scanning configure.ac for LIBOBJS. +%libsources = (); + +# True if AM_C_PROTOTYPES appears in configure.ac. +$am_c_prototypes = 0; + +# Names used in AC_CONFIG_HEADER call. @config_fullnames holds the +# name which appears in AC_CONFIG_HEADER, colon and all. +# @config_names holds the file names. @config_headers holds the '.in' +# files. Ordinarily these are similar, but they can be different if +# the weird "NAME:FILE" syntax is used. +@config_fullnames = (); +@config_names = (); +@config_headers = (); +# Line number at which AC_CONFIG_HEADER appears in configure.ac. +$config_header_line = 0; + +# Directory where output files go. Actually, output files are +# relative to this directory. +$output_directory = '.'; + +# Relative location of top build directory. +$top_builddir = ''; + +# Absolute location of top build directory. +$build_directory = ''; + +# Name of srcdir as given in build directory's Makefile. For +# dependencies only. +$srcdir_name = ''; + +# List of Makefile.am's to process, and their corresponding outputs. +@input_files = (); +%output_files = (); + +# List of files in AC_OUTPUT without Makefile.am, and their outputs. +@other_input_files = (); +# Line number at which AC_OUTPUT seen. +$ac_output_line = 0; + +# List of directories to search for configure-required files. This +# can be set by AC_CONFIG_AUX_DIR. +@config_aux_path = ('.', '..', '../..'); +$config_aux_dir = ''; + +# Whether AC_PROG_MAKE_SET has been seen in configure.ac. +$seen_make_set = 0; + +# Whether AM_GNU_GETTEXT has been seen in configure.ac. +$seen_gettext = 0; +# Line number at which AM_GNU_GETTEXT seen. +$ac_gettext_line = 0; + +# Whether ALL_LINGUAS has been seen. +$seen_linguas = ''; +# The actual text. +$all_linguas = ''; +# Line number at which it appears. +$all_linguas_line = 0; + +# 1 if AC_PROG_INSTALL seen. +$seen_prog_install = 0; + +# Whether AC_PATH_XTRA has been seen in configure.ac. +$seen_path_xtra = 0; + +# TRUE if AC_DECL_YYTEXT was seen. +$seen_decl_yytext = 0; + +# TRUE if we've seen AC_CANONICAL_(HOST|SYSTEM). The presence of +# AC_CHECK_TOOL also sets this. +$seen_canonical = 0; + +# TRUE if we've seen AC_ARG_PROGRAM. +$seen_arg_prog = 0; + +# TRUE if we've seen AM_PROG_LIBTOOL. +$seen_libtool = 0; +$libtool_line = 0; + +# Files installed by libtoolize. +@libtoolize_files = ('ltmain.sh', 'config.guess', 'config.sub'); +# ltconfig appears here for compatibility with old versions of libtool. +@libtoolize_sometimes = ('ltconfig', 'ltcf-c.sh', 'ltcf-cxx.sh', + 'ltcf-gcj.sh'); + +# TRUE if we've seen AM_MAINTAINER_MODE. +$seen_maint_mode = 0; + +# TRUE if we've seen PACKAGE and VERSION. +$seen_package = 0; +$seen_version = 0; + +# Actual version we've seen. +$package_version = ''; + +# Line number where we saw version definition. +$package_version_line = 0; + +# TRUE if we've seen AM_PATH_LISPDIR. +$seen_lispdir = 0; + +# TRUE if we've seen AC_EXEEXT. +$seen_exeext = 0; + +# TRUE if we've seen AC_OBJEXT. +$seen_objext = 0; + +# TRUE if we've seen AC_ENABLE_MULTILIB. +$seen_multilib = 0; + +# Hash table of discovered configure substitutions. Keys are names, +# values are `FILE:LINE' strings which are used by error message +# generation. +%configure_vars = (); + +# This is used to keep track of which variable definitions we are +# scanning. It is only used in certain limited ways, but it has to be +# global. It is declared just for documentation purposes. +%vars_scanned = (); + +# Charsets used by maintainer and in distribution. MAINT_CHARSET is +# handled in a funny way: if seen in the top-level Makefile.am, it is +# used for every directory which does not specify a different value. +# The rationale here is that some directories (eg gettext) might be +# distributions of other packages, and thus require their own charset +# info. However, the DIST_CHARSET must be the same for the entire +# package; it can only be set at top-level. +# FIXME: this yields bugs when rebuilding. What to do? Always +# read (and sometimes discard) top-level Makefile.am? +$maint_charset = ''; +$dist_charset = 'utf8'; # recode doesn't support this yet. + +# Name of input file ("Makefile.in") and output file ("Makefile.am"). +# These have no directory components. +$am_file_name = ''; +$in_file_name = ''; + +# TRUE if --cygnus seen. +$cygnus_mode = 0; + +# Keys of this hash are names of dependency files to ignore. +%omit_dependencies = (); + +# Hash table of AM_CONDITIONAL variables seen in configure. +%configure_cond = (); + +# Map from obsolete macros to hints for new macros. +# FIXME complete the list so that there are no `0' hints. +%obsolete_macros = + ( + 'AC_FEATURE_CTYPE', "use \`AC_HEADER_STDC'", + 'AC_FEATURE_ERRNO', "add \`strerror' to \`AC_REPLACE_FUNCS(...)'", + 'AC_FEATURE_EXIT', 0, + 'AC_SYSTEM_HEADER', 0, + + # Note that we do not handle this one, because it is still run + # from AM_CONFIG_HEADER. So we deal with it specially in + # scan_configure. + # 'AC_CONFIG_HEADER', "use \`AM_CONFIG_HEADER'", + + 'fp_C_PROTOTYPES', "use \`AM_C_PROTOTYPES'", + 'fp_PROG_CC_STDC', "use \`AM_PROG_CC_STDC'", + 'fp_PROG_INSTALL', "use \`AC_PROG_INSTALL'", + 'fp_WITH_DMALLOC', "use \`AM_WITH_DMALLOC'", + 'fp_WITH_REGEX', "use \`AM_WITH_REGEX'", + 'gm_PROG_LIBTOOL', "use \`AM_PROG_LIBTOOL'", + 'jm_MAINTAINER_MODE', "use \`AM_MAINTAINER_MODE'", + 'md_TYPE_PTRDIFF_T', "use \`AM_TYPE_PTRDIFF_T'", + 'ud_PATH_LISPDIR', "use \`AM_PATH_LISPDIR'", + + # Now part of autoconf proper, under a different name. + 'AM_FUNC_FNMATCH', "use \`AC_FUNC_FNMATCH'", + 'fp_FUNC_FNMATCH', "use \`AC_FUNC_FNMATCH'", + 'AM_SANITY_CHECK_CC', "automatically done by \`AC_PROG_CC'", + 'AM_PROG_INSTALL', "use \`AC_PROG_INSTALL'", + 'AM_EXEEEXT', "use \`AC_EXEEXT'", + 'AM_CYGWIN32', "use \`AC_CYGWIN32'", + 'AM_MINGW32', "use \`AC_MINGW32'", + +# These aren't quite obsolete. +# 'md_PATH_PROG', + ); + +# Regexp to match the above macros. +$obsolete_rx = '\b(' . join ('|', keys %obsolete_macros) . ')\b'; + +# This maps extensions onto language names. +%extension_map = (); + +# This maps languages names onto properties. +%language_map = (); + + + +# Initialize global constants and our list of languages that are +# internally supported. +&initialize_global_constants; + +®ister_language ('c', '', 1, + 'c'); +®ister_language ('cxx', 'CXXLINK', 0, + 'c++', 'cc', 'cpp', 'cxx', 'C'); +®ister_language ('objc', 'OBJCLINK', 0, + 'm'); +®ister_language ('header', '', 0, + 'h', 'H', 'hxx', 'h++', 'hh', 'hpp', 'inc'); +®ister_language ('yacc', '', 1, + 'y'); +®ister_language ('yaccxx', 'CXXLINK', 0, + 'y++', 'yy', 'yxx'); +®ister_language ('lex', '', 1, + 'l'); +®ister_language ('lexxx', 'CXXLINK', 0, + 'l++', 'll', 'lxx'); +®ister_language ('asm', '', 0, + 's', 'S'); +®ister_language ('f77', 'F77LINK', 0, + 'f', 'for', 'f90'); +®ister_language ('ppf77', 'F77LINK', 0, + 'F'); +®ister_language ('ratfor', 'F77LINK', 0, + 'r'); + + +# Parse command line. +&parse_arguments (@ARGV); + +# Do configure.ac scan only once. +&scan_configure; + +die "automake: no \`Makefile.am' found or specified\n" + if ! @input_files; + +# If --generate-deps was given, we don't do anything else +# +if ($generate_deps) +{ + die "automake: Must specify --include-deps (or -i) when generating\n" + if $use_dependencies; + die "automake: Must provide --build-dir when generating\n" + if ! $build_directory; + die "automake: Must provide --srcdir-name when generating\n" + if ! $srcdir_name; + + open (GDEP, ">$output_directory/.dep_segment") + || die "automake: Could not open `$output_directory/.dep_segment': $!\n"; + + &handle_dependencies; + print GDEP $output_rules; + + close(GDEP); + exit $exit_status; +} + +# Now do all the work on each file. +foreach $am_file (@input_files) +{ + if (! -f ($am_file . '.am')) + { + &am_error ("\`" . $am_file . ".am' does not exist"); + } + else + { + &generate_makefile ($output_files{$am_file}, $am_file); + } +} + +&am_conf_error ("AC_PROG_INSTALL must be used in \`$configure_ac'") + if (! $seen_prog_install); + +exit $exit_status; + + +################################################################ + +# Parse command line. +sub parse_arguments +{ + local (@arglist) = @_; + + # Start off as gnu. + &set_strictness ('gnu'); + + while (@arglist) + { + if ($arglist[0] eq "--version") + { + print "automake (GNU $PACKAGE) $VERSION\n\n"; + print "Copyright (C) 1999, 2001 Free Software Foundation, Inc.\n"; + print "This is free software; see the source for copying conditions. There is NO\n"; + print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"; + print "Written by Tom Tromey \n"; + + exit 0; + } + elsif ($arglist[0] eq "--help") + { + &usage; + } + elsif ($arglist[0] =~ /^--amdir=(.+)$/) + { + $am_dir = $1; + } + elsif ($arglist[0] eq '--amdir') + { + &require_argument (@arglist); + shift (@arglist); + $am_dir = $arglist[0]; + } + elsif ($arglist[0] =~ /^--build-dir=(.+)$/) + { + # Must end in /. + $build_directory = $1 . '/'; + } + elsif ($arglist[0] eq '--build-dir') + { + &require_argument (@arglist); + shift (@arglist); + # Must end in /. + $build_directory = $arglist[0] . '/'; + } + elsif ($arglist[0] =~ /^--srcdir-name=(.+)$/) + { + $srcdir_name = $1; + } + elsif ($arglist[0] eq '--srcdir-name') + { + &require_argument (@arglist); + shift (@arglist); + $srcdir_name = $arglist[0]; + } + elsif ($arglist[0] eq '--gnu') + { + &set_strictness ('gnu'); + } + elsif ($arglist[0] eq '--gnits') + { + &set_strictness ('gnits'); + } + elsif ($arglist[0] eq '--cygnus') + { + $cygnus_mode = 1; + } + elsif ($arglist[0] eq '--foreign') + { + &set_strictness ('foreign'); + } + elsif ($arglist[0] eq '--include-deps' || $arglist[0] eq '-i') + { + $cmdline_use_dependencies = 0; + } + elsif ($arglist[0] eq '--generate-deps') + { + $generate_deps = 1; + } + elsif ($arglist[0] eq '--no-force') + { + $force_generation = 0; + } + elsif ($arglist[0] =~ /^--output-dir=(.*)$/) + { + # Set output directory. + $output_directory = $1; + } + elsif ($arglist[0] eq '--output-dir' || $arglist[0] eq '-o') + { + &require_argument (@arglist); + shift (@arglist); + $output_directory = $arglist[0]; + } + elsif ($arglist[0] eq '--add-missing' || $arglist[0] eq '-a') + { + $add_missing = 1; + } + elsif ($arglist[0] eq '--copy' || $arglist[0] eq '-c') + { + $copy_missing = 1; + } + elsif ($arglist[0] eq '--verbose' || $arglist[0] eq '-v') + { + $verbose = 1; + } + elsif ($arglist[0] eq '--') + { + # Stop option processing. + shift (@arglist); + push (@input_files, @arglist); + last; + } + elsif ($arglist[0] =~ /^-/) + { + die "automake: unrecognized option -- \`$arglist[0]'\nTry \`automake --help' for more information.\n"; + } + else + { + # Handle $local:$input syntax. Note that we only examine + # the first ":" file to see if it is automake input; the + # rest are just taken verbatim. We still keep all the + # files around for dependency checking, however. + local ($local, $input, @rest) = split (/:/, $arglist[0]); + if (! $input) + { + $input = $local; + } + else + { + # Strip .in; later on .am is tacked on. That is how + # the automake input file is found. Maybe not the + # best way, but it is easy to explain. FIXME: should + # be error if .in is missing. + $input =~ s/\.in$//; + } + push (@input_files, $input); + $output_files{$input} = join (':', ($local, @rest)); + } + + shift (@arglist); + } + + # Take global strictness from whatever we currently have set. + $default_strictness = $strictness; + $default_strictness_name = $strictness_name; +} + +# Ensure argument exists, or die. +sub require_argument +{ + local ($arg, @arglist) = @_; + die "automake: no argument given for option \`$arg'\n" + if ! @arglist; +} + +################################################################ + +# Generate a Makefile.in given the name of the corresponding Makefile and +# the name of the file output by config.status. +sub generate_makefile +{ + local ($output, $makefile) = @_; + + ($am_file_name = $makefile) =~ s/^.*\///; + $in_file_name = $am_file_name . '.in'; + $am_file_name .= '.am'; + + # $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 file, + # other than to mark them as dependencies. See scan_configure for + # details. + local (@secondary_inputs); + ($output, @secondary_inputs) = split (/:/, $output); + + &initialize_per_input; + $relative_dir = &dirname ($output); + $am_relative_dir = &dirname ($makefile); + + # At the toplevel directory, we might need config.guess, config.sub + # or libtool scripts (ltconfig and ltmain.sh). + if ($relative_dir eq '.') + { + # libtool requires some files. + &require_conf_file_with_conf_line ($libtool_line, $FOREIGN, + @libtoolize_files) + if $seen_libtool; + + # AC_CANONICAL_HOST and AC_CANONICAL_SYSTEM need config.guess and + # config.sub. + &require_config_file ($FOREIGN, 'config.guess', 'config.sub') + if $seen_canonical; + } + + # We still need Makefile.in here, because sometimes the `dist' + # target doesn't re-run automake. + if ($am_relative_dir eq $relative_dir) + { + # Only distribute the files if they are in the same subdir as + # the generated makefile. + &push_dist_common ($in_file_name, $am_file_name); + } + push (@sources, '$(SOURCES)') + if &variable_defined ('SOURCES'); + push (@objects, '$(OBJECTS)') + if &variable_defined ('OBJECTS'); + + &read_main_am_file ($makefile . '.am'); + if (&handle_options) + { + # Fatal error. Just return, so we can continue with next file. + return; + } + + # Check first, because we might modify some state. + &check_cygnus; + &check_gnu_standards; + &check_gnits_standards; + + &handle_configure ($output, $makefile, @secondary_inputs); + &handle_gettext; + &handle_libraries; + &handle_ltlibraries; + &handle_programs; + &handle_scripts; + + &handle_built_sources; + + # This must be run after all the sources are scanned. + &finish_languages; + + # Re-init SOURCES and OBJECTS. FIXME: other code shouldn't depend + # on this (but currently does). + $contents{'SOURCES'} = join (' ', @sources); + $contents{'OBJECTS'} = join (' ', @objects); + + &handle_multilib; + &handle_texinfo; + &handle_emacs_lisp; + &handle_java; + &handle_man_pages; + &handle_data; + &handle_headers; + &handle_subdirs; + &handle_tags; + &handle_minor_options; + &handle_dist ($makefile); + &handle_dependencies; + &handle_tests; + &handle_footer; + &handle_merge_targets ($output); + &handle_installdirs; + &handle_clean; + &handle_phony; + + &check_typos; + + if (! -d ($output_directory . '/' . $am_relative_dir)) + { + mkdir ($output_directory . '/' . $am_relative_dir, 0755); + } + + local ($out_file) = $output_directory . '/' . $makefile . ".in"; + if (! $force_generation && -e $out_file) + { + local ($am_time) = (stat ($makefile . '.am'))[9]; + local ($in_time) = (stat ($out_file))[9]; + # FIXME: should cache these times. + local ($conf_time) = (stat ($configure_ac))[9]; + # FIXME: how to do unsigned comparison? + if ($am_time < $in_time || $am_time < $conf_time) + { + # No need to update. + return; + } + if (-f 'aclocal.m4') + { + local ($acl_time) = (stat _)[9]; + return if ($am_time < $acl_time); + } + } + + if (! open (GM_FILE, "> " . $out_file)) + { + warn "automake: ${am_file}.in: cannot write: $!\n"; + $exit_status = 1; + return; + } + print "automake: creating ", $makefile, ".in\n" if $verbose; + + print GM_FILE $output_vars; + # We make sure that `all:' is the first target. + print GM_FILE $output_all; + print GM_FILE $output_header; + print GM_FILE $output_rules; + print GM_FILE $output_trailer; + + close (GM_FILE); +} + +################################################################ + +# A helper which handles the logic of requiring a version number in +# AUTOMAKE_OPTIONS. Return 1 on error, 0 on success. +sub version_check ($$$$) +{ + my ($rmajor, $rminor, $ralpha, $rfork) = ($1, $2, $3, $4); + + &prog_error ("version is incorrect: $VERSION") + if $VERSION !~ /(\d+)\.(\d+)([a-z]?)-?([A-Za-z0-9]+)?/; + + my ($tmajor, $tminor, $talpha, $tfork) = ($1, $2, $3, $4); + + $rfork ||= ''; + $tfork ||= ''; + + my $rminorminor = 0; + my $tminorminor = 0; + + # Some versions were labelled like `1.4-p3a'. This is the same as + # an alpha release labelled `1.4.3a'. However, a version like + # `1.4g' is the same as `1.4.99g'. Yes, this sucks. Moral: + # always listen to the users. + if ($rfork =~ /p([0-9]+)([a-z]?)/) + { + $rminorminor = $1; + # `1.4a-p3b' never existed. But we'll accept it anyway. + $ralpha = $ralpha || $2 || ''; + $rfork = ''; + } + if ($tfork =~ /p([0-9]+)([a-z]?)/) + { + $tminorminor = $1; + # `1.4a-p3b' never existed. But we'll accept it anyway. + $talpha = $talpha || $2 || ''; + $tfork = ''; + } + + $rminorminor = 99 if $ralpha ne '' && $rminorminor == 0; + $tminorminor = 99 if $talpha ne '' && $tminorminor == 0; + + # 2.0 is better than 1.0. + # 1.2 is better than 1.1. + # 1.2a is better than 1.2. + # If we require 3.4n-foo then we require something + # >= 3.4n, with the `foo' fork identifier. + # The $r* variables are what the user specified. + # The $t* variables denote automake itself. + if ($rmajor > $tmajor + || ($rmajor == $tmajor && $rminor > $tminor) + || ($rminor == $tminor && $rminor == $tminor + && $rminorminor > $tminorminor) + || ($rminor == $tminor && $rminor == $tminor + && $rminorminor == $tminorminor + && $ralpha gt $talpha) + || ($rfork ne '' && $rfork ne $tfork)) + { + &am_line_error ('AUTOMAKE_OPTIONS', + "require version $_, but have $VERSION"); + return 1; + } + + return 0; +} + +# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise. +sub handle_options +{ + if (&variable_defined ('AUTOMAKE_OPTIONS')) + { + foreach (&variable_value_as_list ('AUTOMAKE_OPTIONS', '')) + { + $options{$_} = 1; + if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign') + { + &set_strictness ($_); + } + elsif ($_ eq 'cygnus') + { + $cygnus_mode = 1; + } + elsif (/ansi2knr/) + { + # An option like "../lib/ansi2knr" is allowed. With + # no path prefix, we assume the required programs are + # in this directory. We save the actual option for + # later. + $options{'ansi2knr'} = $_; + } + elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo' + || $_ eq 'dist-shar' || $_ eq 'dist-zip' + || $_ eq 'dist-tarZ' || $_ eq 'dejagnu' + || $_ eq 'no-texinfo.tex' + || $_ eq 'readme-alpha' || $_ eq 'check-news') + { + # Explicitly recognize these. + } + elsif ($_ eq 'no-dependencies') + { + $use_dependencies = 0; + } + elsif (/([0-9]+)\.([0-9]+)([a-z]?)(-[A-Za-z0-9]+)?/) + { + # Got a version number. + + if (version_check ($1, $2, $3, $4)) + { + return 1; + } + } + else + { + &am_line_error ('AUTOMAKE_OPTIONS', + "option \`" . $_ . "\' not recognized"); + } + } + } + + if ($strictness == $GNITS) + { + $options{'readme-alpha'} = 1; + $options{'check-news'} = 1; + } + + return 0; +} + +# Return object extension. Just once, put some code into the output. +# Argument is the name of the output file +sub get_object_extension +{ + local ($out) = @_; + + # Maybe require libtool library object files. + local ($extension) = '.o'; + $extension = '.$(OBJEXT)' if $seen_objext; + $extension = '.lo' if ($out =~ /\.la$/); + + if (! $included_generic_compile) + { + # Boilerplate. + local ($xform) = ''; + if (&variable_defined ('CONFIG_HEADER')) + { + local ($one_hdr); + foreach $one_hdr (split (' ', &variable_value ('CONFIG_HEADER'))) + { + local ($var); + ($var = &dirname ($one_hdr)) =~ s/(\W)/\\$1/g; + $xform .= ' ' if $xform; + $xform .= '-I' . $var; + } + } + $xform = 's/\@CONFIG_INCLUDE_SPEC\@/' . $xform . '/go;'; + $output_vars .= &file_contents_with_transform ($xform, + 'comp-vars'); + + $xform = (($use_dependencies + ? 's/^NOTDEPEND.*$//;' + : 's/^NOTDEPEND//;') + . ($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;')); + $output_rules .= &file_contents_with_transform ($xform, 'compile'); + + &push_phony_cleaners ('compile'); + + # If using X, include some extra variable definitions. NOTE + # we don't want to force these into CFLAGS or anything, + # because not all programs will necessarily use X. + if ($seen_path_xtra) + { + local ($var); + foreach $var ('X_CFLAGS', 'X_LIBS', 'X_EXTRA_LIBS', 'X_PRE_LIBS') + { + &define_configure_variable ($var); + } + } + + push (@suffixes, '.c', '.o', '.S', '.s'); + push (@suffixes, '.obj') if $seen_objext; + push (@clean, 'compile'); + + $included_generic_compile = 1; + } + + if ($seen_libtool && ! $included_libtool_compile) + { + # Output the libtool compilation rules. + $output_rules .= + &file_contents_with_transform + ($use_dependencies ? 's/^NOTDEPEND.*$//;' : 's/^NOTDEPEND//;', + 'libtool'); + + &push_phony_cleaners ('libtool'); + + push (@suffixes, '.lo'); + push (@clean, 'libtool'); + + $included_libtool_compile = 1; + } + + # Check for automatic de-ANSI-fication. + if (defined $options{'ansi2knr'}) + { + $extension = '$U' . $extension; + if (! $included_knr_compile) + { + if (! $am_c_prototypes) + { + &am_line_error ('AUTOMAKE_OPTIONS', + "option \`ansi2knr' in use but \`AM_C_PROTOTYPES' not in \`$configure_ac'"); + &keyed_aclocal_warning ('AM_C_PROTOTYPES'); + # Only give this error once. + $am_c_prototypes = 1; + } + + # Only require ansi2knr files if they should appear in + # this directory. + if ($options{'ansi2knr'} eq 'ansi2knr') + { + &require_file_with_line ('AUTOMAKE_OPTIONS', $FOREIGN, + 'ansi2knr.c', 'ansi2knr.1'); + $output_rules .= &file_contents ('kr-extra'); + push (@clean, 'krextra'); + &push_phony_cleaners ('krextra'); + } + + # Generate rules to build ansi2knr. If it is in some + # other directory, then generate dependencies but have the + # rule just run elsewhere. + $objext = $seen_objext ? ".$(OBJEXT)" : ".o"; + $output_rules .= ($options{'ansi2knr'} . ': ' + . $options{'ansi2knr'} . $objext . "\n"); + if ($options{'ansi2knr'} eq 'ansi2knr') + { + $output_rules .= ("\t\$(LINK) ansi2knr" . $objext + . " \$(LIBS)\n" + . "ansi2knr" . $objext + . ": \$(CONFIG_HEADER)\n\n"); + } + else + { + $output_rules .= ("\tcd " . &dirname ($options{'ansi2knr'}) + . " && \$(MAKE) \$(AM_MAKEFLAGS) " + . "ansi2knr\n\n"); + # This is required for non-GNU makes. + $output_rules .= ($options{'ansi2knr'} . $objext . ":\n"); + $output_rules .= ("\tcd " . &dirname ($options{'ansi2knr'}) + . " && \$(MAKE) \$(AM_MAKEFLAGS)" + . " ansi2knr" . $objext . "\n\n"); + } + + # Make sure ansi2knr can be found: if no path specified, + # specify "./". + if ($options{'ansi2knr'} eq 'ansi2knr') + { + # Substitution from AM_C_PROTOTYPES. This makes it be + # built only when necessary. + &define_configure_variable ('ANSI2KNR'); + # ansi2knr needs to be built before subdirs, so unshift it. + unshift (@all, '$(ANSI2KNR)'); + } + else + { + # Found in another directory. + &define_variable ("ANSI2KNR", $options{'ansi2knr'}); + } + + $output_rules .= &file_contents ('clean-kr'); + + push (@clean, 'kr'); + &push_phony_cleaners ('kr'); + + $included_knr_compile = 1; + } + } + + return $extension; +} + +# Call finish function for each language that was used. +sub finish_languages +{ + local ($ext, $name, $lang, %done); + local ($non_c) = 1; + foreach $ext (sort keys %extension_seen) + { + $lang = $extension_map{$ext}; + next if defined $done{$lang}; + $done{$lang} = 1; + $non_c = 0 if $lang !~ /(objc|cxx|f77|ratfor)$/; + + # Compute the function name of the finisher and then call it. + $name = 'lang_' . $lang . '_finish'; + do $name (); + } + + # If the project is entirely C++ or entirely Fortran 77, don't + # bother with the C stuff. But if anything else creeps in, then use + # it. + if (! $non_c || scalar keys %suffix_rules > 0) + { + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ('CFLAGS'); + &define_variable ('COMPILE', + '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)'); + &define_variable ('LTCOMPILE', + $ltcompile . + '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)') + if ($seen_libtool); + &define_variable ('CCLD', '$(CC)'); + &define_variable ('LINK', $ltlink . '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@'); + } +} + +# Output a rule to build from a YACC source. The output from YACC is +# compiled with C or C++, depending on the extension of the YACC file. +sub output_yacc_build_rule +{ + local ($yacc_suffix, $use_ylwrap, $c_suffix) = @_; + + local ($suffix); + ($suffix = $yacc_suffix) =~ tr/y/c/; + push (@suffixes, $yacc_suffix, $suffix); + + # Generate rule for c/c++. + $output_rules .= "$yacc_suffix$suffix:\n\t"; + + if ($use_ylwrap) + { + $output_rules .= ('$(SHELL) $(YLWRAP)' + . ' "$(YACC)" $< y.tab.c $*' . $suffix + . ' y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS)'); + } + else + { + $output_rules .= ('$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*' + . $suffix . "\n" + . "\tif test -f y.tab.h; then \\\n" + . "\tif cmp -s y.tab.h \$*.h; then rm -f y.tab.h; else mv y.tab.h \$*.h; fi; \\\n" + . "\telse :; fi"); + } + $output_rules .= "\n"; +} + +sub output_lex_build_rule +{ + local ($lex_suffix, $use_ylwrap) = @_; + local ($c_suffix); + + ($c_suffix = $lex_suffix) =~ tr/l/c/; + push (@suffixes, $lex_suffix); + &define_configure_variable ('LEX_OUTPUT_ROOT'); + &define_configure_variable ('LEXLIB'); + $output_rules .= "$lex_suffix$c_suffix:\n\t"; + + if ($use_ylwrap) + { + # Is the $@ correct here? If so, why not use it in the ylwrap + # build rule for yacc above? + $output_rules .= '$(SHELL) $(YLWRAP)' + . ' "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS)'; + } + else + { + $output_rules .= '$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@'; + } + $output_rules .= "\n"; +} + + +# 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 +{ + local ($one_file, $unxformed) = @_; + + local ($prefix, $file, @files); + foreach $prefix ('', 'EXTRA_') + { + if (&variable_defined ($prefix . $one_file . '_SOURCES')) + { + @files = &variable_value_as_list (($prefix + . $one_file . '_SOURCES'), + 'all'); + } + elsif ($prefix eq '') + { + @files = ($unxformed . '.c'); + } + else + { + next; + } + + foreach $file (@files) + { + if (defined $libsources{$file}) + { + &am_line_error ($prefix . $one_file . '_SOURCES', + "automatically discovered file \`$file' should not be explicitly mentioned"); + } + } + } +} + +# Does much of the actual work for handle_source_transform. +# Arguments are: +# object extension (e.g., `$U.lo') +# list of source files to transform +# Result is a list +# first element is name of linker to use (empty string for default linker) +# remaining elements are names of objects +sub handle_single_transform_list +{ + local ($obj, @files) = @_; + local (@result) = (); + local ($nonansi_obj) = $obj; + $nonansi_obj =~ s/_//g; + local (%linkers_used) = (); + if (@files > 0) + { + # Turn sources into objects. + foreach (@files) + { + # Skip things that look like configure substitutions. + next if /^\@.*\@$/; + + # We don't support source files in a subdirectory. The + # reason is that we'd want to put the .o into a similar + # subdirectory, but this means finding a good way to make + # the directory. Later. + if (/\//) + { + &am_error + ("not supported: source file `$_' is in subdirectory"); + next; + } + + # Split file name into base and extension. + local ($base, $extension, $linker, $object); + next if ! /^(.*)\.(.*)$/; + $base = $1; + $extension = $2; + + local ($lang) = $extension_map{$extension}; + if ($lang) + { + &saw_extension ($extension); + # Found the language, so see what it says. + local ($subr) = 'lang_' . $lang . '_rewrite'; + # Note: computed subr call. + local ($r) = do $subr ($base, $extension); + # Skip this entry if we were asked not to process it. + next if ! $r; + + # Now extract linker and other info. + $linker = $language_map{$lang . '-linker'}; + + if ($language_map{$lang . '-ansi-p'}) + { + $object = $base . $obj; + } + else + { + $object = $base . $nonansi_obj; + } + } + elsif ($extension =~ /^$source_suffix_pattern$/) + { + # We just rewrite it. Maybe we should do more. + $object = $base . '.' . $suffix_rules{$extension}; + $linker = ''; + } + else + { + # No error message here. Used to have one, but it was + # very unpopular. + next; + } + + $linkers_used{$linker} = 1; + + push (@result, $object); + + # Transform .o or $o file into .P file (for automatic + # dependency code). + $dep_files{'.deps/' . $base . '.P'} = 1; + } + } + + return (&resolve_linker (%linkers_used), @result); +} + +# Handle SOURCE->OBJECT transform for one program or library. +# Arguments are: +# canonical (transformed) name of object to build +# actual name of object to build +# object extension (ie either `.o' or `$o'. +# Return result is name of 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. + local ($one_file, $unxformed, $obj) = @_; + + local ($linker) = ''; + + if (&variable_defined ($one_file . "_OBJECTS")) + { + &am_line_error ($one_file . '_OBJECTS', + $one_file . '_OBJECTS', 'should not be defined'); + # No point in continuing. + return; + } + + local (@files, @result, $prefix, $temp); + foreach $prefix ('', 'EXTRA_') + { + @files = (); + local ($var) = $prefix . $one_file . "_SOURCES"; + if (&variable_defined ($var)) + { + push (@sources, '$(' . $prefix . $one_file . "_SOURCES)"); + push (@objects, '$(' . $prefix . $one_file . "_OBJECTS)") + unless $prefix eq 'EXTRA_'; + local (@conds) = &variable_conditions ($var); + if (! @conds) + { + @files = &variable_value_as_list ($var, ''); + } + else + { + local ($cond); + foreach $cond (@conds) + { + @files = &variable_value_as_list ($var, $cond); + ($temp, @result) = &handle_single_transform_list ($obj, + @files); + $linker = $temp if $linker eq ''; + + # Define _OBJECTS conditionally. + &define_pretty_variable ($one_file . '_OBJECTS', $cond, + @result) + unless $prefix eq 'EXTRA_'; + } + + next; + } + } + elsif ($prefix eq '') + { + &define_variable ($one_file . "_SOURCES", $unxformed . ".c"); + push (@sources, $unxformed . '.c'); + push (@objects, $unxformed . $obj); + push (@files, $unxformed . '.c'); + } + + ($temp, @result) = &handle_single_transform_list ($obj, @files); + $linker = $temp if $linker eq ''; + &define_pretty_variable ($one_file . "_OBJECTS", '', @result) + unless $prefix eq 'EXTRA_'; + } + + return $linker; +} + +# Handle the BUILT_SOURCES variable. +sub handle_built_sources +{ + return unless &variable_defined ('BUILT_SOURCES'); + + local (@sources) = &variable_value_as_list ('BUILT_SOURCES', 'all'); + local ($s); + foreach $s (@sources) + { + if (/^\@.*\@$/) + { + # FIXME: is this really the right thing to do? + &am_line_error ('BUILT_SOURCES', + "\`BUILT_SOURCES' should not contain a configure substitution"); + last; + } + } + + # We don't care about the return value of this function. We just + # want to make sure to update %dep_files with the contents of + # BUILT_SOURCES. + &handle_single_transform_list (".o", @sources); +} + +# Special-case @ALLOCA@ and @LIBOBJS@ 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 +# boolean (lex_seen) which is true if a lex source file was seen in this +# object. valid only for LDADDs, not LIBADDs. +# Returns 1 if LIBOBJS seen, 0 otherwise. +sub handle_lib_objects +{ + local ($xname, $var, $lex_seen) = @_; + local ($ret); + + die "automake: programming error 1 in handle_lib_objects\n" + if ! &variable_defined ($var); + + die "automake: programming error 2 in handle_lib_objects\n" + if $lex_seen && $var =~ /LIBADD/; + + local (@conds) = &variable_conditions ($var); + if (! @conds) + { + $ret = &handle_lib_objects_cond ($xname, $var, $lex_seen, ''); + } + else + { + local ($cond); + $ret = 0; + foreach $cond (@conds) + { + if (&handle_lib_objects_cond ($xname, $var, $lex_seen, $cond)) + { + $ret = 1; + } + } + } + + return $ret; +} + +# Subroutine of handle_lib_objects: handle a particular condition. +sub handle_lib_objects_cond +{ + local ($xname, $var, $lex_seen, $cond) = @_; + + # We recognize certain things that are commonly put in LIBADD or + # LDADD. + local ($lsearch); + local (@dep_list) = (); + + local ($seen_libobjs) = 0; + local ($flagvar) = 0; + + foreach $lsearch (&variable_value_as_list ($var, $cond)) + { + # Skip -lfoo and -Ldir; these are explicitly allowed. + next if $lsearch =~ /^-[lL]/; + if (! $flagvar && $lsearch =~ /^-/) + { + if ($var =~ /^(.*)LDADD$/) + { + &am_line_error ($var, "linker flags such as \`$lsearch' belong in \`${1}LDFLAGS"); + } + else + { + # Only get this error once. + $flagvar = 1; + &am_line_error ($var, "you cannot use linker flags such as \`$lsearch' in \`$var'"); + } + } + + # Assume we have a file of some sort, and push it onto the + # dependency list. Autoconf substitutions are not pushed; + # rarely is a new dependency substituted into (eg) foo_LDADD + # -- but "bad things (eg -lX11) are routinely substituted. + # Note that LIBOBJS and ALLOCA are exceptions to this rule, + # and handled specially below. + push (@dep_list, $lsearch) + unless $lsearch =~ /^\@.*\@$/; + + # Automatically handle @LIBOBJS@ and @ALLOCA@. Basically this + # means adding entries to dep_files. + if ($lsearch =~ /^\@(LT)?LIBOBJS\@$/) + { + push (@dep_list, $lsearch); + $seen_libobjs = 1; + if (! keys %libsources) + { + &am_line_error ($var, "\@$1" . "LIBOBJS\@ seen but never set in \`$configure_ac'"); + } + + local ($iter, $rewrite); + foreach $iter (keys %libsources) + { + if ($iter =~ /\.([cly])$/) + { + &saw_extension ($1); + &saw_extension ('c'); + } + + if ($iter =~ /\.h$/) + { + &require_file_with_line ($var, $FOREIGN, $iter); + } + elsif ($iter ne 'alloca.c') + { + ($rewrite = $iter) =~ s/\.c$/.P/; + $dep_files{'.deps/' . $rewrite} = 1; + &require_file_with_line ($var, $FOREIGN, $iter); + } + } + } + elsif ($lsearch =~ /^\@(LT)?ALLOCA\@$/) + { + push (@dep_list, $lsearch); + &am_line_error ($var, + "\@$1" . "ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`$configure_ac'") + if ! defined $libsources{'alloca.c'}; + $dep_files{'.deps/alloca.P'} = 1; + &require_file_with_line ($var, $FOREIGN, 'alloca.c'); + &saw_extension ('c'); + } + } + + if ($xname ne '' && ! &variable_defined ($xname . '_DEPENDENCIES', $cond)) + { + &define_pretty_variable ($xname . '_DEPENDENCIES', $cond, @dep_list); + } + + return $seen_libobjs; +} + +# 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 +{ + local ($name, @suffixes) = @_; + local ($xname, $xt); + + ($xname = $name) =~ tr/A-Za-z0-9_/_/c; + if ($xname ne $name) + { + local ($xt); + foreach $xt (@suffixes) + { + &am_line_error ($name . $xt, + "invalid variable \`" . $name . $xt + . "'; should be \`" . $xname . $xt . "'") + if &variable_defined ($name . $xt); + } + } + + return $xname; +} + +# Handle C programs. +sub handle_programs +{ + local (@proglist) = &am_install_var ('-clean', + 'progs', 'PROGRAMS', + 'bin', 'sbin', 'libexec', 'pkglib', + 'noinst', 'check'); + return if ! @proglist; + + # If a program is installed, this is required. We only want this + # error to appear once. + &am_conf_error ("AC_ARG_PROGRAM must be used in \`$configure_ac'") + unless $seen_arg_prog; + $seen_arg_prog = 1; + + local ($one_file, $xname, $munge); + + local ($seen_libobjs) = 0; + foreach $one_file (@proglist) + { + local ($obj) = &get_object_extension ($one_file); + + # Canonicalize names and check for misspellings. + $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); + + # FIXME: Using a trick to figure out if any lex sources appear + # in our program; should use some cleaner method. + local ($lex_num) = scalar (keys %lex_sources); + local ($linker) = &handle_source_transform ($xname, $one_file, $obj); + local ($lex_file_seen) = (scalar (keys %lex_sources) > $lex_num); + + local ($xt) = ''; + if (&variable_defined ($xname . "_LDADD")) + { + if (&handle_lib_objects ($xname, $xname . '_LDADD', + $lex_file_seen)) + { + $seen_libobjs = 1; + } + $lex_file_seen = 0; + $xt = '_LDADD'; + } + else + { + # User didn't define prog_LDADD override. So do it. + &define_variable ($xname . '_LDADD', '$(LDADD)'); + + # This does a bit too much work. But we need it to + # generate _DEPENDENCIES when appropriate. + if (&variable_defined ('LDADD')) + { + if (&handle_lib_objects ($xname, 'LDADD', $lex_file_seen)) + { + $seen_libobjs = 1; + } + $lex_file_seen = 0; + } + elsif (! &variable_defined ($xname . '_DEPENDENCIES')) + { + &define_variable ($xname . '_DEPENDENCIES', ''); + } + $xt = '_SOURCES' + } + + if (&variable_defined ($xname . '_LIBADD')) + { + &am_line_error ($xname . '_LIBADD', + "use \`" . $xname . "_LDADD', not \`" + . $xname . "_LIBADD'"); + } + + if (! &variable_defined ($xname . '_LDFLAGS')) + { + # Define the prog_LDFLAGS variable. + &define_variable ($xname . '_LDFLAGS', ''); + } + + # Determine program to use for link. + local ($xlink); + if (&variable_defined ($xname . '_LINK')) + { + $xlink = $xname . '_LINK'; + } + else + { + $xlink = $linker ? $linker : 'LINK'; + } + + local ($xexe); + if ($seen_exeext && $one_file !~ /\./) + { + $xexe = 's/\@EXEEXT\@/\$(EXEEXT)/g;'; + } + else + { + $xexe = 's/\@EXEEXT\@//g;'; + } + + $output_rules .= + &file_contents_with_transform + ('s/\@PROGRAM\@/' . $one_file . '/go;' + . 's/\@XPROGRAM\@/' . $xname . '/go;' + . 's/\@XLINK\@/' . $xlink . '/go;' + . $xexe, + 'program'); + } + + if (&variable_defined ('LDADD') && &handle_lib_objects ('', 'LDADD', 0)) + { + $seen_libobjs = 1; + } + + if ($seen_libobjs) + { + foreach $one_file (@proglist) + { + # Canonicalize names. + ($xname = $one_file) =~ tr/A-Za-z0-9_/_/c; + + if (&variable_defined ($xname . '_LDADD')) + { + &check_libobjs_sources ($xname, $xname . '_LDADD'); + } + elsif (&variable_defined ('LDADD')) + { + &check_libobjs_sources ($xname, 'LDADD'); + } + } + } +} + + +# Handle libraries. +sub handle_libraries +{ + local (@liblist) = &am_install_var ('-clean', + 'libs', 'LIBRARIES', + 'lib', 'pkglib', 'noinst', 'check'); + return if ! @liblist; + + local (%valid) = &am_primary_prefixes ('LIBRARIES', 'lib', 'pkglib', + 'noinst', 'check'); + if (! defined $configure_vars{'RANLIB'}) + { + local ($key); + foreach $key (keys %valid) + { + if (&variable_defined ($key . '_LIBRARIES')) + { + &am_line_error ($key . '_LIBRARIES', "library used but \`RANLIB' not defined in \`$configure_ac'"); + # Only get this error once. If this is ever printed, + # we have a bug. + $configure_vars{'RANLIB'} = 'BUG'; + last; + } + } + } + + local ($onelib); + local ($munge); + local ($xlib); + local ($seen_libobjs) = 0; + foreach $onelib (@liblist) + { + # Check that the library fits the standard naming convention. + if ($onelib !~ /^lib.*\.a$/) + { + # FIXME should put line number here. That means mapping + # from library name back to variable name. + &am_error ("\`$onelib' is not a standard library name"); + } + + local ($obj) = &get_object_extension ($onelib); + + # Canonicalize names and check for misspellings. + $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES', + '_OBJECTS', '_DEPENDENCIES'); + + if (&variable_defined ($xlib . '_LIBADD')) + { + if (&handle_lib_objects ($xlib, $xlib . '_LIBADD', 0)) + { + $seen_libobjs = 1; + } + } + else + { + # Generate support for conditional object inclusion in + # libraries. + &define_variable ($xlib . "_LIBADD", ''); + } + + if (&variable_defined ($xlib . '_LDADD')) + { + &am_line_error ($xlib . '_LDADD', + "use \`" . $xlib . "_LIBADD', not \`" + . $xlib . "_LDADD'"); + } + + # Make sure we at look at this. + &examine_variable ($xlib . '_DEPENDENCIES'); + + &handle_source_transform ($xlib, $onelib, $obj); + + $output_rules .= + &file_contents_with_transform ('s/\@LIBRARY\@/' . $onelib . '/go;' + . 's/\@XLIBRARY\@/' + . $xlib . '/go;', + 'library'); + } + + if ($seen_libobjs) + { + foreach $onelib (@liblist) + { + # Canonicalize names. + ($xlib = $onelib) =~ tr/A-Za-z0-9_/_/c; + if (&variable_defined ($xlib . '_LIBADD')) + { + &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + } + } + } + + &define_variable ('AR', 'ar'); + &define_configure_variable ('RANLIB'); +} + +# Handle shared libraries. +sub handle_ltlibraries +{ + local (@liblist) = &am_install_var ('-clean', + 'ltlib', 'LTLIBRARIES', + 'noinst', 'lib', 'pkglib'); + return if ! @liblist; + + local (%instdirs); + local (%valid) = &am_primary_prefixes ('LTLIBRARIES', 'lib', 'pkglib', + 'noinst'); + + local ($key); + foreach $key (keys %valid) + { + if (&variable_defined ($key . '_LTLIBRARIES')) + { + if (!$seen_libtool) + { + &am_line_error ($key . '_LTLIBRARIES', "library used but \`LIBTOOL' not defined in \`$configure_ac'"); + # Only get this error once. If this is ever printed, + # we have a bug. + $configure_vars{'LIBTOOL'} = 'BUG'; + $seen_libtool = 1; + } + + # Get the installation directory of each library. + for (&variable_value_as_list ($key . '_LTLIBRARIES', 'all')) + { + if ($instdirs{$_}) + { + &am_error ("\`$_' is already going to be installed in \`$instdirs{$_}'"); + } + else + { + $instdirs{$_} = $key; + } + } + } + } + + local ($onelib); + local ($munge); + local ($xlib); + local ($seen_libobjs) = 0; + foreach $onelib (@liblist) + { + local ($obj) = &get_object_extension ($onelib); + + # Canonicalize names and check for misspellings. + $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS', + '_SOURCES', '_OBJECTS', + '_DEPENDENCIES'); + + if (! &variable_defined ($xlib . '_LDFLAGS')) + { + # Define the lib_LDFLAGS variable. + &define_variable ($xlib . '_LDFLAGS', ''); + } + + # Check that the library fits the standard naming convention. + $libname_rx = "^lib.*\.la"; + if (&variable_value ($xlib . '_LDFLAGS') =~ /-module/) + { + # Relax name checking for libtool modules. + $libname_rx = "\.la"; + } + if ($onelib !~ /$libname_rx$/) + { + # FIXME this should only be a warning for foreign packages + # FIXME should put line number here. That means mapping + # from library name back to variable name. + &am_error ("\`$onelib' is not a standard libtool library name"); + } + + if (&variable_defined ($xlib . '_LIBADD')) + { + if (&handle_lib_objects ($xlib, $xlib . '_LIBADD', 0)) + { + $seen_libobjs = 1; + } + } + else + { + # Generate support for conditional object inclusion in + # libraries. + &define_variable ($xlib . "_LIBADD", ''); + } + + if (&variable_defined ($xlib . '_LDADD')) + { + &am_line_error ($xlib . '_LDADD', + "use \`" . $xlib . "_LIBADD', not \`" + . $xlib . "_LDADD'"); + } + + # Make sure we at look at this. + &examine_variable ($xlib . '_DEPENDENCIES'); + + local ($linker) = &handle_source_transform ($xlib, $onelib, $obj); + + # Determine program to use for link. + local ($xlink); + if (&variable_defined ($xlib . '_LINK')) + { + $xlink = $xlib . '_LINK'; + } + else + { + $xlink = $linker ? $linker : 'LINK'; + } + + local ($rpath); + if ($instdirs{$onelib} eq 'EXTRA' || $instdirs{$onelib} eq 'noinst') + { + # 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. + $rpath = 's/\@RPATH\@//go;'; + } + else + { + $rpath = ('s/\@RPATH\@/-rpath \$(' . $instdirs{$onelib} + . 'dir)/go;'); + } + + $output_rules .= + &file_contents_with_transform ('s/\@LTLIBRARY\@/' + . $onelib . '/go;' + . 's/\@XLTLIBRARY\@/' + . $xlib . '/go;' + . $rpath + . 's/\@XLINK\@/' . $xlink . '/go;', + 'ltlibrary'); + } + + if ($seen_libobjs) + { + foreach $onelib (@liblist) + { + # Canonicalize names. + ($xlib = $onelib) =~ tr/A-Za-z0-9_/_/c; + if (&variable_defined ($xlib . '_LIBADD')) + { + &check_libobjs_sources ($xlib, $xlib . '_LIBADD'); + } + } + } +} + +# See if any _SOURCES variable were misspelled. Also, make sure that +# EXTRA_ variables don't contain configure substitutions. +sub check_typos +{ + local ($varname, $primary); + foreach $varname (keys %contents) + { + foreach $primary ('_SOURCES', '_LIBADD', '_LDADD', '_LDFLAGS', + '_DEPENDENCIES') + { + if ($varname =~ /$primary$/ && ! $content_seen{$varname}) + { + &am_line_error ($varname, + "invalid unused variable name: \`$varname'"); + } + } + } +} + +# Handle scripts. +sub handle_scripts +{ + # NOTE we no longer automatically clean SCRIPTS, because it is + # useful to sometimes distribute scripts verbatim. This happens + # eg in Automake itself. + &am_install_var ('scripts', 'SCRIPTS', + 'bin', 'sbin', 'libexec', 'pkgdata', + 'noinst', 'check'); + + local ($scripts_installed) = 0; + # Set $scripts_installed if appropriate. Make sure we only find + # scripts which are actually installed -- this is why we can't + # simply use the return value of am_install_var. + local (%valid) = &am_primary_prefixes ('SCRIPTS', 'bin', 'sbin', + 'libexec', 'pkgdata', + 'noinst', 'check'); + local ($key); + foreach $key (keys %valid) + { + if ($key ne 'noinst' + && $key ne 'check' + && &variable_defined ($key . '_SCRIPTS')) + { + $scripts_installed = 1; + # push (@check_tests, 'check-' . $key . 'SCRIPTS'); + } + } + + if ($scripts_installed) + { + # If a program is installed, this is required. We only want this + # error to appear once. + &am_conf_error ("AC_ARG_PROGRAM must be used in \`$configure_ac'") + unless $seen_arg_prog; + $seen_arg_prog = 1; + } +} + +# Search a file for a "version.texi" Texinfo include. Return the name +# of the include file if found, or the empty string if not. A +# "version.texi" file is actually any file whose name matches +# "vers*.texi". +sub scan_texinfo_file +{ + local ($filename) = @_; + + if (! open (TEXI, $filename)) + { + &am_error ("couldn't open \`$filename': $!"); + return ''; + } + print "automake: reading $filename\n" if $verbose; + + local ($vfile, $outfile); + while () + { + if (/^\@setfilename +(\S+)/) + { + $outfile = $1; + last if ($vfile); + } + + if (/^\@include\s+(vers[^.]*\.texi)\s*$/) + { + # Found version.texi include. + $vfile = $1; + last if $outfile; + } + } + + close (TEXI); + return ($outfile, $vfile); +} + +# Handle all Texinfo source. +sub handle_texinfo +{ + &am_line_error ('TEXINFOS', + "\`TEXINFOS' is an anachronism; use \`info_TEXINFOS'") + if &variable_defined ('TEXINFOS'); + return if (! &variable_defined ('info_TEXINFOS') + && ! &variable_defined ('html_TEXINFOS')); + + if (&variable_defined ('html_TEXINFOS')) + { + &am_line_error ('html_TEXINFOS', + "HTML generation not yet supported"); + return; + } + + local (@texis) = &variable_value_as_list ('info_TEXINFOS', 'all'); + + local (@info_deps_list, @dvis_list, @texi_deps); + local ($infobase, $info_cursor); + local (%versions); + local ($done) = 0; + local ($vti); + local ($tc_cursor, @texi_cleans); + local ($canonical); + + foreach $info_cursor (@texis) + { + # FIXME: This is mildly hacky, since it recognizes "txinfo". + # I don't feel like making it right. + ($infobase = $info_cursor) =~ s/\.te?xi(nfo)?$//; + + # If 'version.texi' is referenced by input file, then include + # automatic versioning capability. + local ($out_file, $vtexi) = &scan_texinfo_file ($relative_dir + . "/" . $info_cursor); + + if ($out_file eq '') + { + &am_error ("\`$info_cursor' missing \@setfilename"); + next; + } + + if ($out_file =~ /\.(.+)$/ && $1 ne 'info') + { + # FIXME should report line number in input file. + &am_error ("output of \`$info_cursor', \`$out_file', has unrecognized extension"); + next; + } + + if ($vtexi) + { + &am_error ("\`$vtexi', included in \`$info_cursor', also included in \`$versions{$vtexi}'") + if (defined $versions{$vtexi} && $vtexi ne "version.texi"); + $versions{$vtexi} = $info_cursor; + + # 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. + $vti = 'vti' . ($done ? ".$done" : ''); + &push_dist_common ($vtexi, 'stamp-' . $vti); + push (@clean, $vti); + + # Only require once. + &require_conf_file_with_line ('info_TEXINFOS', $FOREIGN, + 'mdate-sh') + if ! $done; + ++$done; + + local ($conf_pat, $conf_dir); + if ($config_aux_dir eq '.' || $config_aux_dir eq '') + { + $conf_dir = '$(srcdir)/'; + } + else + { + $conf_dir = $config_aux_dir; + $conf_dir .= '/' unless $conf_dir =~ /\/$/; + } + ($conf_pat = $conf_dir) =~ s/(\W)/\\$1/g; + $output_rules .= + &file_contents_with_transform + ('s/\@TEXI\@/' . $info_cursor . '/g; ' + . 's/\@VTI\@/' . $vti . '/g; ' + . 's/\@VTEXI\@/' . $vtexi . '/g;' + . 's,\@MDDIR\@,' . $conf_pat . ',g;' + . 's,\@CONFIGURE_AC\@,' . $configure_ac . ',g;', + 'texi-vers'); + + &push_phony_cleaners ($vti); + } + + # If user specified file_TEXINFOS, then use that as explicit + # dependency list. + @texi_deps = (); + push (@texi_deps, $info_cursor); + push (@texi_deps, $vtexi) if $vtexi; + + # Canonicalize name first. + ($canonical = $infobase) =~ tr/A-Za-z0-9_/_/c; + if (&variable_defined ($canonical . "_TEXINFOS")) + { + push (@texi_deps, '$(' . $canonical . '_TEXINFOS)'); + &push_dist_common ('$(' . $canonical . '_TEXINFOS)'); + } + + $output_rules .= ("\n" . $out_file . ": " + . join (' ', @texi_deps) + . "\n" . $infobase . ".dvi: " + . join (' ', @texi_deps) + . "\n\n"); + + push (@info_deps_list, $out_file); + push (@dvis_list, $infobase . '.dvi'); + + # Generate list of things to clean for this target. We do + # this explicitly because otherwise too many things could be + # removed. In particular the ".log" extension might + # reasonably be used in other contexts by the user. + foreach $tc_cursor ('aux', 'cp', 'cps', 'dvi', 'fn', 'fns', + 'ky', 'kys', 'ps', 'log', 'pg', 'toc', 'tp', 'tps', + 'vr', 'vrs', 'op', 'tr', 'cv', 'cn') + { + push (@texi_cleans, $infobase . '.' . $tc_cursor); + } + } + + # Find these programs wherever they may lie. Yes, this has + # intimate knowledge of the structure of the texinfo distribution. + &define_program_variable ('MAKEINFO', 'build', 'texinfo/makeinfo', + 'makeinfo', + # Circumlocution to avoid accidental + # configure substitution. + '@MAKE' . 'INFO@'); + &define_program_variable ('TEXI2DVI', 'src', 'texinfo/util', + 'texi2dvi'); + + # Set transform for including texinfos.am. First, handle --cygnus + # stuff. + local ($xform); + if ($cygnus_mode) + { + $xform = 's/^NOTCYGNUS.*$//; s/^CYGNUS//;'; + } + else + { + $xform = 's/^CYGNUS.*$//; s/^NOTCYGNUS//;'; + } + + # Handle location of texinfo.tex. + local ($need_texi_file) = 0; + local ($texinfo_tex); + if ($cygnus_mode) + { + $texinfo_tex = '$(top_srcdir)/../texinfo/texinfo.tex'; + &define_variable ('TEXINFO_TEX', $texinfo_tex); + + } + elsif ($config_aux_dir ne '.' && $config_aux_dir ne '') + { + $texinfo_tex = $config_aux_dir . '/texinfo.tex'; + &define_variable ('TEXINFO_TEX', $texinfo_tex); + } + elsif (&variable_defined ('TEXINFO_TEX')) + { + # The user defined TEXINFO_TEX so assume he knows what he is + # doing. + $texinfo_tex = ('$(srcdir)/' + . &dirname (&variable_value ('TEXINFO_TEX'))); + } + else + { + $texinfo_tex = '.'; + $need_texi_file = 1; + } + local ($xxform); + ($xxform = $texinfo_tex) =~ s/(\W)/\\$1/g; + $xform .= ' s/\@TEXINFODIR\@/' . $xxform . '/g;'; + + $output_rules .= &file_contents_with_transform ($xform, 'texinfos'); + push (@phony, 'install-info-am', 'uninstall-info'); + push (@dist_targets, 'dist-info'); + + # How to clean. The funny name is due to --cygnus influence; in + # Cygnus mode, `clean-info' is a target that users can use. + $output_rules .= "\nmostlyclean-aminfo:\n"; + &pretty_print_rule ("\t-rm -f", "\t ", @texi_cleans); + $output_rules .= ("\nclean-aminfo:\n\ndistclean-aminfo:\n\n" + . "maintainer-clean-aminfo:\n\t" + # Eww. But how else can we find all the output + # files from makeinfo? + . ($cygnus_mode ? '' : 'cd $(srcdir) && ') + . 'for i in $(INFO_DEPS); do' . " \\\n" + . "\t" . ' rm -f $$i;' . " \\\n" + . "\t" . ' if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then' . " \\\n" + . "\t" . ' rm -f $$i-[0-9]*;' . " \\\n" + . "\t" . ' fi;' . " \\\n" + . "\tdone\n"); + &push_phony_cleaners ('aminfo'); + if ($cygnus_mode) + { + $output_rules .= "clean-info: mostlyclean-aminfo\n"; + } + + push (@suffixes, '.texi', '.texinfo', '.txi', '.info', '.dvi', '.ps'); + + if (! defined $options{'no-installinfo'}) + { + push (@uninstall, 'uninstall-info'); + push (@installdirs, '$(DESTDIR)$(infodir)'); + unshift (@install_data, 'install-info-am'); + + # 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)'); + } + push (@clean, 'aminfo'); + push (@info, '$(INFO_DEPS)'); + push (@dvi, '$(DVIS)'); + + &define_variable ("INFO_DEPS", join (' ', @info_deps_list)); + &define_variable ("DVIS", join (' ', @dvis_list)); + # 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')); + + # Do some error checking. Note that this file is not required + # when in Cygnus mode; instead we defined TEXINFO_TEX explicitly + # up above. + &require_file_with_line ('info_TEXINFOS', $FOREIGN, 'texinfo.tex') + if $need_texi_file && ! defined $options{'no-texinfo.tex'}; +} + +# Handle any man pages. +sub handle_man_pages +{ + &am_line_error ('MANS', "\`MANS' is an anachronism; use \`man_MANS'") + if &variable_defined ('MANS'); + return if ! &variable_defined ('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. + local ($sect, %sections, %vlist); + # Add more sections as needed. + foreach $sect ('0'..'9', 'n', 'l') + { + if (&variable_defined ('man' . $sect . '_MANS')) + { + $sections{$sect} = 1; + $vlist{'$(man' . $sect . '_MANS)'} = 1; + } + } + + if (&variable_defined ('man_MANS')) + { + $vlist{'$(man_MANS)'} = 1; + foreach (&variable_value_as_list ('man_MANS', 'all')) + { + # A page like `foo.1c' goes into man1dir. + if (/\.([0-9a-z])([a-z]*)$/) + { + $sections{$1} = 1; + } + } + } + + + # Now for each section, generate an install and unintall rule. + # Sort sections so output is deterministic. + local (@namelist); + foreach $sect (sort keys %sections) + { + &define_variable ('man' . $sect . 'dir', '$(mandir)/man' . $sect); + push (@installdirs, '$(DESTDIR)$(mandir)/man' . $sect) + unless defined $options{'no-installman'}; + $output_rules .= &file_contents_with_transform ('s/\@SECTION\@/' + . $sect . '/g;', + 'mans'); + push (@phony, 'install-man' . $sect, 'uninstall-man' . $sect); + push (@namelist, 'install-man' . $sect); + } + + # We don't really need this, but we use it in case we ever want to + # support noinst_MANS. + &define_variable ("MANS", join (' ', sort keys %vlist)); + + # Generate list of install dirs. + $output_rules .= ("install-man: \$(MANS)\n" + . "\t\@\$(NORMAL_INSTALL)\n"); + &pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @namelist); + push (@phony, 'install-man'); + + $output_rules .= "uninstall-man:\n\t\@\$(NORMAL_UNINSTALL)\n"; + grep ($_ = 'un' . $_, @namelist); + &pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @namelist); + push (@phony, 'uninstall-man'); + + $output_vars .= &file_contents ('mans-vars'); + + if (! defined $options{'no-installman'}) + { + push (@install_data, 'install-man'); + push (@uninstall, 'uninstall-man'); + push (@all, '$(MANS)'); + } +} + +# Handle DATA variables. +sub handle_data +{ + &am_install_var ('-noextra', 'data', 'DATA', 'data', 'sysconf', + 'sharedstate', 'localstate', 'pkgdata', + 'noinst', 'check'); +} + +# Handle TAGS. +sub handle_tags +{ + push (@phony, 'tags'); + local (@tag_deps) = (); + if (&variable_defined ('SUBDIRS')) + { + $output_rules .= ("tags-recursive:\n" + . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n" + # Never fail here if a subdir fails; it + # isn't important. + . "\t test \"\$\$subdir\" = . || (cd \$\$subdir" + . " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n" + . "\tdone\n"); + push (@tag_deps, 'tags-recursive'); + push (@phony, 'tags-recursive'); + } + + if (&saw_sources_p (1) + || &variable_defined ('ETAGS_ARGS') + || @tag_deps) + { + local ($xform) = ''; + local ($one_hdr); + foreach $one_hdr (@config_headers) + { + if ($relative_dir eq &dirname ($one_hdr)) + { + # The config header is in this directory. So require it. + local ($var); + ($var = &basename ($one_hdr)) =~ s/(\W)/\\$1/g; + $xform .= ' ' if $xform; + $xform .= $var; + } + } + $xform = ('s/\@CONFIG\@/' . $xform . '/;' + . 's/\@DIRS\@/' . join (' ', @tag_deps) . '/;'); + + if (&variable_defined ('SUBDIRS')) + { + $xform .= 's/^SUBDIRS//;'; + } + else + { + $xform .= 's/^SUBDIRS.*$//;'; + } + + $output_rules .= &file_contents_with_transform ($xform, 'tags'); + $output_rules .= &file_contents ('tags-clean'); + push (@clean, 'tags'); + &push_phony_cleaners ('tags'); + &examine_variable ('TAGS_DEPENDENCIES'); + } + elsif (&variable_defined ('TAGS_DEPENDENCIES')) + { + &am_line_error ('TAGS_DEPENDENCIES', + "doesn't make sense to define \`TAGS_DEPENDENCIES' without sources or \`ETAGS_ARGS'"); + } + else + { + # 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. + $output_rules .= "tags: TAGS\nTAGS:\n\n"; + } +} + +# Handle multilib support. +sub handle_multilib +{ + return unless $seen_multilib; + + $output_rules .= &file_contents ('multilib.am'); + &push_phony_cleaners ('multi'); + push (@phony, 'all-multi', 'install-multi'); +} + +# Worker for handle_dist. +sub handle_dist_worker +{ + local ($makefile) = @_; + + $output_rules .= 'distdir: $(DISTFILES)' . "\n"; + + # Initialization; only at top level. + if ($relative_dir eq '.') + { + if (defined $options{'check-news'}) + { + # For Gnits users, this is pretty handy. Look at 15 lines + # in case some explanatory text is desirable. + $output_rules .= ' @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \\ + echo "NEWS not updated; not releasing" 1>&2; \\ + exit 1; \\ + fi +'; + } + + + # Create dist directory. + $output_rules .= ("\t-rm -rf \$(distdir)\n" + . "\tmkdir \$(distdir)\n" + . "\t-chmod 777 \$(distdir)\n"); + } + + # Only run automake in `dist' target if --include-deps and + # `no-dependencies' not specified. That way the recipient of a + # distribution can run "make dist" and not need Automake. You + # might be wondering why we run automake once for each directory + # we distribute, instead of running it once at the top level. The + # answer is that we want to run automake after the dependencies + # have been generated. This occurs when "make" is run in the + # subdir. So automake must be run after make has updated the + # Makefile, which means that it must run once per directory. + if ($use_dependencies) + { + $output_rules .= + ( + # There are several directories we need to know about + # when rebuilding the Makefile.ins. They are: + # here - The absolute path to our topmost build directory. + # top_distdir - The absolute path to the top of our dist + # hierarchy. + # distdir - The path to our sub-part of the dist hierarchy. + # If this directory is the topmost directory, we set + # top_distdir from distdir; that lets us pass in distdir + # from an enclosing package. + "\t" . 'here=`cd $(top_builddir) && pwd`; ' . "\\\n" + . "\t" . 'top_distdir=`cd $(' + . (($relative_dir eq '.') ? 'distdir' : 'top_distdir') + . ') && pwd`; ' . "\\\n" + . "\t" . 'distdir=`cd $(distdir) && pwd`; ' . "\\\n" + . "\tcd \$(top_srcdir) \\\n" + . "\t && \$(AUTOMAKE) --include-deps --build-dir=\$\$here --srcdir-name=\$(top_srcdir) --output-dir=\$\$top_distdir " + # Set strictness of output. + . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name)) + . ($cmdline_use_dependencies ? '' : ' --include-deps') + . " " . $makefile . "\n" + ); + } + + # Scan EXTRA_DIST to see if we need to distribute anything from a + # subdir. If so, add it to the list. I didn't want to do this + # originally, but there were so many requests that I finally + # relented. + local (@dist_dirs); + if (&variable_defined ('EXTRA_DIST')) + { + # FIXME: This should be fixed to work with conditionals. That + # will require only making the entries in @dist_dirs under the + # appropriate condition. This is meaningful if the nature of + # the distribution should depend upon the configure options + # used. + foreach (&variable_value_as_list ('EXTRA_DIST', '')) + { + next if /^\@.*\@$/; + next unless s,/+[^/]+$,,; + push (@dist_dirs, $_) + unless $_ eq '.'; + } + } + if (@dist_dirs) + { + # Prepend $(distdir) to each directory given. Doing it via a + # hash lets us ensure that each directory is used only once. + local (%dhash); + grep ($dhash{'$(distdir)/' . $_} = 1, @dist_dirs); + $output_rules .= "\t"; + &pretty_print_rule ('$(mkinstalldirs)', "\t ", sort keys %dhash); + } + + # In loop, 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. + # Also, 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. + $output_rules .= "\t\@for file in \$(DISTFILES); do \\\n"; + if ($cygnus_mode) + { + $output_rules .= "\t if test -f \$\$file; then d=.; else d=\$(srcdir); fi; \\\n"; + } + else + { + $output_rules .= "\t d=\$(srcdir); \\\n"; + } + $output_rules .= ("\t if test -d \$\$d/\$\$file; then \\\n" + . "\t cp -pr \$\$d/\$\$file \$(distdir)/\$\$file; \\\n" + . "\t else \\\n" + . "\t test -f \$(distdir)/\$\$file \\\n" + . "\t || ln \$\$d/\$\$file \$(distdir)/\$\$file 2> /dev/null \\\n" + . "\t || cp -p \$\$d/\$\$file \$(distdir)/\$\$file || :; \\\n" + . "\t fi; \\\n" + . "\tdone\n"); + + # If we have SUBDIRS, create all dist subdirectories and do + # recursive build. + if (&variable_defined ('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. + local ($dist_subdir_name); + if (&variable_conditions ('SUBDIRS') + || &variable_defined ('DIST_SUBDIRS')) + { + $dist_subdir_name = 'DIST_SUBDIRS'; + if (! &variable_defined ('DIST_SUBDIRS')) + { + &define_pretty_variable ('DIST_SUBDIRS', '', + &variable_value_as_list ('SUBDIRS', + 'all')); + } + } + else + { + $dist_subdir_name = 'SUBDIRS'; + } + + # 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. + $output_rules .= + ("\t" . 'for subdir in $(' . $dist_subdir_name . '); do ' . "\\\n" + . "\t" . ' if test "$$subdir" = .; then :; else ' . "\\\n" + . "\t" . ' test -d $(distdir)/$$subdir ' . "\\\n" + . "\t" . ' || mkdir $(distdir)/$$subdir ' . "\\\n" + . "\t" . ' || exit 1; ' . "\\\n" + . "\t" . ' chmod 777 $(distdir)/$$subdir; ' . "\\\n" + . "\t" . ' (cd $$subdir' + . ' && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(' + . (($relative_dir eq '.') ? 'distdir' : 'top_distdir') + . ') distdir=../$(distdir)/$$subdir distdir) ' . "\\\n" + . "\t" . ' || exit 1; ' . "\\\n" + . "\t" . ' fi; ' . "\\\n" + . "\tdone\n"); + } + + # 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 &target_defined ('dist-hook'); + + local ($targ); + foreach $targ (@dist_targets) + { + # We must explicitly set distdir and top_distdir for these + # sub-makes. + $output_rules .= ("\t\$(MAKE) \$(AM_MAKEFLAGS)" + . " top_distdir=\"\$(top_distdir)\"" + . " distdir=\"\$(distdir)\" $targ\n"); + } + + push (@phony, 'distdir'); +} + +# Handle 'dist' target. +sub handle_dist +{ + local ($makefile) = @_; + + # Set up maint_charset. + $local_maint_charset = &variable_value ('MAINT_CHARSET') + if &variable_defined ('MAINT_CHARSET'); + $maint_charset = $local_maint_charset + if $relative_dir eq '.'; + + if (&variable_defined ('DIST_CHARSET')) + { + &am_line_error ('DIST_CHARSET', + "DIST_CHARSET defined but no MAINT_CHARSET defined") + if ! $local_maint_charset; + if ($relative_dir eq '.') + { + $dist_charset = &variable_value ('DIST_CHARSET') + } + else + { + &am_line_error ('DIST_CHARSET', + "DIST_CHARSET can only be defined at top level"); + } + } + + # Look for common files that should be included in distribution. + local ($cfile); + foreach $cfile (@common_files) + { + if (-f ($relative_dir . "/" . $cfile)) + { + &push_dist_common ($cfile); + } + } + + # 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. + &push_dist_common ($configure_ac, 'configure') + if $relative_dir eq '.'; + + # Keys of %dist_common are names of files to distributed. We put + # README first because it then becomes easier to make a + # Usenet-compliant shar file (in these, README must be first). + # FIXME: do more ordering of files here. + local (@coms); + if (defined $dist_common{'README'}) + { + push (@coms, 'README'); + delete $dist_common{'README'}; + } + push (@coms, sort keys %dist_common); + + &define_pretty_variable ("DIST_COMMON", '', @coms); + $output_vars .= "\n"; + + # Some boilerplate. + $output_vars .= &file_contents ('dist-vars') . "\n"; + &define_variable ('TAR', $TAR); + &define_variable ('GZIP_ENV', '--best'); + + # Put these things in rules section so it is easier for whoever + # reads Makefile.in. + if (! &variable_defined ('distdir')) + { + if ($relative_dir eq '.') + { + $output_rules .= "\n" . 'distdir = $(PACKAGE)-$(VERSION)' . "\n"; + } + else + { + $output_rules .= ("\n" + . 'distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)' + . "\n"); + } + } + if ($relative_dir eq '.') + { + $output_rules .= "top_distdir = \$(distdir)\n\n"; + } + else + { + $output_rules .= "\nsubdir = " . $relative_dir . "\n\n"; + } + + # Generate 'dist' target, and maybe dist-shar / dist-zip / dist-tarZ. + if ($relative_dir eq '.') + { + # Rule to check whether a distribution is viable. + $output_rules .= ('# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \\' + . (&target_defined ('distcheck-hook') + ? ("\n\t\$(MAKE) \$(AM_MAKEFLAGS)" + . " distcheck-hook; \\") + : '') + . ' + cd $(distdir)/=build \\ + && ../configure ' + + . ($seen_gettext ? '--with-included-gettext ' : '') + . '--srcdir=.. --prefix=$$dc_install_base \\ + && $(MAKE) $(AM_MAKEFLAGS) \\ + && $(MAKE) $(AM_MAKEFLAGS) dvi \\ + && $(MAKE) $(AM_MAKEFLAGS) check \\ + && $(MAKE) $(AM_MAKEFLAGS) install \\ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \\ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \\ + dashes=`echo "$$banner" | sed s/./=/g`; \\ + echo "$$dashes"; \\ + echo "$$banner"; \\ + echo "$$dashes" +'); + + local ($dist_all) = ('dist-all: distdir' . "\n" + . $dist_header); + local ($curs); + foreach $curs ('dist', 'dist-shar', 'dist-zip', 'dist-tarZ') + { + if (defined $options{$curs} || $curs eq 'dist') + { + $output_rules .= ($curs . ': distdir' . "\n" + . $dist_header + . $dist{$curs} + . $dist_trailer); + $dist_all .= $dist{$curs}; + } + } + $output_rules .= $dist_all . $dist_trailer; + } + + # Generate distdir target. + &handle_dist_worker ($makefile); +} + +# Scan a single dependency file and rewrite the dependencies as +# appropriate. Essentially this means: +# * Clean out absolute dependencies which are not desirable. +# * Rewrite other dependencies to be relative to $(top_srcdir). +sub scan_dependency_file +{ + local ($depfile) = @_; + + if (! open (DEP_FILE, $depfile)) + { + &am_error ("couldn't open \`$depfile': $!"); + return; + } + print "automake: reading $depfile\n" if $verbose; + + # Sometimes it is necessary to omit some dependencies. + local (%omit) = %omit_dependencies; + if (&variable_defined ('OMIT_DEPENDENCIES')) + { + # FIXME: Doesn't work with conditionals. I'm not sure if this + # matters. + grep ($omit{$_} = 1, + &variable_value_as_list ('OMIT_DEPENDENCIES', '')); + } + + local ($first_line) = 1; + local ($last_line) = 0; + local ($target, @dependencies); + local ($one_dep, $xform); + local ($just_file); + + local ($srcdir_rx, $fixup_rx); + ($fixup_rx = $srcdir_name . '/' . $relative_dir . '/') + =~ s/(\W)/\\$1/g; + ($srcdir_rx = $srcdir_name . '/') =~ s/(\W)/\\$1/g; + + local ($rewrite_builddir) = (($top_builddir eq '.') + ? '' + : $top_builddir . '/'); + + while () + { + last if $last_line; + next if (/$WHITE_PATTERN/o); + chop; + if (! s/\\$//) + { + # No trailing "\" means this should be the last line of + # the first target. We can have multiple targets due to + # the "deleted header file" fix. For the generated + # Makefile we simply skip these fake targets. + $last_line = 1; + } + + if ($first_line) + { + if (! /^([^:]+:)(.+)$/) + { + bad_format: + &am_error ("\`$depfile' has incorrect format"); + close (DEP_FILE); + return; + } + + $_ = $2; + # Make sure to strip the .P file from the target. + ($target = $1) =~ s, *\.deps/[^.]+\.P,,; + + $first_line = 0; + } + + foreach $one_dep (split (' ', $_)) + { + ($just_file = $one_dep) =~ s,^.*/,,; + next if defined $omit{$just_file}; + + if ($one_dep =~ /^$fixup_rx/) + { + # The dependency points to the current directory in + # some way. + ($xform = $one_dep) =~ s/^$fixup_rx//; + push (@dependencies, $xform); + } + elsif ($one_dep =~ /^$srcdir_rx/) + { + # The dependency is in some other directory in the package. + ($xform = $one_dep) =~ s/^$srcdir_rx/$rewrite_builddir/; + push (@dependencies, $xform); + } + elsif ($one_dep =~ /^\// || $one_dep =~ /^[A-Za-z]:\\/) + { + # Absolute path; ignore. + } + else + { + # Anything else is assumed to be correct. + push (@dependencies, $one_dep); + } + } + } + + &pretty_print_rule ($target, "\t", @dependencies); + + close (DEP_FILE); +} + +# Handle auto-dependency code. +sub handle_dependencies +{ + # Make sure this variable is always marked as used. + &examine_variable ('OMIT_DEPENDENCIES'); + + if ($use_dependencies) + { + # Include GNU-make-specific auto-dep code. Don't include it + # if DEP_FILES would be empty. + if (&saw_sources_p (0) && keys %dep_files) + { + &define_pretty_variable ('DEP_FILES', '', sort keys %dep_files); + $output_rules .= &file_contents ('depend'); + push (@clean, 'depend'); + &push_phony_cleaners ('depend'); + # FIXME: this should use another property of the language + # instead of being hard-coded. + $output_rules .= + &file_contents_with_transform ('s/\@EXT\@/.c/g;' + . 's/\@PFX\@//g;', + 'depend2'); + local ($ext); + foreach $ext (&objc_extensions) + { + $output_rules .= + &file_contents_with_transform ('s/\@EXT\@/' . $ext . '/g;' + . 's/\@PFX\@/OBJC/g;', + 'depend2'); + } + foreach $ext (&cxx_extensions) + { + $output_rules .= + &file_contents_with_transform ('s/\@EXT\@/' . $ext .'/g;' + . 's/\@PFX\@/CXX/g;', + 'depend2'); + } + } + } + elsif ($build_directory ne '') + { + # Include any auto-generated deps that are present. Note that + # $build_directory ends in a "/". + if (-d ($build_directory . $relative_dir . "/.deps")) + { + local ($depfile); + + foreach $depfile (&my_glob ($build_directory + . $relative_dir . "/.deps/*.P")) + { + &scan_dependency_file ($depfile); + } + + $output_rules .= "\n"; + } + } +} + +# Handle subdirectories. +sub handle_subdirs +{ + return if ! &variable_defined ('SUBDIRS'); + + # Make sure each directory mentioned in SUBDIRS actually exists. + local ($dir); + foreach $dir (&variable_value_as_list ('SUBDIRS', 'all')) + { + # Skip directories substituted by configure. + next if $dir =~ /^\@.*\@$/; + + if (! -d $am_relative_dir . '/' . $dir) + { + &am_line_error ('SUBDIRS', + "required directory $am_relative_dir/$dir does not exist"); + next; + } + + &am_line_error ('SUBDIRS', "directory should not contain \`/'") + if $dir =~ /\//; + } + + local ($xform) = ('s/\@INSTALLINFO\@/' . + (defined $options{'no-installinfo'} + ? 'install-info-recursive' + : '') + . '/;'); + $output_rules .= &file_contents_with_transform ($xform, 'subdirs'); + + # Push a bunch of phony targets. + local ($phonies); + foreach $phonies ('-data', '-exec', 'dirs') + { + push (@phony, 'install' . $phonies . '-recursive'); + push (@phony, 'uninstall' . $phonies . '-recursive'); + } + foreach $phonies ('all', 'check', 'installcheck', 'info', 'dvi') + { + push (@phony, $phonies . '-recursive'); + } + &push_phony_cleaners ('recursive'); + + $recursive_install = 1; +} + +# Handle aclocal.m4. +sub handle_aclocal_m4 +{ + local ($regen_aclocal) = 0; + if (-f 'aclocal.m4') + { + &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4'); + &push_dist_common ('aclocal.m4'); + + if (open (ACLOCAL, '< aclocal.m4')) + { + local ($line); + $line = ; + close (ACLOCAL); + + if ($line =~ 'generated automatically by aclocal') + { + $regen_aclocal = 1; + } + } + } + + local ($acinclude) = 0; + if (-f 'acinclude.m4') + { + $regen_aclocal = 1; + $acinclude = 1; + } + + # Note that it might be possible that aclocal.m4 doesn't exist but + # should be auto-generated. This case probably isn't very + # important. + if ($regen_aclocal) + { + local (@ac_deps) = ( + ($seen_maint_mode + ? "\@MAINTAINER_MODE_TRUE\@" + : "") , + $configure_ac, + ($acinclude ? ' acinclude.m4' : '') + ); + + # Scan all -I directories for m4 files. These are our + # dependencies. + if (&variable_defined ('ACLOCAL_AMFLAGS')) + { + local ($examine_next, $amdir) = 0; + foreach $amdir (&variable_value_as_list ('ACLOCAL_AMFLAGS', '')) + { + if ($examine_next) + { + $examine_next = 0; + if ($amdir !~ /^\// && -d $amdir) + { + push (@ac_deps, &my_glob ($amdir . '/*.m4')); + } + } + elsif ($amdir eq '-I') + { + $examine_next = 1; + } + } + } + + &pretty_print_rule ("\$(ACLOCAL_M4):", "\t\t", @ac_deps); + + $output_rules .= ("\t" + . 'cd $(srcdir) && $(ACLOCAL)' + . (&variable_defined ('ACLOCAL_AMFLAGS') + ? ' $(ACLOCAL_AMFLAGS)' : '') + . "\n"); + } +} + +# Rewrite a list of input files into a form suitable to put on a +# dependency list. The idea is that if an input file has a directory +# part the same as the current directory, then the directory part is +# simply removed. But if the directory part is different, then +# $(top_srcdir) is prepended. Among other things, this is used to +# generate the dependency list for the output files generated by +# AC_OUTPUT. Consider what the dependencies should look like in this +# case: +# AC_OUTPUT(src/out:src/in1:lib/in2) +# The first argument, ADD_SRCDIR, is 1 if $(top_srcdir) should be added. +# If 0 then files that require this addition will simply be ignored. +sub rewrite_inputs_into_dependencies +{ + local ($add_srcdir, @inputs) = @_; + local ($single, @newinputs); + + foreach $single (@inputs) + { + if (&dirname ($single) eq $relative_dir) + { + push (@newinputs, &basename ($single)); + } + elsif ($add_srcdir) + { + push (@newinputs, '$(top_srcdir)/' . $single); + } + } + + return @newinputs; +} + +# Handle remaking and configure stuff. +# We need the name of the input file, to do proper remaking rules. +sub handle_configure +{ + local ($local, $input, @secondary_inputs) = @_; + + # If SUBDIRS defined, require AC_PROG_MAKE_SET. + &am_line_error ('SUBDIRS', "AC_PROG_MAKE_SET must be used in \`$configure_ac'") + if &variable_defined ('SUBDIRS') && ! $seen_make_set; + + local ($top_reldir); + + local ($input_base) = &basename ($input); + local ($local_base) = &basename ($local); + + local ($amfile) = $input_base . '.am'; + # We know we can always add '.in' because it really should be an + # error if the .in was missing originally. + local ($infile) = '$(srcdir)/' . $input_base . '.in'; + local ($colon_infile); + if ($local ne $input || @secondary_inputs) + { + $colon_infile = ':' . $input . '.in'; + } + $colon_infile .= ':' . join (':', @secondary_inputs) + if @secondary_inputs; + + local (@rewritten) = &rewrite_inputs_into_dependencies (1, + @secondary_inputs); + + # This rule remakes the Makefile.in. Note use of + # @MAINTAINER_MODE_TRUE@ forces us to abandon pretty-printing. + # Sigh. + $output_rules .= ($infile + # NOTE perl 5.003 (with -w) gives a + # uninitialized value error on the next line. + # Don't know why. + . ': ' + . ($seen_maint_mode ? "\@MAINTAINER_MODE_TRUE\@ " : '') + . $amfile . ' ' + . '$(top_srcdir)/' + . $configure_ac + . ' $(ACLOCAL_M4)' + . ' ' . join (' ', @include_stack) + . "\n" + . "\tcd \$(top_srcdir) && \$(AUTOMAKE) " + . ($cygnus_mode ? '--cygnus' : ('--' . $strictness_name)) + . ($cmdline_use_dependencies ? '' : ' --include-deps') + . ' ' . $input . $colon_infile . "\n\n"); + + # This rule remakes the Makefile. + $output_rules .= ($local_base + # NOTE: bogus uninit value error on next line; + # see comment above. + . ': ' + . $infile . ' ' + . join (' ', @rewritten) + . ' $(top_builddir)/config.status' + # NOTE: Makefile only depends on BUILT_SOURCES + # when dependencies are being computed. This is + # a workaround for an obscure bug with + # AC_LINK_FILES. Anyway, when dependencies are + # turned off, this shouldn't matter. + . ($use_dependencies ? ' $(BUILT_SOURCES)' : '') + . "\n" + . "\tcd \$(top_builddir) \\\n" + . "\t && CONFIG_FILES=" + . (($relative_dir eq '.') ? '$@' : '$(subdir)/$@') + . $colon_infile + . ' CONFIG_HEADERS= $(SHELL) ./config.status' + . "\n\n"); + + if ($relative_dir ne '.') + { + # In subdirectory. + $top_reldir = '../'; + } + else + { + &handle_aclocal_m4; + $output_rules .= &file_contents_with_transform ('s,\@CONFIGURE_AC\@,' + . $configure_ac + . ',;', + 'remake'); + &examine_variable ('CONFIG_STATUS_DEPENDENCIES'); + &examine_variable ('CONFIGURE_DEPENDENCIES'); + $top_reldir = ''; + } + + # Make it easy to see if there is a Makefile.am in a given + # directory. + local (%make_dirs, $iter); + foreach $iter (@input_files) + { + $make_dirs{&dirname ($iter)} = 1; + } + # We also want to notice Makefile.in's. + foreach $iter (@other_input_files) + { + if ($iter =~ /Makefile\.in$/) + { + $make_dirs{&dirname ($iter)} = 1; + } + } + + # If we have a configure header, require it. + local ($one_hdr); + local (@local_fullnames) = @config_fullnames; + local (@local_names) = @config_names; + local ($hdr_index) = 0; + local ($distclean_config) = ''; + foreach $one_hdr (@config_headers) + { + local ($one_fullname) = shift (@local_fullnames); + local ($one_name) = shift (@local_names); + $hdr_index += 1; + local ($header_dir) = &dirname ($one_name); + + # 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 $header_dir + || ($relative_dir eq '.' && ! defined $make_dirs{$header_dir})) + { + local ($ch_sans_dir, $cn_sans_dir, $stamp_dir); + if ($relative_dir eq $header_dir) + { + $cn_sans_dir = &basename ($one_name); + $stamp_dir = ''; + } + else + { + $cn_sans_dir = $one_name; + if ($header_dir eq '.') + { + $stamp_dir = ''; + } + else + { + $stamp_dir = $header_dir . '/'; + } + } + + # Compute relative path from directory holding output + # header to directory holding input header. FIXME: + # doesn't handle case where we have multiple inputs. + if (&dirname ($one_hdr) eq $relative_dir) + { + $ch_sans_dir = &basename ($one_hdr); + } + else + { + local (@rel_out_path, $rel_path); + # FIXME this chunk of code should be its own sub. + # It is used elsewhere. + foreach (split (/\//, $relative_dir)) + { + next if $_ eq '' || $_ eq '.'; + if ($_ eq '..') + { + # FIXME: actually this is an error. + pop @rel_out_path; + } + else + { + push (@rel_out_path, '..'); + } + } + if (@rel_out_path) + { + $ch_sans_dir = join ('/', @rel_out_path) . '/' . $one_hdr; + } + else + { + $ch_sans_dir = $one_hdr; + } + } + + &require_file_with_conf_line ($config_header_line, + $FOREIGN, $ch_sans_dir); + + # Header defined and in this directory. + local (@files); + if (-f $relative_dir . '/acconfig.h') + { + push (@files, 'acconfig.h'); + } + if (-f $one_name . '.top') + { + push (@files, "${cn_sans_dir}.top"); + } + if (-f $one_name . '.bot') + { + push (@files, "${cn_sans_dir}.bot"); + } + + &push_dist_common (@files); + + local ($stamp_name) = 'stamp-h'; + $stamp_name .= "${hdr_index}" if scalar (@config_headers) > 1; + + local ($xform) = ''; + + $xform = 's,\@FILES\@,' . join (' ', @files) . ',;'; + $xform .= 's,\@CONFIG_HEADER\@,' . "${cn_sans_dir}" . ',;'; + $xform .= 's,\@CONFIG_HEADER_IN\@,' . "${ch_sans_dir}" . ',;'; + $xform .= 's,\@CONFIG_HEADER_FULL\@,' . "${one_fullname}" . ',;'; + $xform .= 's,\@STAMP\@,' . "${stamp_dir}${stamp_name}" . ',;'; + $xform .= 's,\@CONFIGURE_AC\@,' . "${configure_ac}" . ',;'; + + $output_rules .= &file_contents_with_transform ($xform, + 'remake-hdr'); + + local ($out_dir) = &dirname ($ch_sans_dir); + &create ("${relative_dir}/${out_dir}/${stamp_name}.in"); + &require_file_with_conf_line ($config_header_line, $FOREIGN, + "${out_dir}/${stamp_name}.in"); + + $distclean_config .= ' ' if $distclean_config; + $distclean_config .= $cn_sans_dir; + } + } + + if ($distclean_config) + { + $output_rules .= &file_contents_with_transform ('s,\@FILES\@,' + . $distclean_config + . ',;', + 'clean-hdr'); + push (@clean, 'hdr'); + &push_phony_cleaners ('hdr'); + } + + # Set location of mkinstalldirs. + if ($config_aux_dir ne '.' && $config_aux_dir ne '') + { + &define_variable ('mkinstalldirs', ('$(SHELL) ' . $config_aux_dir + . '/mkinstalldirs')); + } + else + { + &define_variable ('mkinstalldirs', + '$(SHELL) $(top_srcdir)/mkinstalldirs'); + } + + &am_line_error ('CONFIG_HEADER', + "\`CONFIG_HEADER' is an anachronism; now determined from \`$configure_ac'") + if &variable_defined ('CONFIG_HEADER'); + + local ($one_name); + local ($config_header) = ''; + foreach $one_name (@config_names) + { + # Generate CONFIG_HEADER define. + local ($one_hdr); + if ($relative_dir eq &dirname ($one_name)) + { + $one_hdr = &basename ($one_name); + } + else + { + $one_hdr = "${top_builddir}/${one_name}"; + } + + $config_header .= ' ' if $config_header; + $config_header .= $one_hdr; + } + if ($config_header) + { + &define_variable ("CONFIG_HEADER", $config_header); + } + + # Now look for other files in this directory which must be remade + # by config.status, and generate rules for them. + local (@actual_other_files) = (); + local ($lfile, $local); + local (@inputs, @rewritten_inputs, $single); + local ($need_rewritten); + foreach $lfile (@other_input_files) + { + local ($file); + if ($lfile =~ /^([^:]*):(.*)$/) + { + # This is the ":" syntax of AC_OUTPUT. + $file = $1; + $local = &basename ($file); + @inputs = split (':', $2); + @rewritten_inputs = &rewrite_inputs_into_dependencies (1, @inputs); + $need_rewritten = 1; + } + else + { + # Normal usage. + $file = $lfile; + $local = &basename ($file); + @inputs = ($local . '.in'); + @rewritten_inputs = + &rewrite_inputs_into_dependencies (1, $file . '.in'); + $need_rewritten = 0; + } + + # Skip files not in this directory. + next unless &dirname ($file) eq $relative_dir; + + # Skip any file that is an automake input. + next if -f $file . '.am'; + + # Some users have been tempted to put `stamp-h' in the + # AC_OUTPUT line. This won't do the right thing, so we + # explicitly fail here. + if ($local eq 'stamp-h') + { + # FIXME: allow real filename. + &am_conf_error ($configure_ac, $ac_output_line, + 'stamp-h should not appear in AC_OUTPUT'); + next; + } + + $output_rules .= ($local . ': ' + . '$(top_builddir)/config.status ' + . join (' ', @rewritten_inputs) . "\n" + . "\t" + . 'cd $(top_builddir) && CONFIG_FILES=' + . ($relative_dir eq '.' ? '' : '$(subdir)/') + . '$@' . ($need_rewritten + ? (':' . join (':', @inputs)) + : '') + . ' CONFIG_HEADERS= $(SHELL) ./config.status' + . "\n"); + push_dist_common (@rewritten_inputs); + push (@actual_other_files, $local); + + # Require all input files. + &require_file_with_conf_line ($ac_output_line, $FOREIGN, + &rewrite_inputs_into_dependencies (0, @inputs)); + } + + # These files get removed by "make clean". + &define_pretty_variable ('CONFIG_CLEAN_FILES', '', @actual_other_files); +} + +# Handle C headers. +sub handle_headers +{ + local (@r); + @r = &am_install_var ('header', 'HEADERS', 'include', + 'oldinclude', 'pkginclude', + 'noinst', 'check'); + foreach (@r) + { + next unless /\.(.*)$/; + &saw_extension ($1); + } +} + +sub handle_gettext +{ + return if ! $seen_gettext || $relative_dir ne '.'; + + if (! &variable_defined ('SUBDIRS')) + { + &am_conf_error + ("AM_GNU_GETTEXT in \`$configure_ac' but SUBDIRS not defined"); + return; + } + + &require_file_with_conf_line ($ac_gettext_line, $GNU, 'ABOUT-NLS'); + + if (&variable_defined ('SUBDIRS')) + { + &am_line_error + ('SUBDIRS', + "AM_GNU_GETTEXT in \`$configure_ac' but \`po' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bpo\b/; + &am_line_error + ('SUBDIRS', + "AM_GNU_GETTEXT in \`$configure_ac' but \`intl' not in SUBDIRS") + if $contents{'SUBDIRS'} !~ /\bintl\b/; + } + + # Ensure that each language in ALL_LINGUAS has a .po file, and + # each po file is mentioned in ALL_LINGUAS. + if ($seen_linguas) + { + local (%linguas) = (); + grep ($linguas{$_} = 1, split (' ', $all_linguas)); + + foreach () + { + s/^po\///; + s/\.po$//; + + &am_line_error ($all_linguas_line, + ("po/$_.po exists but \`$_' not in \`ALL_LINGUAS'")) + if ! $linguas{$_}; + } + + foreach (keys %linguas) + { + &am_line_error ($all_linguas_line, + "$_ in \`ALL_LINGUAS' but po/$_.po does not exist") + if ! -f "po/$_.po"; + } + } + else + { + &am_error ("AM_GNU_GETTEXT in \`$configure_ac' but \`ALL_LINGUAS' not defined"); + } +} + +# Handle footer elements. +sub handle_footer +{ + if ($contents{'SOURCES'}) + { + # NOTE don't use define_pretty_variable here, because + # $contents{...} is already defined. + $output_vars .= 'SOURCES = ' . $contents{'SOURCES'} . "\n"; + } + if ($contents{'OBJECTS'}) + { + # NOTE don't use define_pretty_variable here, because + # $contents{...} is already defined. + $output_vars .= 'OBJECTS = ' . $contents{'OBJECTS'} . "\n"; + } + if ($contents{'SOURCES'} || $contents{'OBJECTS'}) + { + $output_vars .= "\n"; + } + + if (&variable_defined ('SUFFIXES')) + { + # Push actual suffixes, and not $(SUFFIXES). Some versions of + # make do not like variable substitutions on the .SUFFIXES + # line. + push (@suffixes, &variable_value_as_list ('SUFFIXES', '')); + } + if (&target_defined ('.SUFFIXES')) + { + &am_line_error ('.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"; + if (@suffixes) + { + + # Make sure suffixes has unique elements. Sort them to ensure + # the output remains consistent. + local (%suffixes); + + grep ($suffixes{$_} = 1, @suffixes); + + $output_header .= (".SUFFIXES: " + . join (' ', sort keys %suffixes) + . "\n"); + } + $output_trailer .= &file_contents ('footer'); +} + +# Deal with installdirs target. +sub handle_installdirs +{ + # GNU Makefile standards recommend this. + if ($recursive_install) + { + # We create a separate `-am' target so that the -recursive + # rule will work correctly. + $output_rules .= ("installdirs: installdirs-recursive\n" + . "installdirs-am:\n"); + push (@phony, 'installdirs-am'); + } + else + { + $output_rules .= "installdirs:\n"; + } + push (@phony, 'installdirs'); + if (@installdirs) + { + &pretty_print_rule ("\t" . '$(mkinstalldirs) ', "\t\t", + @installdirs); + } + $output_rules .= "\n"; +} + +# There are several targets which need to be merged. This is because +# their complete definition is compiled from many parts. Note that we +# avoid double colon rules, otherwise we'd use them instead. +sub handle_merge_targets +{ + local ($makefile) = @_; + + # There are a few install-related variables that you should not define. + local ($var); + foreach $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL') + { + if (&variable_defined ($var)) + { + &am_line_error ($var, "\`$var' should not be defined"); + } + } + + # 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)); + + local ($one_name); + foreach $one_name (@config_names) + { + push (@all, &basename ($one_name)) + if &dirname ($one_name) eq $relative_dir; + } + + &do_one_merge_target ('info', @info); + &do_one_merge_target ('dvi', @dvi); + &do_check_merge_target; + &do_one_merge_target ('installcheck', @installcheck); + + if (defined $options{'no-installinfo'}) + { + &do_one_merge_target ('install-info', ''); + } + elsif (&target_defined ('install-info-local')) + { + &am_line_error ('install-info-local', + "\`install-info-local' target defined but \`no-installinfo' option not in use"); + } + + local ($utarg); + foreach $utarg ('uninstall-data-local', 'uninstall-data-hook', + 'uninstall-exec-local', 'uninstall-exec-hook') + { + if (&target_defined ($utarg)) + { + local ($x); + ($x = $utarg) =~ s/(data|exec)-//; + &am_line_error ($utarg, "use \`$x', not \`$utarg'"); + } + } + + if (&target_defined ('install-local')) + { + &am_line_error ('install-local', + "use \`install-data-local' or \`install-exec-local', not \`install-local'"); + } + + if (@all) + { + local ($one_name); + local ($local_headers) = ''; + foreach $one_name (@config_names) + { + if (&dirname ($one_name) eq $relative_dir) + { + $local_headers .= ' ' if $local_headers; + $local_headers .= &basename ($one_name); + } + } + if ($local_headers) + { + # This is kind of a hack, but I couldn't see a better way + # to handle it. In this particular case, we need to make + # sure config.h is built before we recurse. 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_rules .= ("all-recursive-am: ${local_headers}" + . "\n\t" + . '$(MAKE) $(AM_MAKEFLAGS)' + . " all-recursive" + . "\n\n"); + $all_target = 'all-recursive-am'; + push (@phony, 'all-recursive-am'); + } + } + + # Print definitions users can use. + &do_one_merge_target ('install-exec', @install_exec); + $output_rules .= "\n"; + + &do_one_merge_target ('install-data', @install_data); + $output_rules .= "\n"; + + &do_one_merge_target ('install', 'all-am'); + &do_one_merge_target ('uninstall', @uninstall); + + &do_one_merge_target ('all', @all); + + # Generate the new 'install-strip' target. We can't just set + # INSTALL_PROGRAM because that might be a relative path. + $output_rules .= ("install-strip:\n\t" + . '$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install' + . "\n"); +} + +# Helper for handle_merge_targets. Note that handle_merge_targets +# relies on the fact that this doesn't add an extra \n at the end. +sub do_one_merge_target +{ + local ($name, @values) = @_; + + if (&target_defined ($name . '-local')) + { + # User defined local form of target. So include it. + push (@values, $name . '-local'); + push (@phony, $name . '-local'); + } + + &pretty_print_rule ($name . "-am:", "\t\t", @values); + if ($name eq 'install') + { + # Special-case `install-am' to run install-exec-am and + # install-data-am after all-am is built. + &pretty_print_rule ("\t\@\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", + 'install-exec-am', 'install-data-am'); + } + elsif ($name eq 'install-exec' && &target_defined ('install-exec-hook')) + { + $output_rules .= ("\t\@\$(NORMAL_INSTALL)\n" + . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-exec-hook' + . "\n"); + } + elsif ($name eq 'install-data' && &target_defined ('install-data-hook')) + { + $output_rules .= ("\t\@\$(NORMAL_INSTALL)\n" + . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-data-hook' + . "\n"); + } + + local ($lname) = $name . ($recursive_install ? '-recursive' : '-am'); + local ($tname) = $name; + # To understand this special case, see handle_merge_targets. + if ($name eq 'all') + { + $tname = 'all-redirect'; + $lname = $all_target if $recursive_install; + push (@phony, 'all-redirect'); + $output_all = "all: all-redirect\n"; + } + &pretty_print_rule ($tname . ":", "\t\t", $lname); + push (@phony, $name . '-am', $name); +} + +# Handle check merge target specially. +sub do_check_merge_target +{ + if (&target_defined ('check-local')) + { + # User defined local form of target. So include it. + push (@check_tests, 'check-local'); + push (@phony, 'check-local'); + } + + # In --cygnus mode, check doesn't depend on all. + if ($cygnus_mode) + { + # Just run the local check rules. + &pretty_print_rule ('check-am:', "\t\t", @check); + } + else + { + # 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"; + &pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", + @check) + if @check; + } + &pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", + @check_tests) + if @check_tests; + + push (@phony, 'check', 'check-am'); + $output_rules .= ("check: " + . ($recursive_install ? 'check-recursive' : 'check-am') + . "\n"); +} + +# Handle all 'clean' targets. +sub handle_clean +{ + local ($xform) = ''; + local ($name); + + # Don't include `MAINTAINER'; it is handled specially below. + foreach $name ('MOSTLY', '', 'DIST') + { + if (! &variable_defined ($name . 'CLEANFILES')) + { + $xform .= 's/^' . $name . 'CLEAN.*$//;'; + } + else + { + $xform .= 's/^' . $name . 'CLEAN//;'; + } + } + + # Built sources are automatically removed by maintainer-clean. + push (@maintainer_clean_files, '\$(BUILT_SOURCES)') + if &variable_defined ('BUILT_SOURCES'); + push (@maintainer_clean_files, '\$(MAINTAINERCLEANFILES)') + if &variable_defined ('MAINTAINERCLEANFILES'); + if (! @maintainer_clean_files) + { + $xform .= 's/^MAINTAINERCLEAN.*$//;'; + } + else + { + $xform .= ('s/^MAINTAINERCLEAN//;' + # Join with no space to avoid spurious `test -z' + # success at runtime. + . 's,\@MCFILES\@,' . join ('', @maintainer_clean_files) + . ',;' + # A space is required in the join here. + . 's,\@MFILES\@,' . join (' ', @maintainer_clean_files) + . ',;'); + } + + $output_rules .= &file_contents_with_transform ($xform, 'clean'); + + push (@clean, 'generic'); + &push_phony_cleaners ('generic'); + + &do_one_clean_target ('clean', 'mostly', '', @clean); + &do_one_clean_target ('clean', '', 'mostly', @clean); + &do_one_clean_target ('clean', 'dist', '', @clean); + &do_one_clean_target ('clean', 'maintainer-', 'dist', @clean); + + push (@phony, 'clean', 'mostlyclean', 'distclean', 'maintainer-clean'); +} + +# Helper for handle_clean. +sub do_one_clean_target +{ + local ($target, $name, $last_name, @deps) = @_; + + # Change each dependency `BLARG' into `clean-BLARG'. + grep (($_ = $name . 'clean-' . $_) && 0, @deps); + + # Push the previous clean target. There is no previous clean + # target if we're doing mostlyclean. + push (@deps, $last_name . $target . '-am') + unless $name eq 'mostly'; + + # If a -local version of the rule is given, add it to the list. + if (&target_defined ($name . $target . '-local')) + { + push (@deps, $name . $target . '-local'); + } + + # Print the target and the dependencies. + &pretty_print_rule ($name . $target . "-am: ", "\t\t", @deps); + + # FIXME: shouldn't we really print these messages before running + # the dependencies? + if ($name . $target eq 'maintainer-clean') + { + # Print a special warning. + $output_rules .= + ("\t\@echo \"This command is intended for maintainers to use;\"\n" + . "\t\@echo \"it deletes files that may require special " + . "tools to rebuild.\"\n"); + } + elsif ($name . $target eq 'distclean') + { + $output_rules .= "\t-rm -f libtool\n" if $seen_libtool; + } + $output_rules .= "\n"; + + # Now generate the actual clean target. + $output_rules .= ($name . $target . ": " . $name . $target + . ($recursive_install ? '-recursive' : '-am') + . "\n"); + + # 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 (($name . $target eq 'maintainer-clean' + || $name . $target eq 'distclean') + && $relative_dir eq '.') + { + $output_rules .= "\t-rm -f config.status\n"; + } + $output_rules .= "\n"; +} + +# Handle .PHONY target. +sub handle_phony +{ + &pretty_print_rule ('.PHONY:', "", @phony); + $output_rules .= "\n"; +} + +# Handle TESTS variable and other checks. +sub handle_tests +{ + if (defined $options{'dejagnu'}) + { + push (@check_tests, 'check-DEJAGNU'); + push (@phony, 'check-DEJAGNU'); + + local ($xform); + if ($cygnus_mode) + { + $xform = 's/^CYGNUS//;'; + } + else + { + $xform = 's/^CYGNUS.*$//;'; + } + $output_rules .= &file_contents_with_transform ($xform, 'dejagnu'); + + # In Cygnus mode, these are found in the build tree. + # Otherwise they are looked for in $PATH. + &define_program_variable ('EXPECT', 'build', 'expect', 'expect'); + &define_program_variable ('RUNTEST', 'src', 'dejagnu', 'runtest'); + + # Only create site.exp rule if user hasn't already written + # one. + if (! &target_defined ('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. + $output_rules .= ("site.exp: Makefile\n" + . "\t\@echo 'Making a new site.exp file...'\n" + . "\t\@test ! -f site.bak || rm -f site.bak\n" + . "\t\@echo '## these variables are automatically generated by make ##' > \$\@-t\n" + . "\t\@echo '# Do not edit here. If you wish to override these values' >> \$\@-t\n" + . "\t\@echo '# edit the last section' >> \$\@-t\n" + . "\t\@echo 'set tool \$(DEJATOOL)' >> \$\@-t\n" + . "\t\@echo 'set srcdir \$(srcdir)' >> \$\@-t\n" + . "\t\@echo 'set objdir' \`pwd\` >> \$\@-t\n"); + + # Extra stuff for AC_CANONICAL_* + local (@whatlist) = (); + if ($seen_canonical) + { + push (@whatlist, 'host'); + } + + # Extra stuff only for AC_CANONICAL_SYSTEM. + if ($seen_canonical == $AC_CANONICAL_SYSTEM) + { + push (@whatlist, 'target', 'build'); + } + + local ($c1, $c2); + foreach $c1 (@whatlist) + { + foreach $c2 ('alias', 'triplet') + { + $output_rules .= "\t\@echo 'set ${c1}_${c2} \$(${c1}_${c2})' >> \$\@-t\n"; + } + } + + $output_rules .= ("\t\@echo '## All variables above are generated by configure. Do Not Edit ##' >> \$\@-t\n" + . "\t\@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> \$\@-t\n" + . "\t\@test ! -f site.exp || mv site.exp site.bak\n" + . "\t\@mv \$\@-t site.exp\n"); + } + } + else + { + local ($c); + foreach $c ('DEJATOOL', 'RUNTEST', 'RUNTESTFLAGS') + { + if (&variable_defined ($c)) + { + &am_line_error ($c, "\`$c' defined but \`dejagnu' not in \`AUTOMAKE_OPTIONS'"); + } + } + } + + if (&variable_defined ('TESTS')) + { + push (@check_tests, 'check-TESTS'); + push (@phony, 'check-TESTS'); + + $output_rules .= 'check-TESTS: $(TESTS) + @failed=0; all=0; \\ + srcdir=$(srcdir); export srcdir; \\ + for tst in $(TESTS); do \\ + if test -f $$tst; then dir=.; \\ + else dir="$(srcdir)"; fi; \\ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \\ + all=`expr $$all + 1`; \\ + echo "PASS: $$tst"; \\ + elif test $$? -ne 77; then \\ + all=`expr $$all + 1`; \\ + failed=`expr $$failed + 1`; \\ + echo "FAIL: $$tst"; \\ + fi; \\ + done; \\ + if test "$$failed" -eq 0; then \\ + banner="All $$all tests passed"; \\ + else \\ + banner="$$failed of $$all tests failed"; \\ + fi; \\ + dashes=`echo "$$banner" | sed s/./=/g`; \\ + echo "$$dashes"; \\ + echo "$$banner"; \\ + echo "$$dashes"; \\ + test "$$failed" -eq 0 +'; + } +} + +# Handle Emacs Lisp. +sub handle_emacs_lisp +{ + local (@elfiles) = &am_install_var ('lisp', 'LISP', 'lisp', 'noinst'); + + if (@elfiles) + { + # Found some lisp. + &define_configure_variable ('lispdir'); + &define_configure_variable ('EMACS'); + $output_rules .= (".el.elc:\n" + . "\t\@echo 'WARNING: Warnings can be ignored. :-)'\n" + . "\tif test \$(EMACS) != no; then \\\n" + . "\t EMACS=\$(EMACS) \$(SHELL) \$(srcdir)/elisp-comp \$<; \\\n" + . "\tfi\n"); + push (@suffixes, '.el', '.elc'); + + # Generate .elc files. + grep ($_ .= 'c', @elfiles); + &define_pretty_variable ('ELCFILES', '', @elfiles); + + $output_rules .= &file_contents ('lisp-clean'); + push (@clean, 'lisp'); + &push_phony_cleaners ('lisp'); + + push (@all, '$(ELCFILES)'); + + local ($varname); + if (&variable_defined ('lisp_LISP')) + { + $varname = 'lisp_LISP'; + &am_error ("\`lisp_LISP' defined but \`AM_PATH_LISPDIR' not in \`$configure_ac'") + if ! $seen_lispdir; + } + else + { + $varname = 'noinst_LISP'; + } + + &require_file_with_line ($varname, $FOREIGN, 'elisp-comp'); + } +} + +# Handle Java. +sub handle_java +{ + local (@sourcelist) = &am_install_var ('-clean', 'java', 'JAVA', + 'java', 'noinst', 'check'); + return if ! @sourcelist; + + &define_variable ('JAVAC', 'javac'); + &define_variable ('JAVACFLAGS', ''); + &define_variable ('CLASSPATH_ENV', + 'CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH'); + &define_variable ('JAVAROOT', '$(top_builddir)'); + + local (%valid) = &am_primary_prefixes ('JAVA', 'java', 'noinst', 'check'); + + local ($dir, $curs); + foreach $curs (keys %valid) + { + if (! &variable_defined ($curs . '_JAVA') || $curs eq 'noinst' + || $curs eq 'EXTRA') + { + next; + } + + if (defined $dir) + { + &am_line_error ($curs . '_JAVA', + "multiple _JAVA primaries in use"); + } + $dir = $curs; + } + + $output_rules .= ('class' . $dir . '.stamp: $(' . $dir . '_JAVA)' . "\n" + . "\t" . '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) ' + . '$(JAVACFLAGS) $?' . "\n" + . "\t" . 'echo timestamp > class' . $dir . '.stamp' + . "\n"); + push (@all, 'class' . $dir . '.stamp'); + &push_dist_common ('$(' . $dir . '_JAVA)'); +} + +# Handle some of the minor options. +sub handle_minor_options +{ + if (defined $options{'readme-alpha'}) + { + if ($relative_dir eq '.') + { + if ($package_version !~ /^$GNITS_VERSION_PATTERN$/) + { + # FIXME: allow real filename. + &am_conf_line_error ($configure_ac, + $package_version_line, + "version \`$package_version' doesn't follow Gnits standards"); + } + elsif (defined $1 && -f 'README-alpha') + { + # This means we have an alpha release. See + # GNITS_VERSION_PATTERN for details. + &require_file ($FOREIGN, 'README-alpha'); + } + } + } +} + +################################################################ + +# Scan one file for interesting things. Subroutine of scan_configure. +sub scan_one_configure_file +{ + local ($filename) = @_; + local (*CONFIGURE); + + open (CONFIGURE, $filename) + || die "automake: couldn't open \`$filename': $!\n"; + print "automake: reading $filename\n" if $verbose; + + while () + { + # Remove comments from current line. + s/\bdnl\b.*$//; + s/\#.*$//; + + # Skip macro definitions. Otherwise we might be confused into + # thinking that a macro that was only defined was actually + # used. + next if /AC_DEFUN/; + + # Follow includes. This is a weirdness commonly in use at + # Cygnus and hopefully nowhere else. + if (/sinclude\((.*)\)/ && -f $1) + { + &scan_one_configure_file ($1); + } + + # Populate libobjs array. + if (/AC_FUNC_ALLOCA/) + { + $libsources{'alloca.c'} = 1; + } + elsif (/AC_FUNC_GETLOADAVG/) + { + $libsources{'getloadavg.c'} = 1; + } + elsif (/AC_FUNC_MEMCMP/) + { + $libsources{'memcmp.c'} = 1; + } + elsif (/AC_STRUCT_ST_BLOCKS/) + { + $libsources{'fileblocks.c'} = 1; + } + elsif (/A[CM]_REPLACE_GNU_GETOPT/) + { + $libsources{'getopt.c'} = 1; + $libsources{'getopt1.c'} = 1; + } + elsif (/AM_FUNC_STRTOD/) + { + $libsources{'strtod.c'} = 1; + } + elsif (/AM_WITH_REGEX/) + { + $libsources{'rx.c'} = 1; + $libsources{'rx.h'} = 1; + $libsources{'regex.c'} = 1; + $libsources{'regex.h'} = 1; + $omit_dependencies{'rx.h'} = 1; + $omit_dependencies{'regex.h'} = 1; + } + elsif (/AM_FUNC_MKTIME/) + { + $libsources{'mktime.c'} = 1; + } + elsif (/AM_FUNC_ERROR_AT_LINE/) + { + $libsources{'error.c'} = 1; + $libsources{'error.h'} = 1; + } + elsif (/AM_FUNC_OBSTACK/) + { + $libsources{'obstack.c'} = 1; + $libsources{'obstack.h'} = 1; + } + elsif (/LIBOBJS="(.*)\s+\$LIBOBJS"/ + || /LIBOBJS="\$LIBOBJS\s+(.*)"/) + { + foreach $libobj_iter (split (' ', $1)) + { + if ($libobj_iter =~ /^(.*)\.o(bj)?$/) + { + $libsources{$1 . '.c'} = 1; + } + } + } + + if (! $in_ac_replace && s/AC_REPLACE_FUNCS\s*\(\[?//) + { + $in_ac_replace = 1; + } + if ($in_ac_replace) + { + $in_ac_replace = 0 if s/[\]\)].*$//; + # Remove trailing backslash. + s/\\$//; + foreach (split) + { + # Need to skip empty elements for Perl 4. + next if $_ eq ''; + $libsources{$_ . '.c'} = 1; + } + } + + if (/$obsolete_rx/o) + { + local ($hint) = ''; + if ($obsolete_macros{$1}) + { + $hint = '; ' . $obsolete_macros{$1}; + } + &am_conf_line_error ($filename, $., "\`$1' is obsolete$hint"); + } + + # Process the AC_OUTPUT macro. + if (! $in_ac_output && s/AC_OUTPUT\s*\(\[?//) + { + $in_ac_output = 1; + $ac_output_line = $.; + } + if (! $in_ac_output && s/AC_CONFIG_FILES\s*\(\[?//) + { + $in_ac_output = 1; + $ac_output_line = $.; + } + if ($in_ac_output) + { + local ($closing) = 0; + if (s/[\]\),].*$//) + { + $in_ac_output = 0; + $closing = 1; + } + + # Look at potential Makefile.am's. + foreach (split) + { + # Must skip empty string for Perl 4. + next if $_ eq "\\" || $_ eq ''; + + # Handle $local:$input syntax. Note that we ignore + # every input file past the first, though we keep + # those around for later. + local ($local, $input, @rest) = split (/:/); + if (! $input) + { + $input = $local; + } + else + { + # FIXME: should be error if .in is missing. + $input =~ s/\.in$//; + } + + if (-f $input . '.am') + { + # We have a file that automake should generate. + push (@make_input_list, $input); + $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, $_); + } + } + + if ($closing && @make_input_list == 0 && @other_input_files == 0) + { + &am_conf_line_error ($filename, $ac_output_line, + "No files mentioned in \`AC_OUTPUT'"); + exit 1; + } + } + + if (/$AC_CONFIG_AUX_DIR_PATTERN/o) + { + @config_aux_path = $1; + } + + # Check for ansi2knr. + $am_c_prototypes = 1 if /AM_C_PROTOTYPES/; + + # Check for exe extension stuff. + if (/AC_EXEEXT/) + { + $seen_exeext = 1; + $configure_vars{'EXEEXT'} = $filename . ':' . $.; + } + + if (/AC_OBJEXT/) + { + $seen_objext = 1; + $configure_vars{'OBJEXT'} = $filename . ':' . $.; + } + + # Check for NLS support. + if (/AM_GNU_GETTEXT/) + { + $seen_gettext = 1; + $ac_gettext_line = $.; + $omit_dependencies{'libintl.h'} = 1; + } + + # Look for ALL_LINGUAS. + if (/ALL_LINGUAS="(.*)"$/ || /ALL_LINGUAS=(.*)$/) + { + $seen_linguas = 1; + $all_linguas = $1; + $all_linguas_line = $.; + } + + # Handle configuration headers. A config header of `[$1]' + # means we are actually scanning AM_CONFIG_HEADER from + # aclocal.m4. + if (/A([CM])_CONFIG_HEADERS?\s*\((.*)\)/ + && $2 ne '[$1]') + { + &am_conf_line_error + ($filename, $., "\`automake requires \`AM_CONFIG_HEADER', not \`AC_CONFIG_HEADER'") + if $1 eq 'C'; + + $config_header_line = $.; + local ($one_hdr); + foreach $one_hdr (split (' ', $2)) + { + push (@config_fullnames, $one_hdr); + if ($one_hdr =~ /^([^:]+):(.+)$/) + { + push (@config_names, $1); + push (@config_headers, $2); + } + else + { + push (@config_names, $one_hdr); + push (@config_headers, $one_hdr . '.in'); + } + } + } + + # Handle AC_CANONICAL_*. Always allow upgrading to + # AC_CANONICAL_SYSTEM, but never downgrading. + $seen_canonical = $AC_CANONICAL_HOST + if ! $seen_canonical + && (/AC_CANONICAL_HOST/ || /AC_CHECK_TOOL/); + $seen_canonical = $AC_CANONICAL_SYSTEM if /AC_CANONICAL_SYSTEM/; + + $seen_path_xtra = 1 if /AC_PATH_XTRA/; + + # This macro handles several different things. + if (/$AM_INIT_AUTOMAKE_PATTERN/o) + { + $seen_make_set = 1; + $seen_package = 1; + $seen_version = 1; + $seen_arg_prog = 1; + $seen_prog_install = 1; + ($package_version = $1) =~ s/$AM_PACKAGE_VERSION_PATTERN/$1/o; + $package_version_line = $.; + } + + # This is like AM_INIT_AUTOMAKE, but doesn't actually set the + # package and version number. (This might change in the + # future). Yes, I'm not above hacking Automake so it works + # well with other GNU tools -- that is actually the point. + if (/AM_INIT_GUILE_MODULE/) + { + $seen_make_set = 1; + $seen_package = 1; + $seen_version = 1; + $seen_arg_prog = 1; + $seen_prog_install = 1; + @config_aux_path = ('..'); + } + + # Some things required by Automake. + $seen_make_set = 1 if /AC_PROG_MAKE_SET/; + $seen_arg_prog = 1 if /AC_ARG_PROGRAM/; + + if (/AM_PROG_LEX/) + { + $configure_vars{'LEX'} = $filename . ':' . $.; + $seen_decl_yytext = 1; + } + if (/AC_DECL_YYTEXT/ && $filename =~ /configure\.(ac|in)$/) + { + &am_conf_line_warning ($filename, $., "\`AC_DECL_YYTEXT' is covered by \`AM_PROG_LEX'"); + } + if (/AC_PROG_LEX/ && $filename =~ /configure\.(ac|in)$/) + { + &am_conf_line_warning ($filename, $., "automake requires \`AM_PROG_LEX', not \`AC_PROG_LEX'"); + } + + if (/AC_PROG_(F77|YACC|RANLIB|CC|CXXCPP|CXX|LEX|AWK|CPP|LN_S)/) + { + $configure_vars{$1} = $filename . ':' . $.; + } + if (/$AC_CHECK_PATTERN/o) + { + $configure_vars{$3} = $filename . ':' . $.; + } + if (/$AM_MISSING_PATTERN/o + && $1 ne 'ACLOCAL' + && $1 ne 'AUTOCONF' + && $1 ne 'AUTOMAKE' + && $1 ne 'AUTOHEADER') + { + $configure_vars{$1} = $filename . ':' . $.; + } + + # Explicitly avoid ANSI2KNR -- we AC_SUBST that in protos.m4, + # but later define it elsewhere. This is pretty hacky. We + # also explicitly avoid INSTALL_SCRIPT and some other + # variables because they are defined in header-vars.am. + # FIXME. + if (/$AC_SUBST_PATTERN/o + && $1 ne 'ANSI2KNR' + && $1 ne 'INSTALL_SCRIPT' + && $1 ne 'INSTALL_DATA') + { + $configure_vars{$1} = $filename . ':' . $.; + } + + $seen_decl_yytext = 1 if /AC_DECL_YYTEXT/; + if (/AM_MAINTAINER_MODE/) + { + $seen_maint_mode = 1; + $configure_cond{'MAINTAINER_MODE'} = 1; + } + $seen_package = 1 if /PACKAGE=/; + + # Skip VERSION of [$2]; that is from AM_INIT_AUTOMAKE. + if (/\bVERSION=(\S+)/ && $1 ne '$2' && $1 ne '[$2]') + { + $seen_version = 1; + $package_version = $1; + $package_version_line = $.; + } + elsif (/VERSION=/) + { + $seen_version = 1; + } + + $seen_prog_install = 1 if /AC_PROG_INSTALL/; + $seen_lispdir = 1 if /AM_PATH_LISPDIR/; + + if (/A(C|M)_PROG_LIBTOOL/) + { + # We're not ready for this yet. People still use a + # libtool with no AC_PROG_LIBTOOL. Once that is the + # dominant version we can reenable this code -- but next + # time by mentioning the macro in %obsolete_macros, both + # here and in aclocal.in. + + # if (/AM_PROG_LIBTOOL/) + # { + # &am_conf_line_warning ($filename, $., "`AM_PROG_LIBTOOL' is obsolete, use `AC_PROG_LIBTOOL' instead"); + # } + $seen_libtool = 1; + $libtool_line = $.; + $configure_vars{'LIBTOOL'} = $filename . ':' . $.; + $configure_vars{'RANLIB'} = $filename . ':' . $.; + $configure_vars{'CC'} = $filename . ':' . $.; + # AM_PROG_LIBTOOL runs AC_CANONICAL_HOST. Make sure we + # never downgrade (if we've seen AC_CANONICAL_SYSTEM). + $seen_canonical = $AC_CANONICAL_HOST if ! $seen_canonical; + } + + $seen_multilib = 1 if (/AM_ENABLE_MULTILIB/); + + if (/$AM_CONDITIONAL_PATTERN/o) + { + $configure_cond{$1} = 1; + } + + # Check for Fortran 77 intrinsic and run-time libraries. + if (/AC_F77_LIBRARY_LDFLAGS/) + { + $configure_vars{'FLIBS'} = $filename . ':' . $.; + } + } + + close (CONFIGURE); +} + +# Scan configure.ac and aclocal.m4 for interesting things. We must +# scan aclocal.m4 because there might be AC_SUBSTs and such there. +sub scan_configure +{ + # 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 = (); + + warn "automake: both `configure.ac' and `configure.in' present:" + . " ignoring `configure.in'\n" + if -f 'configure.ac' && -f 'configure.in'; + $configure_ac = 'configure.in' + if -f 'configure.in'; + $configure_ac = 'configure.ac' + if -f 'configure.ac'; + die "automake: `configure.ac' or `configure.in' is required\n" + if !$configure_ac; + + local ($in_ac_output, $in_ac_replace) = (0, 0); + local (%make_list, @make_input_list); + local ($libobj_iter); + + &scan_one_configure_file ($configure_ac); + &scan_one_configure_file ('aclocal.m4') + if -f 'aclocal.m4'; + + # Set input and output files if not specified by user. + if (! @input_files) + { + @input_files = @make_input_list; + %output_files = %make_list; + } + + &am_conf_error ("\`PACKAGE' not defined in \`$configure_ac'") + if ! $seen_package; + &am_conf_error ("\`VERSION' not defined in \`$configure_ac'") + if ! $seen_version; + + # 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 so that + # the file-finding machinery works. + local ($relative_dir) = '.'; + &require_config_file ($FOREIGN, 'install-sh', 'mkinstalldirs', 'missing'); + &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead") + if -f $config_aux_path[0] . '/install.sh'; +} + +################################################################ + +# Set up for Cygnus mode. +sub check_cygnus +{ + return unless $cygnus_mode; + + &set_strictness ('foreign'); + $options{'no-installinfo'} = 1; + $options{'no-dependencies'} = 1; + $use_dependencies = 0; + + if (! $seen_maint_mode) + { + &am_conf_error ("\`AM_MAINTAINER_MODE' required when --cygnus specified"); + } + + if (! $seen_exeext) + { + &am_conf_error ("\`AC_EXEEXT' required when --cygnus specified"); + } +} + +# Do any extra checking for GNU standards. +sub check_gnu_standards +{ + if ($relative_dir eq '.') + { + # In top level (or only) directory. + &require_file ($GNU, 'INSTALL', 'NEWS', 'README', 'COPYING', + 'AUTHORS', 'ChangeLog'); + } + + if ($strictness >= $GNU) + { + if (defined $options{'no-installman'}) + { + &am_line_error ('AUTOMAKE_OPTIONS', + "option \`no-installman' disallowed by GNU standards"); + } + + if (defined $options{'no-installinfo'}) + { + &am_line_error ('AUTOMAKE_OPTIONS', + "option \`no-installinfo' disallowed by GNU standards"); + } + } +} + +# Do any extra checking for GNITS standards. +sub check_gnits_standards +{ + if ($strictness >= $GNITS) + { + if (-f $relative_dir . '/COPYING.LIB') + { + &am_error ("\`${relative_dir}/COPYING.LIB' disallowed by Gnits standards"); + } + } + + if ($relative_dir eq '.') + { + # In top level (or only) directory. + &require_file ($GNITS, 'THANKS'); + } +} + +################################################################ +# +# Functions to handle files of each language. + +# Each `lang_X_rewrite' function follows a simple formula: +# * Args are the base name and extension of the file. +# * Return value is 1 if file is to be dealt with, 0 otherwise. +# Much of the actual processing is handled in handle_single_transform_list. +# 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. + +# Rewrite a single C source file. +sub lang_c_rewrite +{ + local ($base, $ext) = @_; + + if (defined $options{'ansi2knr'} && $base =~ /_$/) + { + # FIXME: include line number in error. + &am_error ("C source file \`$base.c' would be deleted by ansi2knr rules"); + } + + $de_ansi_files{$base} = 1; + return 1; +} + +# Rewrite a single C++ source file. +sub lang_cxx_rewrite +{ + return 1; +} + +# Rewrite a single header file. +sub lang_header_rewrite +{ + # Header files are simply ignored. + return 0; +} + +# Rewrite a single yacc file. +sub lang_yacc_rewrite +{ + local ($base, $ext) = @_; + + &lang_c_rewrite ($base, $ext); + $yacc_sources{$base . '.' . $ext} = 1; + $ext =~ tr/y/c/; + &saw_extension ('c'); + &push_dist_common ($base . '.' . $ext); + return 1; +} + +# Rewrite a single yacc++ file. +sub lang_yaccxx_rewrite +{ + local ($base, $ext) = @_; + + $yacc_sources{$base . '.' . $ext} = 1; + $ext =~ tr/y/c/; + &saw_extension ($ext); + &push_dist_common ($base . '.' . $ext); + return 1; +} + +# Rewrite a single lex file. +sub lang_lex_rewrite +{ + local ($base, $ext) = @_; + + &lang_c_rewrite ($base, $ext); + $lex_sources{$base . '.' . $ext} = 1; + $ext =~ tr/l/c/; + &saw_extension ('c'); + &push_dist_common ($base . '.' . $ext); + return 1; +} + +# Rewrite a single lex++ file. +sub lang_lexxx_rewrite +{ + local ($base, $ext) = @_; + + $lex_sources{$base . '.' . $ext} = 1; + $ext =~ tr/l/c/; + &saw_extension ($ext); + &push_dist_common ($base . '.' . $ext); + return 1; +} + +# Rewrite a single assembly file. +sub lang_asm_rewrite +{ + return 1; +} + +# Rewrite a single Fortran 77 file. +sub lang_f77_rewrite +{ + return 1; +} + +# Rewrite a single Fortran 77 preprocessed file. +sub lang_ppf77_rewrite +{ + return 1; +} + +# Rewrite a single Objective C file. +sub lang_objc_rewrite +{ + return 1; +} + +# 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_c_finish +{ + # Push all libobjs files onto de_ansi_files. We actually only + # push files which exist in the current directory, and which are + # genuine source files. + local ($file); + foreach $file (keys %libsources) + { + if ($file =~ /^(.*)\.[cly]$/ && -f "$relative_dir/$file") + { + $de_ansi_files{$1} = 1; + } + } + + if (defined $options{'ansi2knr'} && keys %de_ansi_files) + { + # Make all _.c files depend on their corresponding .c files. + local ($base, @objects); + foreach $base (sort keys %de_ansi_files) + { + # Each _.c file must depend on ansi2knr; otherwise it + # might be used in a parallel build before it is built. + # We need to support files in the srcdir and in the build + # dir (because these files might be auto-generated. But + # we can't use $< -- some makes only define $< during a + # suffix rule. + $output_rules .= ($base . "_.c: $base.c \$(ANSI2KNR)\n\t" + . '$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) ' + . '`if test -f $(srcdir)/' . $base . '.c' + . '; then echo $(srcdir)/' . $base . '.c' + . '; else echo ' . $base . '.c; fi` ' + . "| sed 's/^# \\([0-9]\\)/#line \\1/' " + . '| $(ANSI2KNR) > ' . $base . "_.c\n"); + push (@objects, $base . '_' + . ($seen_objext ? '.$(OBJEXT)' : '.o')); + push (@objects, $base . '_.lo') if $seen_libtool; + } + + # Make all _.o (and _.lo) files depend on ansi2knr. + # Use a sneaky little hack to make it print nicely. + &pretty_print_rule ('', '', @objects, ':', '$(ANSI2KNR)'); + } + + if (! defined $configure_vars{'CC'}) + { + # FIXME: line number. + &am_error ("C source seen but \`CC' not defined in \`$configure_ac'"); + } +} + +# A helper which computes a sorted list of all C++ extensions which +# were seen. +sub cxx_extensions +{ + local ($key, @r); + foreach $key (sort keys %extension_seen) + { + push (@r, '.' . $key) if $extension_map{$key} eq 'cxx'; + } + return @r; +} + +sub lang_cxx_finish +{ + local (@cxx_list) = &cxx_extensions; + local ($cxx_count) = scalar @cxx_list; + if ($cxx_count) + { + push (@suffixes, @cxx_list); + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ("CXXFLAGS"); + &define_variable ('CXXCOMPILE', '$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)'); + &define_variable ('LTCXXCOMPILE', + $ltcompile . '$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)') + if ($seen_libtool); + + &define_variable ('CXXLD', '$(CXX)'); + &define_variable ('CXXLINK', $ltlink . '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@'); + + local ($ext); + foreach $ext (@cxx_list) + { + $output_rules .= ("$ext.o:\n" + . "\t\$(CXXCOMPILE) -c \$<\n"); + # FIXME: Using cygpath should be somehow conditional. + $output_rules .= ("$ext.obj:\n" + . "\t\$(CXXCOMPILE) -c `cygpath -w \$<`\n") + if ($seen_objext); + $output_rules .= ("$ext.lo:\n" + . "\t\$(LTCXXCOMPILE) -c \$<\n") + if ($seen_libtool); + } + + if (! defined $configure_vars{'CXX'}) + { + &am_error ("C++ source seen but \`CXX' not defined in \`$configure_ac'"); + } + } +} + +sub lang_header_finish +{ + # Nothing to do. +} + +# 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; + + # If there is more than one distinct yacc (resp lex) source file + # in a given directory, then the `ylwrap' program is required to + # allow parallel builds to work correctly. FIXME: for now, no + # line number. + &require_config_file ($FOREIGN, 'ylwrap'); + if ($config_aux_dir ne '.' && $config_aux_dir ne '') + { + &define_variable ('YLWRAP', $config_aux_dir . "/ylwrap"); + } + else + { + &define_variable ('YLWRAP', '$(srcdir)/ylwrap'); + } +} + +sub lang_yacc_finish +{ + return if defined $language_scratch{'yacc-done'}; + $language_scratch{'yacc-done'} = 1; + + local ($file, $base, $hname, $cname); + local (%seen_suffix) = (); + local (@yacc_files) = sort keys %yacc_sources; + local ($yacc_count) = scalar (@yacc_files); + foreach $file (@yacc_files) + { + $file =~ /(\..*)$/; + &output_yacc_build_rule ($1, $yacc_count > 1) + if ! defined $seen_suffix{$1}; + $seen_suffix{$1} = 1; + + # Now generate rule to make the header file. This should only + # be generated if `yacc -d' specified. But right now there is + # no way to determine that. FIXME: examine AM_YFLAGS? + $file =~ /^(.*)\.(y|yy|y\+\+|yxx)$/; + $base = $1; + ($hname = $2) =~ tr/y/h/; + ($cname = $2) =~ tr/y/c/; + $output_rules .= "${base}.${hname}: ${base}.${cname}\n"; + + # If the files are built in the build directory, then we want + # to remove them with `make clean'. If they are in srcdir + # they shouldn't be touched. However, we can't determine this + # statically, and the GNU rules say that yacc/lex output files + # should be removed by maintainer-clean. So that's what we + # do. + push (@maintainer_clean_files, $base . $hname, $base . $cname); + } + $output_rules .= "\n"; + + if (! defined $configure_vars{'YACC'}) + { + &am_error ("yacc source seen but \`YACC' not defined in \`$configure_ac'"); + } + if (&variable_defined ('YACCFLAGS')) + { + &am_line_error ('YACCFLAGS', + "\`YACCFLAGS' obsolete; use \`YFLAGS' instead"); + } + + if ($yacc_count > 1) + { + &yacc_lex_finish_helper; + } +} + +sub lang_yaccxx_finish +{ + &lang_yacc_finish; +} + +sub lang_lex_finish +{ + return if defined $language_scratch{'lex-done'}; + $language_scratch{'lex-done'} = 1; + + local (%seen_suffix) = (); + local ($file, $cname); + local ($lex_count) = scalar (keys %lex_sources); + foreach $file (sort keys %lex_sources) + { + $file =~ /(\..*)$/; + &output_lex_build_rule ($1, $lex_count > 1) + if (! defined $seen_suffix{$1}); + $seen_suffix{$1} = 1; + + # If the files are built in the build directory, then we want + # to remove them with `make clean'. If they are in srcdir + # they shouldn't be touched. However, we can't determine this + # statically, and the GNU rules say that yacc/lex output files + # should be removed by maintainer-clean. So that's what we + # do. + $file =~ /^(.*)\.(l|ll|l\+\+|lxx)$/; + ($cname = $2) =~ tr/l/c/; + push (@maintainer_clean_files, $1 . $cname); + } + + if (! defined $configure_vars{'LEX'}) + { + &am_error ("lex source seen but \`LEX' not defined in \`$configure_ac'"); + } + if (! $seen_decl_yytext) + { + &am_error ("lex source seen but \`AC_DECL_YYTEXT' not in \`$configure_ac'"); + } + + if ($lex_count > 1) + { + &yacc_lex_finish_helper; + } +} + +sub lang_lexxx_finish +{ + &lang_lex_finish; +} + +sub lang_asm_finish +{ + # Pretend we're C. + &lang_c_finish; +} + +# A helper which computes a sorted list of all Fortran 77 extensions +# which were seen. +sub f77_extensions +{ + local ($key, @r); + foreach $key (sort keys %extension_seen) + { + push (@r, '.' . $key) if $extension_map{$key} eq 'f77'; + } + return @r; +} + +sub lang_f77_finish +{ + local (@f77_list) = &f77_extensions; + local ($f77_count) = scalar @f77_list; + if ($f77_count) + { + push (@suffixes, @f77_list); + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ('FFLAGS'); + &define_variable ('F77COMPILE', '$(F77) $(AM_FFLAGS) $(FFLAGS)'); + &define_variable ('LTF77COMPILE', + $ltcompile . '$(F77) $(AM_FFLAGS) $(FFLAGS)') + if ($seen_libtool); + + &define_variable ('F77LD', '$(F77)'); + &define_variable ('F77LINK', $ltlink . '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(LDFLAGS) -o $@'); + + local ($ext); + foreach $ext (@f77_list) + { + $output_rules .= ("$ext.o:\n" + . "\t\$(F77COMPILE) -c \$<\n"); + # FIXME: Using cygpath should be somehow conditional. + $output_rules .= ("$ext.obj:\n" + . "\t\$(F77COMPILE) -c `cygpath -w \$<`\n") + if ($seen_objext); + $output_rules .= ("$ext.lo:\n" + . "\t\$(LTF77COMPILE) -c \$<\n") + if ($seen_libtool); + } + + if (! defined $configure_vars{'F77'}) + { + &am_error ("Fortran 77 source seen but \`F77' not defined in \`$configure_ac'"); + } + } +} + +# Preprocessed Fortran 77 +# +# The current support for preprocessing Fortran 77 just involves passing +# `$(DEFS) $(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). +sub lang_ppf77_finish +{ + local ($ext) = 'F'; + last unless $extension_seen{$ext}; + push (@suffixes, '.' . $ext); + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ('FFLAGS'); + &define_variable ('F77COMPILE', '$(F77) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)'); + &define_variable ('LTF77COMPILE', + $ltcompile . '$(F77) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)') + if ($seen_libtool); + + &define_variable ('F77LD', '$(F77)'); + &define_variable ('F77LINK', $ltlink . '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(LDFLAGS) -o $@'); + + $output_rules .= (".$ext.o:\n" + . "\t\$(F77COMPILE) -c \$<\n"); + # FIXME: Using cygpath should be somehow conditional. + $output_rules .= (".$ext.obj:\n" + . "\t\$(F77COMPILE) -c `cygpath -w \$<`\n") + if ($seen_objext); + $output_rules .= (".$ext.lo:\n" + . "\t\$(LTF77COMPILE) -c \$<\n") + if ($seen_libtool); + + # We also handle the case of preprocessing `.F' files into `.f' + # files. + $output_rules .= (".$ext.f:\n" + . "\t\$(F77COMPILE) -F \$<\n"); + + if (! defined $configure_vars{'F77'}) + { + &am_error ("Fortran 77 source seen but \`F77' not defined in \`$configure_ac'"); + } +} + +sub lang_ratfor_finish +{ + local ($ext) = 'r'; + last unless $extension_seen{$ext}; + push (@suffixes, '.' . $ext); + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ('FFLAGS'); + &define_configure_variable ('RFLAGS'); + &define_variable ('RCOMPILE', '$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)'); + &define_variable ('LTRCOMPILE', + $ltcompile . '$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)') + if ($seen_libtool); + + &define_variable ('F77LD', '$(F77)'); + &define_variable ('F77LINK', $ltlink . '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS) $(LDFLAGS) -o $@'); + + $output_rules .= ("$ext.o:\n" + . "\t\$(RCOMPILE) -c \$<\n"); + # FIXME: Using cygpath should be somehow conditional. + $output_rules .= ("$ext.obj:\n" + . "\t\$(RCOMPILE) -c `cygpath -w \$<`\n") + if ($seen_objext); + $output_rules .= ("$ext.lo:\n" + . "\t\$(LTRCOMPILE) -c \$<\n") + if ($seen_libtool); + + # We also handle the case of preprocessing `.r' files into `.f' + # files. + $output_rules .= ("$ext.f:\n" + . "\t\$(RCOMPILE) -F \$<\n"); + + if (! defined $configure_vars{'F77'}) + { + &am_error ("Ratfor source seen but \`F77' not defined in \`$configure_ac'"); + } +} + +sub lang_objc_finish +{ + push (@suffixes, '.m'); + + local ($ltcompile, $ltlink) = &libtool_compiler; + + &define_configure_variable ("OBJCFLAGS"); + &define_variable ('OBJCCOMPILE', '$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)'); + &define_variable ('LTOBJCCOMPILE', + $ltcompile . '$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)') + if ($seen_libtool); + + &define_variable ('OBJCLD', '$(OBJC)'); + &define_variable ('OBJCLINK', $ltlink . '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(LDFLAGS) -o $@'); + + $output_rules .= (".m.o:\n" + . "\t\$(OBJCCOMPILE) -c \$<\n"); + # FIXME: Using cygpath should be somehow conditional. + $output_rules .= (".m.obj:\n" + . "\t\$(OBJCCOMPILE) -c `cygpath -w \$<`\n") + if ($seen_objext); + $output_rules .= (".m.lo:\n" + . "\t\$(LTOBJCCOMPILE) -c \$<\n") + if ($seen_libtool); + + if (! defined $configure_vars{'OBJC'}) + { + &am_error ("Objective C source seen but \`OBJC' not defined in \`$configure_ac'"); + } +} + +# A helper which computes a sorted list of all ObjC extensions which +# were seen. +sub objc_extensions +{ + local ($key, @r); + foreach $key (sort keys %extension_seen) + { + push (@r, '.' . $key) if $extension_map{$key} eq 'objc'; + } + return @r; +} + +# A helper which decides whether libtool is needed. Returns prefix +# for compiler and linker. +sub libtool_compiler +{ + local ($ltcompile, $ltlink) = ('', ''); + if ($seen_libtool) + { + &define_configure_variable ("LIBTOOL"); + $ltcompile = '$(LIBTOOL) --mode=compile '; + $ltlink = '$(LIBTOOL) --mode=link '; + } + return ($ltcompile, $ltlink); +} + +# 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 +{ + local (%linkers) = @_; + + return 'CXXLINK' + if defined $linkers{'CXXLINK'}; + return 'F77LINK' + if defined $linkers{'F77LINK'}; + return 'OBJCLINK' + if defined $linkers{'OBJCLINK'}; + return 'LINK'; +} + +# Called to indicate that an extension was used. +sub saw_extension +{ + local ($ext) = @_; + $extension_seen{$ext} = 1; +} + +# Called to ask whether source files have been seen . If HEADERS is 1, +# headers can be included. +sub saw_sources_p +{ + local ($headers) = @_; + + if ($headers) + { + $headers = 0; + } + else + { + $headers = defined $extension_seen{'header'}; + } + + return scalar keys %extension_seen > $headers; +} + +# Register a single language. If LINKER is the empty string, it means +# to use the C linker. DEANSI_P should only be 1 for languages where +# de-ansi-fication makes sense (i.e., C). EXTENSIONS is a list of +# file extensions to match (no `.' included). +sub register_language +{ + local ($language, $linker, $deansi_p, @extensions) = @_; + + local ($iter); + foreach $iter (@extensions) + { + if (defined $extension_map{$iter}) + { + print STDERR + "automake: programming error: duplicate extension $iter\n"; + exit 1; + } + $extension_map{$iter} = $language; + } + + $language_map{$language . '-ansi-p'} = $deansi_p; + $language_map{$language . '-linker'} = $linker; +} + + +################################################################ + +# Pretty-print something. HEAD is what should be printed at the +# beginning of the first line, FILL is what should be printed at the +# beginning of every subsequent line. +sub pretty_print_internal +{ + local ($head, $fill, @values) = @_; + + local ($column) = length ($head); + local ($result) = $head; + + # Fill length is number of characters. However, each Tab + # character counts for eight. So we count the number of Tabs and + # multiply by 7. + local ($fill_length) = length ($fill); + $fill_length += 7 * ($fill =~ tr/\t/\t/d); + + local ($bol) = ($head eq ''); + foreach (@values) + { + # "71" because we also print a space. + if ($column + length ($_) > 71) + { + $result .= " \\\n" . $fill; + $column = $fill_length; + $bol = 1; + } + + $result .= ' ' unless ($bol); + $result .= $_; + $column += length ($_) + 1; + $bol = 0; + } + + $result .= "\n"; + return $result; +} + +# Pretty-print something and append to output_vars. +sub pretty_print +{ + $output_vars .= &pretty_print_internal (@_); +} + +# Pretty-print something and append to output_rules. +sub pretty_print_rule +{ + $output_rules .= &pretty_print_internal (@_); +} + + +################################################################ + +# See if a target exists. +sub target_defined +{ + local ($target) = @_; + return defined $targets{$target}; +} + +# See if two conditionals are the same. +sub conditional_same +{ + local ($cond1, $cond2) = @_; + + return (&conditional_true_when ($cond1, $cond2) + && &conditional_true_when ($cond2, $cond1)); +} + +# See if a conditional is true. Both arguments are conditional +# strings. This returns true if the first conditional is true when +# the second conditional is true. +sub conditional_true_when +{ + local ($cond, $when) = @_; + + # Check the easy case first. + if ($cond eq $when) + { + return 1; + } + + # Check each component of $cond, which looks @COND1@@COND2@. + foreach $comp (split ('@', $cond)) + { + # The way we split will give null strings between each + # condition. + next if ! $comp; + + if (index ($when, '@' . $comp . '@') == -1) + { + return 0; + } + } + + return 1; +} + +# Check for an ambiguous conditional. This is called when a variable +# or target is being defined conditionally. If we already know about +# a definition that is true under the same conditions, then we have an +# ambiguity. +sub check_ambiguous_conditional +{ + local ($var_name, $cond) = @_; + local (@cond_vals) = split (' ', $conditional{$var_name}); + while (@cond_vals) + { + local ($vcond) = shift (@cond_vals); + shift (@cond_vals); + if (&conditional_true_when ($vcond, $cond) + || &conditional_true_when ($cond, $vcond)) + { + &am_line_error ($var_name, + "$var_name multiply defined in condition"); + } + } +} + +# See if a variable exists. The first argument is the variable name, +# and the optional second argument is the condition which we should +# check. If no condition is given, we currently return true if the +# variable is defined under any condition. +sub variable_defined +{ + local ($var, $cond) = @_; + if (defined $targets{$var}) + { + &am_line_error ($var, "\`$var' is target; expected variable"); + return 0; + } + elsif (defined $contents{$var}) + { + if ($cond && $conditional{$var}) + { + # We have been asked to check for a particular condition, + # and the variable is defined conditionally. We need to + # look through the conditions under which the variable is + # defined, and see if any of them match the conditional we + # have been asked to check. + local (@cond_vars) = split (' ', $conditional{$var}); + while (@cond_vars) + { + if (&conditional_same ($cond, shift (@cond_vars))) + { + # Even a conditional examination is good enough + # for us. FIXME: really should maintain examined + # status on a per-condition basis. + $content_seen{$var} = 1; + return 1; + } + shift (@cond_vars); + } + + # The variable is not defined for the given condition. + return 0; + } + + $content_seen{$var} = 1; + return 1; + } + return 0; +} + +# Mark a variable as examined. +sub examine_variable +{ + local ($var) = @_; + &variable_defined ($var); +} + +# Quote a value in order to put it in $conditional. We need to quote +# spaces, and we need to handle null strings, so that we can later +# retrieve values by splitting on space. +sub quote_cond_val +{ + local ($val) = @_; + $val =~ s/ /\001/g; + $val =~ s/\t/\003/g; + $val = "\002" if $val eq ''; + return $val; +} + +# Unquote a value in $conditional. +sub unquote_cond_val +{ + local ($val) = @_; + $val =~ s/\001/ /g; + $val =~ s/\003/\t/g; + $val =~ s/\002//g; + return $val; +} + +# Return the set of conditions for which a variable is defined. + +# If the variable is not defined conditionally, and is not defined in +# terms of any variables which are defined conditionally, then this +# returns the empty list. + +# If the variable is defined conditionally, but is not defined in +# terms of any variables which are defined conditionally, then this +# returns the list of conditions for which the variable is defined. + +# If the variable is defined in terms of any variables which are +# defined conditionally, then this returns a full set of permutations +# of the subvariable conditions. For example, if the variable is +# defined in terms of a variable which is defined for @COND_TRUE@, +# then this returns both @COND_TRUE@ and @COND_FALSE@. This is +# because we will need to define the variable under both conditions. + +sub variable_conditions +{ + local ($var) = @_; + local (%uniqify); + local ($cond); + + %vars_scanned = (); + foreach $cond (&variable_conditions_sub ($var, '', ())) + { + $uniqify{$cond} = 1; + } + + return keys %uniqify; +} + +# A subroutine of variable_conditions. We only return conditions +# which are true for all the conditions in @PARENT_CONDS. +sub variable_conditions_sub +{ + local ($var, $parent, @parent_conds) = @_; + local (@new_conds) = (); + + if (defined $vars_scanned{$var}) + { + &am_line_error ($parent, "variable \`$var' recursively defined"); + return (); + } + $vars_scanned{$var} = 1; + + if (! $conditional{$var}) + { + foreach (split (' ', $contents{$var})) + { + # If a comment seen, just leave. + last if /^#/; + + # Handle variable substitutions. + if (/^\$\{(.*)\}$/ || /^\$\((.*)\)$/) + { + push (@new_conds, + &variable_conditions_sub ($1, $var, @parent_conds)); + } + } + + # Now we want to return all permutations of the subvariable + # conditions. + local (%allconds, $item); + foreach $item (@new_conds) + { + foreach (split ('@', $item)) + { + next if ! $_; + s/_(TRUE|FALSE)$//; + $allconds{$_ . '_TRUE'} = 1; + } + } + + # Unset our entry in vars_scanned. We only care about recursive + # definitions. + delete $vars_scanned{$var}; + + return &variable_conditions_permutations (keys %allconds); + } + + local (@this_conds) = (); + local (@condvals) = split (' ', $conditional{$var}); + while (@condvals) + { + local ($cond) = shift (@condvals); + local ($val) = &unquote_cond_val (shift (@condvals)); + + if (@parent_conds) + { + local ($ok) = 1; + local ($parent_cond); + foreach $parent_cond (@parent_conds) + { + if (! &conditional_true_when ($parent_cond, $cond)) + { + $ok = 0; + last; + } + } + + next if ! $ok; + } + + push (@this_conds, $cond); + + push (@parent_conds, $cond); + local (@subvar_conds) = (); + foreach (split (' ', $val)) + { + # If a comment seen, just leave. + last if /^#/; + + # Handle variable substitutions. + if (/^\$\{(.*)\}$/ || /^\$\((.*)\)$/) + { + push (@subvar_conds, + &variable_conditions_sub ($1, $var, @parent_conds)); + } + } + pop (@parent_conds); + + # If there are no conditional subvariables, then we want to + # return this condition. Otherwise, we want to return the + # permutations of the subvariables. + if (! @subvar_conds) + { + push (@new_conds, $cond); + } + else + { + push (@new_conds, &variable_conditions_reduce (@subvar_conds)); + } + } + + # Unset our entry in vars_scanned. We only care about recursive + # definitions. + delete $vars_scanned{$var}; + + return @new_conds + if ! $parent; + + # If we are being called on behalf of another variable, we need to + # return all possible permutations of the conditions. We have + # already handled everything in @this_conds along with their + # subvariables. We now need to add any permutations that are not + # in @this_conds. + local ($this_cond); + foreach $this_cond (@this_conds) + { + local (@perms) = + &variable_conditions_permutations (split('@', $this_cond)); + local ($perm); + foreach $perm (@perms) + { + local ($scan); + local ($ok) = 1; + foreach $scan (@this_conds) + { + if (&conditional_true_when ($perm, $scan) + || &conditional_true_when ($scan, $perm)) + { + $ok = 0; + last; + } + } + next if ! $ok; + + if (@parent_conds) + { + local ($ok) = 1; + local ($parent_cond); + foreach $parent_cond (@parent_conds) + { + if (! &conditional_true_when ($parent_cond, $perm)) + { + $ok = 0; + last; + } + } + + next if ! $ok; + } + + # This permutation was not already handled, and is valid + # for the parents. + push (@new_conds, $perm); + } + } + + return @new_conds; +} + +# Subroutine for variable_conditions_sort +sub variable_conditions_cmp +{ + local ($as) = $a; + $as =~ s/[^@]//g; + local ($bs) = $b; + $bs =~ s/[^@]//g; + return (length ($as) <=> length ($bs) + || $a cmp $b); +} + +# Sort a list of conditionals so that only the exclusive ones are +# retained. For example, if both @COND1_TRUE@@COND2_TRUE@ and +# @COND1_TRUE@ are in the list, discard the latter. +sub variable_conditions_reduce +{ + local (@conds) = @_; + local (@ret) = (); + local ($cond); + foreach $cond (sort variable_conditions_cmp @conds) + { + local ($ok) = 1; + local ($scan); + foreach $scan (@ret) + { + if (&conditional_true_when ($cond, $scan)) + { + $ok = 0; + last; + } + } + next if ! $ok; + push (@ret, $cond); + } + + return @ret; +} + +# Return a list of permutations of a conditional string. +sub variable_conditions_permutations +{ + local (@comps) = @_; + return () + if ! @comps; + local ($comp) = shift (@comps); + return &variable_conditions_permutations (@comps) + if $comp eq ''; + local ($neg) = $comp; + $neg =~ s/TRUE$/TRUEO/; + $neg =~ s/FALSE$/TRUE/; + $neg =~ s/TRUEO$/FALSE/; + local (@ret); + local ($sub); + foreach $sub (&variable_conditions_permutations (@comps)) + { + push (@ret, '@' . $comp . '@' . $sub); + push (@ret, '@' . $neg . '@' . $sub); + } + if (! @ret) + { + push (@ret, '@' . $comp . '@'); + push (@ret, '@' . $neg . '@'); + } + return @ret; +} + +# Warn if a variable is conditionally defined. This is called if we +# are using the value of a variable. +sub variable_conditionally_defined +{ + local ($var, $parent) = @_; + if ($conditional{$var}) + { + if ($parent) + { + &am_line_error ($parent, + "warning: automake does not support conditional definition of $var in $parent"); + } + else + { + &am_line_error ($parent, + "warning: automake does not support $var being defined conditionally") + } + } +} + +# Get the value of a variable. This just returns $contents, but warns +# if the variable is conditionally defined. +sub variable_value +{ + local ($var) = @_; + &variable_conditionally_defined ($var); + return $contents{$var}; +} + +# Convert a variable value to a list, split as whitespace. This will +# recursively follow $(...) and ${...} inclusions. It preserves @...@ +# substitutions. If COND is 'all', then all values under all +# conditions should be returned; if COND is a particular condition +# (all conditions are surrounded by @...@) then only the value for +# that condition should be returned; otherwise, warn if VAR is +# conditionally defined. SCANNED is a global hash listing whose keys +# are all the variables already scanned; it is an error to rescan a +# variable. +sub value_to_list +{ + local ($var, $val, $cond) = @_; + local (@result); + + foreach (split (' ', $val)) + { + # If a comment seen, just leave. + last if /^#/; + + # Handle variable substitutions. + if (/^\$\{([^}]*)\}$/ || /^\$\(([^)]*)\)$/) + { + local ($varname) = $1; + + # If the user uses a losing variable name, just ignore it. + # This isn't ideal, but people have requested it. + next if ($varname =~ /\@.*\@/); + + local ($from, $to); + local (@temp_list); + if ($varname =~ /^([^:]*):([^=]*)=(.*)$/) + { + $varname = $1; + $to = $3; + ($from = $2) =~ s/(\W)/\\$1/g; + } + + # Find the value. + @temp_list = &variable_value_as_list_worker ($1, $cond, $var); + + # Now rewrite the value if appropriate. + if ($from) + { + grep (s/$from$/$to/, @temp_list); + } + + push (@result, @temp_list); + } + else + { + push (@result, $_); + } + } + + return @result; +} + +# Return contents of variable as list, split as whitespace. This will +# recursively follow $(...) and ${...} inclusions. It preserves @...@ +# substitutions. If COND is 'all', then all values under all +# conditions should be returned; if COND is a particular condition +# (all conditions are surrounded by @...@) then only the value for +# that condition should be returned; otherwise, warn if VAR is +# conditionally defined. If PARENT is specified, it is the name of +# the including variable; this is only used for error reports. +sub variable_value_as_list_worker +{ + local ($var, $cond, $parent) = @_; + local (@result); + + if (defined $targets{$var}) + { + &am_line_error ($var, "\`$var' is target; expected variable"); + } + elsif (! defined $contents{$var}) + { + &am_line_error ($parent, "variable \`$var' not defined"); + } + elsif (defined $vars_scanned{$var}) + { + # `vars_scanned' is a global we use to keep track of which + # variables we've already examined. + &am_line_error ($parent, "variable \`$var' recursively defined"); + } + elsif ($cond eq 'all' && $conditional{$var}) + { + $vars_scanned{$var} = 1; + local (@condvals) = split (' ', $conditional{$var}); + while (@condvals) + { + shift (@condvals); + local ($val) = &unquote_cond_val (shift (@condvals)); + push (@result, &value_to_list ($var, $val, $cond)); + } + } + elsif ($cond && $conditional{$var}) + { + $vars_scanned{$var} = 1; + local (@condvals) = split (' ', $conditional{$var}); + local ($onceflag); + while (@condvals) + { + local ($vcond) = shift (@condvals); + local ($val) = &unquote_cond_val (shift (@condvals)); + if (&conditional_true_when ($vcond, $cond)) + { + # Warn if we have an ambiguity. It's hard to know how + # to handle this case correctly. + &variable_conditionally_defined ($var, $parent) + if $onceflag; + $onceflag = 1; + push (@result, &value_to_list ($var, $val, $cond)); + } + } + } + else + { + $vars_scanned{$var} = 1; + &variable_conditionally_defined ($var, $parent); + $content_seen{$var} = 1; + push (@result, &value_to_list ($var, $contents{$var}, $cond)); + } + + # Unset our entry in vars_scanned. We only care about recursive + # definitions. + delete $vars_scanned{$var}; + + return @result; +} + +# This is just a wrapper for variable_value_as_list_worker that +# initializes the global hash `vars_scanned'. This hash is used to +# avoid infinite recursion. +sub variable_value_as_list +{ + local ($var, $cond, $parent) = @_; + %vars_scanned = (); + return &variable_value_as_list_worker ($var, $cond, $parent); +} + +# Define a new variable, but only if not already defined. +sub define_variable +{ + local ($var, $value) = @_; + + if (! defined $contents{$var}) + { + $output_vars .= $var . ' = ' . $value . "\n"; + $contents{$var} = $value; + $content_seen{$var} = 1; + } +} + +# Like define_variable, but the value is a list, and the variable may +# be defined conditionally. The second argument is the conditional +# 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 +{ + local ($var, $cond, @value) = @_; + if (! defined $contents{$var} + || ($cond && ! &variable_defined ($var, $cond))) + { + $contents{$var} = join (' ', @value); + if ($cond) + { + if ($conditional{$var}) + { + $conditional{$var} .= ' '; + } + else + { + $conditional{$var} = ''; + } + $conditional{$var} .= ($cond + . ' ' + . "e_cond_val ($contents{$var})); + } + &pretty_print ($cond . $var . ' = ', $cond, @value); + $content_seen{$var} = 1; + } +} + +# Like define_variable, but define a variable to be the configure +# substitution by the same name. +sub define_configure_variable +{ + local ($var) = @_; + local ($value) = '@' . $var . '@'; + &define_variable ($var, $value); +} + +# Define a variable that represents a program to run. If in Cygnus +# mode, the program is searched for in the build (or source) tree. +# Otherwise no searching is done at all. Arguments are: +# * VAR Name of variable to define +# * WHATDIR Either `src' or `build', depending on where program should +# be found. (runtest is in srcdir!) +# * SUBDIR Subdir of top-level dir +# * PROGRAM Name of program +# * OVERRIDE If specified, the name of the program to use when not in +# Cygnus mode. Defaults to PROGRAM. +sub define_program_variable +{ + local ($var, $whatdir, $subdir, $program, $override) = @_; + + if (! $override) + { + $override = $program; + } + + if ($cygnus_mode) + { + local ($full) = ('$(top_' . $whatdir . 'dir)/../' + . $subdir . '/' . $program); + &define_variable ($var, ('`if test -f ' . $full + . '; then echo ' . $full . '; else echo ' + . $program . '; fi`')); + } + else + { + &define_variable ($var, $override); + } +} + + +################################################################ + +# Read Makefile.am and set up %contents. Simultaneously copy lines +# from Makefile.am into $output_trailer or $output_vars as +# appropriate. NOTE we put rules in the trailer section. We want +# user rules to come after our generated stuff. +sub read_am_file +{ + local ($amfile) = @_; + local (*AM_FILE); + + open (AM_FILE, $amfile) || die "automake: couldn't open \`$amfile': $!\n"; + print "automake: reading $amfile\n" if $verbose; + + local ($saw_bk) = 0; + local ($was_rule) = 0; + local ($spacing) = ''; + local ($comment) = ''; + local ($last_var_name) = ''; + local ($blank) = 0; + + while () + { + if (/$IGNORE_PATTERN/o) + { + # Merely delete comments beginning with two hashes. + } + elsif (/$WHITE_PATTERN/o) + { + # Stick a single white line before the incoming macro or rule. + $spacing = "\n"; + $blank = 1; + } + elsif (/$COMMENT_PATTERN/o) + { + # Stick comments before the incoming macro or rule. Make + # sure a blank line preceeds first block of comments. + $spacing = "\n" unless $blank; + $blank = 1; + $comment .= $spacing . $_; + $spacing = ''; + } + else + { + last; + } + } + + $output_vars .= $comment . "\n"; + $comment = ''; + $spacing = "\n"; + + local ($is_ok_macro); + while ($_) + { + $_ .= "\n" + unless substr ($_, -1, 1) eq "\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; + + if (/$IGNORE_PATTERN/o) + { + # Merely delete comments beginning with two hashes. + } + elsif (/$WHITE_PATTERN/o) + { + # Stick a single white line before the incoming macro or rule. + $spacing = "\n"; + &am_line_error ($., "blank line following trailing backslash") + if $saw_bk; + } + elsif (/$COMMENT_PATTERN/o) + { + # Stick comments before the incoming macro or rule. + $comment .= $spacing . $_; + $spacing = ''; + &am_line_error ($., "comment following trailing backslash") + if $saw_bk; + } + elsif ($saw_bk) + { + if ($was_rule) + { + $output_trailer .= join ('', @conditional_stack) . $_; + $saw_bk = /\\$/; + } + else + { + $saw_bk = /\\$/; + # Chop newline and backslash if this line is + # continued. ensure trailing whitespace exists. + chop if $saw_bk; + chop if $saw_bk; + $contents{$last_var_name} .= ' ' + unless $contents{$last_var_name} =~ /\s$/; + $contents{$last_var_name} .= $_; + if (@conditional_stack) + { + $conditional{$last_var_name} .= "e_cond_val ($_); + } + } + } + elsif (/$IF_PATTERN/o) + { + &am_line_error ($., "$1 does not appear in AM_CONDITIONAL") + if (! $configure_cond{$1}); + push (@conditional_stack, "\@" . $1 . "_TRUE\@"); + } + elsif (/$ELSE_PATTERN/o) + { + if (! @conditional_stack) + { + &am_line_error ($., "else without if"); + } + elsif ($conditional_stack[$#conditional_stack] =~ /_FALSE\@$/) + { + &am_line_error ($., "else after else"); + } + else + { + $conditional_stack[$#conditional_stack] + =~ s/_TRUE\@$/_FALSE\@/; + } + } + elsif (/$ENDIF_PATTERN/o) + { + if (! @conditional_stack) + { + &am_line_error ($., "endif without if"); + } + else + { + pop @conditional_stack; + } + } + elsif (/$RULE_PATTERN/o) + { + # Found a rule. + $was_rule = 1; + if (defined $contents{$1} + && (@conditional_stack + ? ! defined $conditional{$1} + : defined $conditional{$1})) + { + &am_line_error ($1, + "$1 defined both conditionally and unconditionally"); + } + # Value here doesn't matter; for targets we only note + # existence. + $contents{$1} = 1; + $targets{$1} = 1; + local ($cond_string) = join ('', @conditional_stack); + if (@conditional_stack) + { + if ($conditional{$1}) + { + &check_ambiguous_conditional ($1, $cond_string); + $conditional{$1} .= ' '; + } + else + { + $conditional{$1} = ''; + } + $conditional{$1} .= $cond_string . ' 1'; + } + $content_lines{$1} = $.; + $output_trailer .= $comment . $spacing . $cond_string . $_; + $comment = $spacing = ''; + $saw_bk = /\\$/; + + # Check the rule for being a suffix rule. If so, store in + # a hash. + + local ($source_suffix); + local ($object_suffix); + + if (($source_suffix, $object_suffix) = ($1 =~ $SUFFIX_RULE_PATTERN)) + { + $suffix_rules{$source_suffix} = $object_suffix; + print "Sources ending in .$source_suffix become .$object_suffix\n" if $verbose; + $source_suffix_pattern = "(" . join('|', keys %suffix_rules) . ")"; + } + + # FIXME: make sure both suffixes are in SUFFIXES? Or set + # SUFFIXES from suffix_rules? + } + elsif (($is_ok_macro = /$MACRO_PATTERN/o) + || /$BOGUS_MACRO_PATTERN/o) + { + # Found a macro definition. + $was_rule = 0; + $last_var_name = $1; + if (defined $contents{$1} + && (@conditional_stack + ? ! defined $conditional{$1} + : defined $conditional{$1})) + { + &am_line_error ($1, + "$1 defined both conditionally and unconditionally"); + } + local ($value); + if ($3 ne '' && substr ($3, -1) eq "\\") + { + $value = substr ($3, 0, length ($3) - 1); + } + else + { + $value = $3; + } + local ($type) = $2; + if ($type eq '+') + { + if (! defined $contents{$last_var_name} + && defined $configure_vars{$last_var_name}) + { + $contents{$last_var_name} = '@' . $last_var_name . '@'; + } + $contents{$last_var_name} .= ' ' . $value; + } + else + { + $contents{$last_var_name} = $value; + # The first assignment to a macro sets the line + # number. Ideally I suppose we would associate line + # numbers with random bits of text. + $content_lines{$last_var_name} = $.; + } + local ($cond_string) = join ('', @conditional_stack); + if (@conditional_stack) + { + local ($found) = 0; + local ($val); + if ($conditional{$last_var_name}) + { + if ($type eq '+') + { + # If we're adding to the conditional, and it + # exists, then we might want to simply replace + # the old value with the new one. + local (@new_vals, @cond_vals); + @cond_vals = split (' ', $conditional{$last_var_name}); + while (@cond_vals) + { + local ($vcond) = shift (@cond_vals); + push (@new_vals, $vcond); + if (&conditional_same ($vcond, $cond_string)) + { + $found = 1; + $val = (&unquote_cond_val (shift (@cond_vals)) + . ' ' . $value); + push (@new_vals, "e_cond_val ($val)); + } + else + { + push (@new_vals, shift (@cond_vals)); + } + } + if ($found) + { + $conditional{$last_var_name} + = join (' ', @new_vals); + } + } + + if (! $found) + { + &check_ambiguous_conditional ($last_var_name, + $cond_string); + $conditional{$last_var_name} .= ' '; + $val = $value; + } + } + else + { + $conditional{$last_var_name} = ''; + $val = $contents{$last_var_name}; + } + if (! $found) + { + $conditional{$last_var_name} .= ($cond_string + . ' ' + . "e_cond_val ($val)); + } + } + + # FIXME: this doesn't always work correctly; it will group + # all comments for a given variable, no matter where + # defined. + $am_vars{$last_var_name} = $comment . $spacing; + $def_type{$last_var_name} = ($type eq ':') ? ':' : ''; + push (@var_list, $last_var_name); + $comment = $spacing = ''; + $saw_bk = /\\$/; + + # Error if bogus. + &am_line_error ($., "bad macro name \`$last_var_name'") + if ! $is_ok_macro; + } + elsif (/$INCLUDE_PATTERN/o) + { + local ($path) = $1; + + if ($path =~ s/^\$\(top_srcdir\)\///) + { + push (@include_stack, "\$\(top_srcdir\)/$path"); + } + else + { + $path =~ s/\$\(srcdir\)\///; + push (@include_stack, "\$\(srcdir\)/$path"); + $path = $relative_dir . "/" . $path; + } + &read_am_file ($path); + } + else + { + # This isn't an error; it is probably a continued rule. + # In fact, this is what we assume. + $was_rule = 1; + $output_trailer .= ($comment . $spacing + . join ('', @conditional_stack) . $_); + $comment = $spacing = ''; + $saw_bk = /\\$/; + } + + $_ = ; + } + + $output_trailer .= $comment; + + &am_error ("unterminated conditionals: " . join (' ', @conditional_stack)) + if (@conditional_stack); +} + +# Read main am file. +sub read_main_am_file +{ + local ($amfile) = @_; + + $output_vars = ("# $in_file_name generated automatically by automake " + . $VERSION . " from $am_file_name\n"); + + # Generate copyright for generated Makefile.in. + $output_vars .= $gen_copyright; + + # The keys here are variables we want to dump at the end of this + # function. The values are corresponding comments. + local (%am_vars) = (); + local (@var_list) = (); + local (%def_type) = (); + + &read_am_file ($amfile); + + # Compute relative location of the top object directory. + local (@topdir) = (); + foreach (split (/\//, $relative_dir)) + { + next if $_ eq '.' || $_ eq ''; + if ($_ eq '..') + { + pop @topdir; + } + else + { + push (@topdir, '..'); + } + } + @topdir = ('.') if ! @topdir; + + $top_builddir = join ('/', @topdir); + local ($build_rx); + ($build_rx = $top_builddir) =~ s/(\W)/\\$1/g; + $output_vars .= &file_contents_with_transform + ('s/\@top_builddir\@/' . $build_rx . '/g;', + 'header-vars'); + + # Generate some useful variables when AC_CANONICAL_* used. FIXME: + # this should use generic %configure_vars method. + if ($seen_canonical) + { + local ($curs, %vars); + $vars{'host_alias'} = 'host_alias'; + $vars{'host_triplet'} = 'host'; + if ($seen_canonical == $AC_CANONICAL_SYSTEM) + { + $vars{'build_alias'} = 'build_alias'; + $vars{'build_triplet'} = 'build'; + $vars{'target_alias'} = 'target_alias'; + $vars{'target_triplet'} = 'target'; + } + foreach $curs (sort keys %vars) + { + $output_vars .= "$curs = \@$vars{$curs}\@\n"; + $contents{$curs} = "\@$vars{$curs}\@"; + } + } + + local ($curs); + foreach $curs (sort keys %configure_vars) + { + &define_configure_variable ($curs); + } + + # Now dump the variables that were defined. We do it in the same + # order in which they were defined (skipping duplicates). + local (%done); + foreach $curs (@var_list) + { + next if $done{$curs}; + $done{$curs} = 1; + + $output_vars .= $am_vars{$curs}; + if ($conditional{$curs}) + { + local (@cond_vals) = split (' ', $conditional{$curs}); + while (@cond_vals) + { + local ($vcond) = shift (@cond_vals); + local ($val) = &unquote_cond_val (shift (@cond_vals)); + $output_vars .= ($vcond . $curs + . ' ' . $def_type{$curs} . '= ' + . $val . "\n"); + } + } + else + { + $output_vars .= ($curs . ' ' . $def_type{$curs} . '= ' + . $contents{$curs} . "\n"); + } + } +} + +################################################################ + +sub initialize_global_constants +{ + # Values for AC_CANONICAL_* + $AC_CANONICAL_HOST = 1; + $AC_CANONICAL_SYSTEM = 2; + + # Associative array of standard directory names. Entry is TRUE if + # corresponding directory should be installed during + # 'install-exec' phase. + %exec_dir_p = + ('bin', 1, + 'sbin', 1, + 'libexec', 1, + 'data', 0, + 'sysconf', 1, + 'localstate', 1, + 'lib', 1, + 'info', 0, + 'man', 0, + 'include', 0, + 'oldinclude', 0, + 'pkgdata', 0, + 'pkglib', 1, + 'pkginclude', 0 + ); + + # Commonly found files we look for and automatically include in + # DISTFILES. + @common_files = + ( + "README", "THANKS", "TODO", "NEWS", "COPYING", "COPYING.LIB", + "INSTALL", "ABOUT-NLS", "ChangeLog", "configure.ac", + "configure.in", "configure", "config.guess", "config.sub", + "AUTHORS", "BACKLOG", "ABOUT-GNU", "libversion.in", + "mdate-sh", "mkinstalldirs", "install-sh", 'texinfo.tex', + "ansi2knr.c", "ansi2knr.1", 'elisp-comp', + 'ylwrap', 'acinclude.m4', @libtoolize_files, @libtoolize_sometimes, + 'missing' + ); + + # Commonly used files we auto-include, but only sometimes. + @common_sometimes = + ( + "aclocal.m4", "acconfig.h", "config.h.top", + "config.h.bot", "stamp-h.in", 'stamp-vti' + ); + + $USAGE = "\ + -a, --add-missing add missing standard files to package + --amdir=DIR directory storing config files + --build-dir=DIR directory where build being done (for dependencies) + -c, --copy with -a, copy missing files (default is symlink) + --cygnus assume program is part of Cygnus-style tree + --foreign set strictness to foreign + --gnits set strictness to gnits + --gnu set strictness to gnu + --help print this help, then exit + -i, --include-deps include generated dependencies in Makefile.in + --no-force only update Makefile.in's that are out of date + -o DIR, --output-dir=DIR + put generated Makefile.in's into DIR + --srcdir-name=DIR name used for srcdir (for dependencies) + -v, --verbose verbosely list files processed + --version print version number, then exit\n"; + + # Copyright on generated Makefile.ins. + $gen_copyright = "\ +# Copyright (C) 1994, 1995-8, 1999, 2001 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. +"; + + # Ignore return result from chmod, because it might give an error + # if we chmod a symlink. + $dist_header = "\t" . '-chmod -R a+r $(distdir)' . "\n"; + $dist{'dist-tarZ'} = ("\t" + . '$(TAR) chf - $(distdir) | compress -c > $(distdir).tar.Z' + . "\n"); + $dist{'dist-shar'} = ("\t" + . 'shar $(distdir) | gzip > $(distdir).shar.gz' + . "\n"); + $dist{'dist-zip'} = "\t" . 'zip -rq $(distdir).zip $(distdir)' . "\n"; + $dist{'dist'} = "\t" . 'GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)' . "\n"; + $dist_trailer = "\t" . '-rm -rf $(distdir)' . "\n"; +} + +# (Re)-Initialize per-Makefile.am variables. +sub initialize_per_input +{ + # These two variables are used when generating each Makefile.in. + # They hold the Makefile.in until it is ready to be printed. + $output_rules = ''; + $output_vars = ''; + $output_trailer = ''; + $output_all = ''; + $output_header = ''; + + # Suffixes found during a run. + @suffixes = (); + + # This holds the contents of a Makefile.am, as parsed by + # read_am_file. + %contents = (); + + # This holds the names which are targets. These also appear in + # %contents. + %targets = (); + + # For a variable or target which is defined conditionally, this + # holds an array of the conditional values. The array is composed + # of pairs of condition strings (the variables which configure + # will substitute) and values (the value of a target is + # meaningless). For an unconditional variable, this is empty. + %conditional = (); + + # This holds the line numbers at which various elements of + # %contents are defined. + %content_lines = (); + + # This holds a 1 if a particular variable was examined. + %content_seen = (); + + # This is the conditional stack. + @conditional_stack = (); + + # This holds the set of included files. + @include_stack = (); + + # This holds the "relative directory" of the current Makefile.in. + # Eg for src/Makefile.in, this is "src". + $relative_dir = ''; + + # This holds a list of files that are included in the + # distribution. + %dist_common = (); + + # List of dependencies for the obvious targets. + @install_data = (); + @install_exec = (); + @uninstall = (); + @installdirs = (); + + @info = (); + @dvi = (); + @all = (); + @check = (); + @check_tests = (); + @installcheck = (); + @clean = (); + + @phony = (); + + # A list of files deleted by `maintainer-clean'. + @maintainer_clean_files = (); + + # These are pretty obvious, too. They are used to define the + # SOURCES and OBJECTS variables. + @sources = (); + @objects = (); + + # These variables track inclusion of various compile-related .am + # files. $included_generic_compile is TRUE if the basic code has + # been included. $included_knr_compile is TRUE if the ansi2knr + # code has been included. $included_libtool_compile is TRUE if + # libtool support has been included. + $included_generic_compile = 0; + $included_knr_compile = 0; + $included_libtool_compile = 0; + + # TRUE if install targets should work recursively. + $recursive_install = 0; + + # All .P files. + %dep_files = (); + + # Strictness levels. + $strictness = $default_strictness; + $strictness_name = $default_strictness_name; + + # Options from AUTOMAKE_OPTIONS. + %options = (); + + # Whether or not dependencies are handled. Can be further changed + # in handle_options. + $use_dependencies = $cmdline_use_dependencies; + + # Per Makefile.am. + $local_maint_charset = $maint_charset; + + # All yacc and lex source filenames for this directory. Use + # filenames instead of raw count so that multiple instances are + # counted correctly (eg one yacc file can appear in multiple + # programs without harm). + %yacc_sources = (); + %lex_sources = (); + + # This is a list of all targets to run during "make dist". + @dist_targets = (); + + # Keys in this hash are the basenames of files which must depend + # on ansi2knr. + %de_ansi_files = (); + + # This maps the source extension of a suffix rule to its + # corresponding output extension. + %suffix_rules = (); + + # This is the name of the recursive `all' target to use. + $all_target = 'all-recursive'; + + # This keeps track of which extensions we've seen (that we care + # about). + %extension_seen = (); + + # This is random scratch space for the language finish functions. + # Don't randomly overwrite it; examine other uses of keys first. + %language_scratch = (); +} + + +################################################################ + +# Return contents of a file from $am_dir, automatically skipping +# macros or rules which are already known. Runs command on each line +# as it is read; this command can modify $_. +sub file_contents_with_transform +{ + local ($command, $basename) = @_; + local ($file) = $am_dir . '/' . $basename . '.am'; + + if ($command ne '' && substr ($command, -1) ne ';') + { + die "automake: programming error in file_contents_with_transform: $command\n"; + } + + open (FC_FILE, $file) + || die "automake: installation error: cannot open \`$file'\n"; + # Looks stupid? + # print "automake: reading $file\n" if $verbose; + + local ($was_rule) = 0; + local ($result_vars) = ''; + local ($result_rules) = ''; + local ($comment) = ''; + local ($spacing) = "\n"; + local ($skipping) = 0; + local ($had_chars); + + while () + { + $_ =~ s/\@MAINTAINER_MODE_TRUE\@//g + unless $seen_maint_mode; + + $had_chars = length ($_) && $_ ne "\n"; + eval $command; + # If the transform caused all the characters to go away, then + # ignore the line. Why do this? Because in Perl 4, a "next" + # inside of an eval doesn't affect a loop outside the eval. + # So we can't pass in a "transform" that uses next. We used + # to do this. "Empty" also means consisting of a single + # newline. + next if $had_chars && ($_ eq '' || $_ eq "\n"); + + if (/$IGNORE_PATTERN/o) + { + # Merely delete comments beginning with two hashes. + } + elsif (/$WHITE_PATTERN/o) + { + # Stick a single white line before the incoming macro or rule. + $spacing = "\n"; + &am_line_error ($., "blank line following trailing backslash") + if $saw_bk; + } + elsif (/$COMMENT_PATTERN/o) + { + # Stick comments before the incoming macro or rule. + $comment .= $spacing . $_; + $spacing = ''; + &am_line_error ($., "comment following trailing backslash") + if $saw_bk; + } + elsif ($saw_bk) + { + if ($was_rule) + { + $result_rules .= $_ if ! $skipping; + } + else + { + $result_vars .= $_ if ! $skipping; + } + $saw_bk = /\\$/; + } + elsif (/$RULE_PATTERN/o) + { + # Found a rule. + $was_rule = 1; + $skipping = defined $contents{$1}; + $result_rules .= $comment . $spacing . $_ if ! $skipping; + $comment = $spacing = ''; + $saw_bk = /\\$/; + } + elsif (/$MACRO_PATTERN/o) + { + # Found a variable reference. + $was_rule = 0; + $skipping = defined $contents{$1}; + $result_vars .= $comment . $spacing . $_ if ! $skipping; + $comment = $spacing = ''; + $saw_bk = /\\$/; + } + else + { + # This isn't an error; it is probably a continued rule. + # In fact, this is what we assume. + $was_rule = 1; + $result_rules .= $comment . $spacing . $_ if ! $skipping; + $comment = $spacing = ''; + $saw_bk = /\\$/; + } + } + + close (FC_FILE); + return $result_vars . $result_rules . $comment; +} + +# Like file_contents_with_transform, but no transform. +sub file_contents +{ + return &file_contents_with_transform ('', @_); +} + +# Find all variable prefixes that are used for install directories. A +# prefix `zar' qualifies iff: +# * `zardir' is a variable. +# * `zar_PRIMARY' is a variable. +sub am_primary_prefixes +{ + local ($primary, @prefixes) = @_; + + local (%valid, $varname); + grep ($valid{$_} = 0, @prefixes); + $valid{'EXTRA'} = 0; + foreach $varname (keys %contents) + { + if ($varname =~ /^(.*)_$primary$/) + { + if (! defined $valid{$1} + && ! &variable_defined ($1 . 'dir') + # Note that a configure variable is always legitimate. + # It is natural to name such variables after the + # primary, so we explicitly allow it. + && ! defined $configure_vars{$varname}) + { + &am_line_error ($varname, "invalid variable \`$varname'"); + } + else + { + # Ensure all extended prefixes are actually used. + $valid{$1} = 1; + } + } + } + + return %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 (eg HEADERS), and all +# subsequent arguments are possible installation locations. Returns +# list of all values of all _HOW targets. +# +# 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 +{ + local (@args) = @_; + + local ($do_clean) = 0; + local ($do_require) = 1; + + local ($ltxform); + if (defined $configure_vars{'LIBTOOL'}) + { + # Transform '@LIBTOOL ...@' to '$(LIBTOOL) ...' + $ltxform = 's/\@LIBTOOL([^\@]*)\@/\$(LIBTOOL) $1/;'; + } + else + { + # Delete '@LIBTOOL ...@' + $ltxform = 's/\@LIBTOOL([^\@]*)\@//;'; + } + + local ($cygxform); + if (! $seen_exeext) + { + $cygxform = 's/\@EXEEXT\@//g;'; + } + else + { + $cygxform = 's/\@EXEEXT\@/\$(EXEEXT)/g;'; + } + + while (@args) + { + if ($args[0] eq '-clean') + { + $do_clean = 1; + } + elsif ($args[0] eq '-noextra') + { + $do_require = 0; + } + elsif ($args[0] !~ /^-/) + { + last; + } + shift (@args); + } + local ($file, $primary, @prefixes) = @args; + + local (@used) = (); + local (@result) = (); + + # 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. + &am_line_error ($primary, "\`$primary' is an anachronism") + if &variable_defined ($primary) && $primary ne 'JAVA'; + + + # Look for misspellings. It is an error to have a variable ending + # in a "reserved" suffix whose prefix is unknown, eg + # "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. Perhaps it should be + # disallowed in the Gnits case? The problem is, sometimes it is + # useful to put things in a subdir of eg pkgdatadir, perhaps even + # for Gnitsoids. + local (%valid) = &am_primary_prefixes ($primary, @prefixes); + + # If a primary includes a configure substitution, then the EXTRA_ + # form is required. Otherwise we can't properly do our job. + local ($require_extra); + local ($warned_about_extra) = 0; + + local ($clean_file) = $file . '-clean'; + local ($one_name); + local ($X); + foreach $X (sort keys %valid) + { + $one_name = $X . '_' . $primary; + if (&variable_defined ($one_name)) + { + # Append actual contents of where_PRIMARY variable to + # result. + local ($rcurs); + foreach $rcurs (&variable_value_as_list ($one_name, 'all')) + { + # Skip configure substitutions. Possibly bogus. + if ($rcurs =~ /^\@.*\@$/) + { + if ($X eq 'EXTRA') + { + if (! $warned_about_extra) + { + $warned_about_extra = 1; + { + &am_line_error ($one_name, + "\`$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; + } + + next; + } + + push (@result, $rcurs); + } + + # "EXTRA" shouldn't be used when generating clean targets, + # all, or install targets. + if ($X eq 'EXTRA') + { + if (! $warned_about_extra && ! $do_require) + { + $warned_about_extra = 1; + &am_line_error ($one_name, + "\`$one_name' should not be defined"); + } + next; + } + + # A blatant hack: we rewrite each _PROGRAMS primary to + # include EXEEXT when in Cygwin32 mode. + if ($seen_exeext && $primary eq 'PROGRAMS') + { + local (@conds) = &variable_conditions ($one_name); + local (@one_binlist); + + # FIXME: this definitely loses aesthetically; it + # redefines $ONE_NAME. Instead we should arrange for + # variable definitions to be output later, instead of + # at scan time. + + if (! @conds) + { + @one_binlist = (); + foreach $rcurs (&variable_value_as_list ($one_name, '')) + { + if ($rcurs =~ /\./ || $rcurs =~ /^\@.*\@$/) + { + push (@one_binlist, $rcurs); + } + else + { + push (@one_binlist, $rcurs . '$(EXEEXT)'); + } + } + + delete $contents{$one_name}; + &define_pretty_variable ($one_name, '', @one_binlist); + } + else + { + local ($cond); + local ($condvals) = ''; + foreach $cond (@conds) + { + @one_binlist = (); + local (@condval) = &variable_value_as_list ($one_name, + $cond); + foreach $rcurs (@condval) + { + if ($rcurs =~ /\./ || $rcurs =~ /^\@.*\@$/) + { + push (@one_binlist, $rcurs); + } + else + { + push (@one_binlist, $rcurs . '$(EXEEXT)'); + } + } + + push (@condvals, $cond); + push (@condvals, join (' ', @one_binlist)); + } + + delete $contents{$one_name}; + + while (@condvals) + { + $cond = shift (@condvals); + local (@val) = split (' ', shift (@condvals)); + &define_pretty_variable ($one_name, $cond, @val); + } + } + } + + if ($do_clean) + { + $output_rules .= + &file_contents_with_transform ('s/\@DIR\@/' . $X . '/go;' + . $cygxform, + $clean_file); + + push (@clean, $X . $primary); + &push_phony_cleaners ($X . $primary); + } + + if ($X eq 'check') + { + push (@check, '$(' . $one_name . ')'); + } + else + { + push (@used, '$(' . $one_name . ')'); + } + if ($X eq 'noinst' || $X eq 'check') + { + # Objects which don't get installed by default. + next; + } + + $output_rules .= + &file_contents_with_transform ('s/\@DIR\@/' . $X . '/g;' + . $ltxform . $cygxform, + $file); + + push (@uninstall, 'uninstall-' . $X . $primary); + push (@phony, 'uninstall-' . $X . $primary); + push (@installdirs, '$(DESTDIR)$(' . $X . 'dir)'); + if (defined $exec_dir_p{$X} ? $exec_dir_p{$X} : ($X =~ /exec/)) + { + push (@install_exec, 'install-' . $X . $primary); + push (@phony, 'install-' . $X . $primary); + } + else + { + push (@install_data, 'install-' . $X . $primary); + push (@phony, 'install-' . $X . $primary); + } + } + } + + # The JAVA variable is used as the name of the Java interpreter. + if (@used && $primary ne 'JAVA') + { + # Define it. + &define_pretty_variable ($primary, '', @used); + $output_vars .= "\n"; + } + + if ($require_extra && ! &variable_defined ('EXTRA_' . $primary)) + { + &am_line_error ($require_extra, + "\`$require_extra' contains configure substitution, but \`EXTRA_$primary' not defined"); + } + + # Push here because PRIMARY might be configure time determined. + push (@all, '$(' . $primary . ')') + if @used && $primary ne 'JAVA'; + + return (@result); +} + + +################################################################ + +# This variable is local to the "require file" set of functions. +@require_file_paths = (); + +# Verify that the file must exist in the current directory. Usage: +# require_file (isconfigure, line_number, strictness, file) strictness +# is the strictness level at which this file becomes required. Must +# set require_file_paths before calling this function. +# require_file_paths is set to hold a single directory (the one in +# which the first file was found) before return. +sub require_file_internal +{ + local ($is_configure, $line, $mystrict, @files) = @_; + local ($file, $fullfile); + local ($found_it, $errfile, $errdir); + local ($save_dir); + + foreach $file (@files) + { + $found_it = 0; + foreach $dir (@require_file_paths) + { + if ($dir eq '.') + { + $fullfile = $relative_dir . "/" . $file; + $errdir = $relative_dir unless $errdir; + } + else + { + $fullfile = $dir . "/" . $file; + $errdir = $dir unless $errdir; + } + + # Use different name for "error filename". Otherwise on + # an error the bad file will be reported as eg + # `../../install-sh' when using the default + # config_aux_path. + $errfile = $errdir . '/' . $file; + + if (-f $fullfile) + { + $found_it = 1; + # FIXME: Once again, special-case `.'. + &push_dist_common ($file) + if $dir eq $relative_dir || $dir eq '.'; + $save_dir = $dir; + last; + } + } + + if ($found_it) + { + # Prune the path list. + @require_file_paths = $save_dir; + } + else + { + if ($strictness >= $mystrict) + { + local ($trailer) = ''; + local ($suppress) = 0; + + # Only install missing files according to our desired + # strictness level. + local ($message) = "required file \`$errfile' not found"; + if ($add_missing) + { + $suppress = 1; + + # Maybe run libtoolize. + if ($seen_libtool + && grep ($_ eq $file, @libtoolize_files) + && system ('libtoolize', '--automake')) + { + $message = "installing \`$errfile'"; + $suppress = 0; + $trailer = "; cannot run \`libtoolize': $!"; + } + elsif (-f ($am_dir . '/' . $file)) + { + # 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 \`$errfile'"; + # Windows Perl will hang if we try to delete a + # file that doesn't exist. + unlink ($errfile) if -f $errfile; + if ($symlink_exists && ! $copy_missing) + { + if (! symlink ($am_dir . '/' . $file, $errfile)) + { + $suppress = 0; + $trailer = "; error while making link: $!\n"; + } + } + elsif (system ('cp', $am_dir . '/' . $file, $errfile)) + { + $suppress = 0; + $trailer = "\n error while copying\n"; + } + } + } + + local ($save) = $exit_status; + if ($is_configure) + { + # FIXME: allow actual file to be specified. + &am_conf_line_error ($configure_ac, $line, + "$message$trailer"); + } + else + { + &am_line_error ($line, "$message$trailer"); + } + $exit_status = $save if $suppress; + } + } + } +} + +# Like require_file_with_line, but error messages refer to +# configure.ac, not the current Makefile.am. +sub require_file_with_conf_line +{ + @require_file_paths = '.'; + &require_file_internal (1, @_); +} + +sub require_file_with_line +{ + @require_file_paths = '.'; + &require_file_internal (0, @_); +} + +sub require_file +{ + @require_file_paths = '.'; + &require_file_internal (0, '', @_); +} + +# Require a file that is also required by Autoconf. Looks in +# configuration path, as specified by AC_CONFIG_AUX_DIR. +sub require_config_file +{ + @require_file_paths = @config_aux_path; + &require_file_internal (1, '', @_); + local ($dir) = $require_file_paths[0]; + @config_aux_path = @require_file_paths; + if ($dir eq '.') + { + $config_aux_dir = '.'; + } + else + { + $config_aux_dir = '$(top_srcdir)/' . $dir; + } +} + +# Assumes that the line number is in Makefile.am. +sub require_conf_file_with_line +{ + @require_file_paths = @config_aux_path; + &require_file_internal (0, @_); + local ($dir) = $require_file_paths[0]; + @config_aux_path = @require_file_paths; + if ($dir eq '.') + { + $config_aux_dir = '.'; + } + else + { + $config_aux_dir = '$(top_srcdir)/' . $dir; + } +} + +# Assumes that the line number is in Makefile.am. +sub require_conf_file_with_conf_line +{ + @require_file_paths = @config_aux_path; + &require_file_internal (1, @_); + local ($dir) = $require_file_paths[0]; + @config_aux_path = @require_file_paths; + if ($dir eq '.') + { + $config_aux_dir = '.'; + } + else + { + $config_aux_dir = '$(top_srcdir)/' . $dir; + } +} + +################################################################ + +# Push a list of files onto dist_common. +sub push_dist_common +{ + local (@files) = @_; + local ($file); + + foreach $file (@files) + { + $dist_common{$file} = 1; + } +} + +# Push a list of clean targets onto phony. +sub push_phony_cleaners +{ + local ($base) = @_; + local ($target); + foreach $target ('mostly', 'dist', '', 'maintainer-') + { + push (@phony, $target . 'clean-' . $base); + } +} + +# Set strictness. +sub set_strictness +{ + $strictness_name = $_[0]; + if ($strictness_name eq 'gnu') + { + $strictness = $GNU; + } + elsif ($strictness_name eq 'gnits') + { + $strictness = $GNITS; + } + elsif ($strictness_name eq 'foreign') + { + $strictness = $FOREIGN; + } + else + { + die "automake: level \`$strictness_name' not recognized\n"; + } +} + + +################################################################ + +# Return directory name of file. +sub dirname +{ + local ($file) = @_; + local ($sub); + + ($sub = $file) =~ s,/+[^/]+$,,g; + $sub = '.' if $sub eq $file; + return $sub; +} + +# Return file name of a file. +sub basename +{ + local ($file) = @_; + local ($sub); + + ($sub = $file) =~s,^.*/+,,g; + return $sub; +} + +# Ensure a file exists. +sub create +{ + local ($file) = @_; + + open (TOUCH, ">> $file"); + close (TOUCH); +} + +# Glob something. Do this to avoid indentation screwups everywhere we +# want to glob. Gross! +sub my_glob +{ + local ($pat) = @_; + return <${pat}>; +} + +################################################################ + +# Print an error message and set exit status. +sub am_error +{ + warn "automake: ${am_file}.am: ", join (' ', @_), "\n"; + $exit_status = 1; +} + +sub am_line_error +{ + local ($symbol, @args) = @_; + + if ($symbol && "$symbol" ne '-1') + { + local ($file) = "${am_file}.am"; + + if ($symbol =~ /^\d+$/) + { + # SYMBOL is a line number, so just add the colon. + $file .= ':' . $symbol; + } + elsif (defined $content_lines{$symbol}) + { + # SYMBOL is a variable defined in Makefile.am, so add the + # line number we saved from there. + $file .= ':' . $content_lines{$symbol}; + } + elsif (defined $configure_vars{$symbol}) + { + # SYMBOL is a variable defined in configure.ac, so add the + # appropriate line number. + $file = $configure_vars{$symbol}; + } + else + { + # Couldn't find the line number. + } + warn $file, ": ", join (' ', @args), "\n"; + $exit_status = 1; + } + else + { + &am_error (@args); + } +} + +# Like am_error, but while scanning configure.ac. +sub am_conf_error +{ + # FIXME: can run in subdirs. + warn "automake: $configure_ac: ", join (' ', @_), "\n"; + $exit_status = 1; +} + +# Error message with line number referring to configure.ac. +sub am_conf_line_error +{ + local ($file, $line, @args) = @_; + + if ($line) + { + warn "$file: $line: ", join (' ', @args), "\n"; + $exit_status = 1; + } + else + { + &am_conf_error (@args); + } +} + +# Warning message with line number referring to configure.ac. +# Does not affect exit_status +sub am_conf_line_warning +{ + local ($saved_exit_status) = $exit_status; + &am_conf_line_error (@_); + $exit_status = $saved_exit_status; +} + +# Tell user where our aclocal.m4 is, but only once. +sub keyed_aclocal_warning +{ + local ($key) = @_; + warn "automake: macro \`$key' can be generated by \`aclocal'\n"; +} + +# Print usage information. +sub usage +{ + print "Usage: automake [OPTION] ... [Makefile]...\n\n"; + print "Generate Makefile.in for autoconf from Makefile.am\n"; + print $USAGE; + print "\nFiles which are automatically distributed, if found:\n"; + $~ = "USAGE_FORMAT"; + local ($last, $iter, @lcomm); + $last = ''; + foreach $iter (sort ((@common_files, @common_sometimes))) + { + push (@lcomm, $iter) unless $iter eq $last; + $last = $iter; + } + + local ($cols, $rows, $rest); + $cols = 4; + $rows = int(@lcomm / $cols); + $rest = @lcomm % $cols; + + if ($rest) + { + $rows++; + } + else + { + $rest = $cols + } + + local ($x, $y, $idx, @four); + for ($y = 0; $y < $rows; $y++) + { + @four = ("", "", "", ""); + for ($x = 0; $x < $cols; $x++) + { + last if $y + 1 == $rows && $x == $rest; + + $idx = (($x > $rest) + ? ($rows * $rest + ($rows - 1) * ($x - $rest)) + : ($rows * $x)); + $idx += $y; + $four[$x] = $lcomm[$idx]; + } + write; + } + + print "\nReport bugs to .\n"; + + exit 0; +} + +format USAGE_FORMAT = + @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< + $four[0], $four[1], $four[2], $four[3] +. diff --git a/automake.info b/automake.info new file mode 100644 index 0000000..2978f0f --- /dev/null +++ b/automake.info @@ -0,0 +1,111 @@ +This is automake.info, produced by makeinfo version 4.1 from +automake.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* automake: (automake). Making Makefile.in's +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 +END-INFO-DIR-ENTRY + + This file documents GNU automake 1.4-p6 + + Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +Indirect: +automake.info-1: 1110 +automake.info-2: 50005 +automake.info-3: 98431 + +Tag Table: +(Indirect) +Node: Top1110 +Node: Introduction2722 +Node: Generalities4140 +Node: General Operation4673 +Node: Depth6985 +Node: Strictness7989 +Node: Uniform9436 +Node: Canonicalization12733 +Node: Examples13404 +Node: Complete13729 +Node: Hello15699 +Node: etags18357 +Node: Invoking Automake19926 +Node: configure24543 +Node: Requirements25463 +Node: Optional27837 +Node: Invoking aclocal33373 +Node: Macros35314 +Node: Extending aclocal39872 +Node: Top level40848 +Node: Programs43090 +Node: A Program43913 +Node: A Library48256 +Node: LIBOBJS49368 +Node: A Shared Library50005 +Node: Program variables51855 +Node: Yacc and Lex53164 +Node: C++ Support57209 +Node: Fortran 77 Support57985 +Ref: Fortran 77 Support-Footnote-159464 +Node: Preprocessing Fortran 7759667 +Node: Compiling Fortran 77 Files60259 +Node: Mixing Fortran 77 With C and C++60820 +Ref: Mixing Fortran 77 With C and C++-Footnote-163184 +Node: How the Linker is Chosen63487 +Node: Fortran 77 and Autoconf66035 +Node: Support for Other Languages66450 +Node: ANSI66861 +Node: Dependencies69293 +Node: Other objects71775 +Node: Scripts72366 +Node: Headers73214 +Node: Data73877 +Node: Sources74441 +Node: Other GNU Tools75167 +Node: Emacs Lisp75654 +Node: gettext76711 +Node: Guile77357 +Node: Libtool77906 +Node: Java78152 +Node: Documentation78811 +Node: Texinfo79112 +Node: Man pages81443 +Node: Install82811 +Node: Clean85163 +Node: Dist85643 +Node: Tests88125 +Node: Options90171 +Node: Miscellaneous93588 +Node: Tags93920 +Node: Suffixes95240 +Node: Include95865 +Node: Conditionals96306 +Node: Gnits98431 +Node: Cygnus100133 +Node: Extending101532 +Node: Distributing103186 +Node: Future103700 +Node: Macro and Variable Index104430 +Node: General Index112701 + +End Tag Table diff --git a/automake.info-1 b/automake.info-1 new file mode 100644 index 0000000..9cbea72 --- /dev/null +++ b/automake.info-1 @@ -0,0 +1,1268 @@ +This is automake.info, produced by makeinfo version 4.1 from +automake.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* automake: (automake). Making Makefile.in's +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 +END-INFO-DIR-ENTRY + + This file documents GNU automake 1.4-p6 + + Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: automake.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +GNU Automake +************ + + This file documents the GNU Automake package for creating GNU +Standards-compliant Makefiles from template files. This edition +documents version 1.4-p6. + +* Menu: + +* Introduction:: Automake's purpose +* Generalities:: General ideas +* Examples:: Some example packages +* Invoking Automake:: Creating a Makefile.in +* configure:: Scanning configure.in +* Top level:: The top-level Makefile.am +* Programs:: Building programs and libraries +* Other objects:: Other derived objects +* Other GNU Tools:: Other GNU Tools +* Documentation:: Building documentation +* Install:: What gets installed +* Clean:: What gets cleaned +* Dist:: What goes in a distribution +* Tests:: Support for test suites +* Options:: Changing Automake's behavior +* Miscellaneous:: Miscellaneous rules +* Include:: Including extra files in an Automake template. +* Conditionals:: Conditionals +* Gnits:: The effect of `--gnu' and `--gnits' +* Cygnus:: The effect of `--cygnus' +* Extending:: Extending Automake +* Distributing:: Distributing the Makefile.in +* Future:: Some ideas for the future +* Macro and Variable Index:: +* General Index:: + + +File: automake.info, Node: Introduction, Next: Generalities, Prev: Top, Up: Top + +Introduction +************ + + Automake is a tool for automatically generating `Makefile.in's from +files called `Makefile.am'. Each `Makefile.am' is basically a series +of `make' macro definitions (with rules being thrown in occasionally). +The generated `Makefile.in's are compliant with the GNU Makefile +standards. + + The GNU Makefile Standards Document (*note Makefile Conventions: +(standards)Makefile Conventions.) is long, complicated, and subject to +change. The goal of Automake is to remove the burden of Makefile +maintenance from the back of the individual GNU maintainer (and put it +on the back of the Automake maintainer). + + The typical Automake input file is simply a series of macro +definitions. Each such file is processed to create a `Makefile.in'. +There should generally be one `Makefile.am' per directory of a project. + + Automake does constrain a project in certain ways; for instance it +assumes that the project uses Autoconf (*note Introduction: +(autoconf)Top.), and enforces certain restrictions on the +`configure.in' contents. + + Automake requires `perl' in order to generate the `Makefile.in's. +However, the distributions created by Automake are fully GNU +standards-compliant, and do not require `perl' in order to be built. + + Mail suggestions and bug reports for Automake to +. + + +File: automake.info, Node: Generalities, Next: Examples, Prev: Introduction, Up: Top + +General ideas +************* + + The following sections cover a few basic ideas that will help you +understand how Automake works. + +* Menu: + +* General Operation:: General operation of Automake +* Depth:: The kinds of packages +* Strictness:: Standards conformance checking +* Uniform:: The Uniform Naming Scheme +* Canonicalization:: How derived variables are named + + +File: automake.info, Node: General Operation, Next: Depth, Prev: Generalities, Up: Generalities + +General Operation +================= + + Automake works by reading a `Makefile.am' and generating a +`Makefile.in'. Certain macros and targets defined in the `Makefile.am' +instruct Automake to generate more specialized code; for instance, a +`bin_PROGRAMS' macro definition will cause targets for compiling and +linking programs to be generated. + + The macro definitions and targets in the `Makefile.am' are copied +verbatim into the generated file. This allows you to add arbitrary code +into the generated `Makefile.in'. For instance the Automake +distribution includes a non-standard `cvs-dist' target, which the +Automake maintainer uses to make distributions from his source control +system. + + Note that GNU make extensions are not recognized by Automake. Using +such extensions in a `Makefile.am' will lead to errors or confusing +behavior. + + Automake tries to group comments with adjoining targets and macro +definitions in an intelligent way. + + A target defined in `Makefile.am' generally overrides any such +target of a similar name that would be automatically generated by +`automake'. Although this is a supported feature, it is generally best +to avoid making use of it, as sometimes the generated rules are very +particular. + + Similarly, a macro defined in `Makefile.am' will override any +definition of the macro that `automake' would ordinarily create. This +feature is more often useful than the ability to override a target +definition. Be warned that many of the macros generated by `automake' +are considered to be for internal use only, and their names might +change in future releases. + + When examining a macro definition, Automake will recursively examine +macros referenced in the definition. For example, if Automake is +looking at the content of `foo_SOURCES' in this snippet + + xs = a.c b.c + foo_SOURCES = c.c $(xs) + + it would use the files `a.c', `b.c', and `c.c' as the contents of +`foo_SOURCES'. + + Automake also allows a form of comment which is _not_ copied into +the output; all lines beginning with `##' are completely ignored by +Automake. + + It is customary to make the first line of `Makefile.am' read: + + ## Process this file with automake to produce Makefile.in + + +File: automake.info, Node: Depth, Next: Strictness, Prev: General Operation, Up: Generalities + +Depth +===== + + `automake' supports three kinds of directory hierarchy: `flat', +`shallow', and `deep'. + + A "flat" package is one in which all the files are in a single +directory. The `Makefile.am' for such a package by definition lacks a +`SUBDIRS' macro. An example of such a package is `termutils'. + + A "deep" package is one in which all the source lies in +subdirectories; the top level directory contains mainly configuration +information. GNU `cpio' is a good example of such a package, as is GNU +`tar'. The top level `Makefile.am' for a deep package will contain a +`SUBDIRS' macro, but no other macros to define objects which are built. + + A "shallow" package is one in which the primary source resides in +the top-level directory, while various parts (typically libraries) +reside in subdirectories. Automake is one such package (as is GNU +`make', which does not currently use `automake'). + + +File: automake.info, Node: Strictness, Next: Uniform, Prev: Depth, Up: Generalities + +Strictness +========== + + While Automake is intended to be used by maintainers of GNU +packages, it does make some effort to accommodate those who wish to use +it, but do not want to use all the GNU conventions. + + To this end, Automake supports three levels of "strictness"--the +strictness indicating how stringently Automake should check standards +conformance. + + The valid strictness levels are: + +`foreign' + Automake will check for only those things which are absolutely + required for proper operations. For instance, whereas GNU + standards dictate the existence of a `NEWS' file, it will not be + required in this mode. The name comes from the fact that Automake + is intended to be used for GNU programs; these relaxed rules are + not the standard mode of operation. + +`gnu' + Automake will check--as much as possible--for compliance to the GNU + standards for packages. This is the default. + +`gnits' + Automake will check for compliance to the as-yet-unwritten "Gnits + standards". These are based on the GNU standards, but are even + more detailed. Unless you are a Gnits standards contributor, it is + recommended that you avoid this option until such time as the Gnits + standard is actually published. + + For more information on the precise implications of the strictness +level, see *Note Gnits::. + + +File: automake.info, Node: Uniform, Next: Canonicalization, Prev: Strictness, Up: Generalities + +The Uniform Naming Scheme +========================= + + Automake macros (from here on referred to as _variables_) generally +follow a "uniform naming scheme" that makes it easy to decide how +programs (and other derived objects) are built, and how they are +installed. This scheme also supports `configure' time determination of +what should be built. + + At `make' time, certain variables are used to determine which +objects are to be built. These variables are called "primary +variables". For instance, the primary variable `PROGRAMS' holds a list +of programs which are to be compiled and linked. + + A different set of variables is used to decide where the built +objects should be installed. These variables are named after the +primary variables, but have a prefix indicating which standard +directory should be used as the installation directory. The standard +directory names are given in the GNU standards (*note Directory +Variables: (standards)Directory Variables.). Automake extends this +list with `pkglibdir', `pkgincludedir', and `pkgdatadir'; these are the +same as the non-`pkg' versions, but with `@PACKAGE@' appended. For +instance, `pkglibdir' is defined as `$(datadir)/@PACKAGE@'. + + For each primary, there is one additional variable named by +prepending `EXTRA_' to the primary name. This variable is used to list +objects which may or may not be built, depending on what `configure' +decides. This variable is required because Automake must statically +know the entire list of objects that may be built in order to generate +a `Makefile.in' that will work in all cases. + + For instance, `cpio' decides at configure time which programs are +built. Some of the programs are installed in `bindir', and some are +installed in `sbindir': + + EXTRA_PROGRAMS = mt rmt + bin_PROGRAMS = cpio pax + sbin_PROGRAMS = @PROGRAMS@ + + Defining a primary variable without a prefix (e.g. `PROGRAMS') is an +error. + + Note that the common `dir' suffix is left off when constructing the +variable names; thus one writes `bin_PROGRAMS' and not +`bindir_PROGRAMS'. + + Not every sort of object can be installed in every directory. +Automake will flag those attempts it finds in error. Automake will +also diagnose obvious misspellings in directory names. + + Sometimes the standard directories--even as augmented by Automake-- +are not enough. In particular it is sometimes useful, for clarity, to +install objects in a subdirectory of some predefined directory. To this +end, Automake allows you to extend the list of possible installation +directories. A given prefix (e.g. `zar') is valid if a variable of the +same name with `dir' appended is defined (e.g. `zardir'). + + For instance, until HTML support is part of Automake, you could use +this to install raw HTML documentation: + + htmldir = $(prefix)/html + html_DATA = automake.html + + The special prefix `noinst' indicates that the objects in question +should not be installed at all. + + The special prefix `check' indicates that the objects in question +should not be built until the `make check' command is run. + + Possible primary names are `PROGRAMS', `LIBRARIES', `LISP', +`SCRIPTS', `DATA', `HEADERS', `MANS', and `TEXINFOS'. + + +File: automake.info, Node: Canonicalization, Prev: Uniform, Up: Generalities + +How derived variables are named +=============================== + + Sometimes a Makefile variable name is derived from some text the user +supplies. For instance, program names are rewritten into Makefile macro +names. Automake canonicalizes this text, so that it does not have to +follow Makefile macro naming rules. All characters in the name except +for letters, numbers, and the underscore are turned into underscores +when making macro references. For example, if your program is named +`sniff-glue', the derived variable name would be `sniff_glue_SOURCES', +not `sniff-glue_SOURCES'. + + +File: automake.info, Node: Examples, Next: Invoking Automake, Prev: Generalities, Up: Top + +Some example packages +********************* + +* Menu: + +* Complete:: A simple example, start to finish +* Hello:: A classic program +* etags:: Building etags and ctags + + +File: automake.info, Node: Complete, Next: Hello, Prev: Examples, Up: Examples + +A simple example, start to finish +================================= + + Let's suppose you just finished writing `zardoz', a program to make +your head float from vortex to vortex. You've been using Autoconf to +provide a portability framework, but your `Makefile.in's have been +ad-hoc. You want to make them bulletproof, so you turn to Automake. + + The first step is to update your `configure.in' to include the +commands that `automake' needs. The simplest way to do this is to add +an `AM_INIT_AUTOMAKE' call just after `AC_INIT': + + AM_INIT_AUTOMAKE(zardoz, 1.0) + + Since your program doesn't have any complicating factors (e.g., it +doesn't use `gettext', it doesn't want to build a shared library), +you're done with this part. That was easy! + + Now you must regenerate `configure'. But to do that, you'll need to +tell `autoconf' how to find the new macro you've used. The easiest way +to do this is to use the `aclocal' program to generate your +`aclocal.m4' for you. But wait... you already have an `aclocal.m4', +because you had to write some hairy macros for your program. The +`aclocal' program lets you put your own macros into `acinclude.m4', so +simply rename and then run: + + mv aclocal.m4 acinclude.m4 + aclocal + autoconf + + Now it is time to write your `Makefile.am' for `zardoz'. Since +`zardoz' is a user program, you want to install it where the rest of +the user programs go. Additionally, `zardoz' has some Texinfo +documentation. Your `configure.in' script uses `AC_REPLACE_FUNCS', so +you need to link against `@LIBOBJS@'. So here's what you'd write: + + bin_PROGRAMS = zardoz + zardoz_SOURCES = main.c head.c float.c vortex9.c gun.c + zardoz_LDADD = @LIBOBJS@ + + info_TEXINFOS = zardoz.texi + + Now you can run `automake --add-missing' to generate your +`Makefile.in' and grab any auxiliary files you might need, and you're +done! + + +File: automake.info, Node: Hello, Next: etags, Prev: Complete, Up: Examples + +A classic program +================= + + GNU hello (ftp://prep.ai.mit.edu/pub/gnu/hello-1.3.tar.gz) is +renowned for its classic simplicity and versatility. This section shows +how Automake could be used with the GNU Hello package. The examples +below are from the latest beta version of GNU Hello, but with all of the +maintainer-only code stripped out, as well as all copyright comments. + + Of course, GNU Hello is somewhat more featureful than your +traditional two-liner. GNU Hello is internationalized, does option +processing, and has a manual and a test suite. GNU Hello is a deep +package. + + Here is the `configure.in' from GNU Hello: + + dnl Process this file with autoconf to produce a configure script. + AC_INIT(src/hello.c) + AM_INIT_AUTOMAKE(hello, 1.3.11) + AM_CONFIG_HEADER(config.h) + + dnl Set of available languages. + ALL_LINGUAS="de fr es ko nl no pl pt sl sv" + + dnl Checks for programs. + AC_PROG_CC + AC_ISC_POSIX + + dnl Checks for libraries. + + dnl Checks for header files. + AC_STDC_HEADERS + AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h) + + dnl Checks for library functions. + AC_FUNC_ALLOCA + + dnl Check for st_blksize in struct stat + AC_ST_BLKSIZE + + dnl internationalization macros + AM_GNU_GETTEXT + AC_OUTPUT([Makefile doc/Makefile intl/Makefile po/Makefile.in \ + src/Makefile tests/Makefile tests/hello], + [chmod +x tests/hello]) + + The `AM_' macros are provided by Automake (or the Gettext library); +the rest are standard Autoconf macros. + + The top-level `Makefile.am': + + EXTRA_DIST = BUGS ChangeLog.O + SUBDIRS = doc intl po src tests + + As you can see, all the work here is really done in subdirectories. + + The `po' and `intl' directories are automatically generated using +`gettextize'; they will not be discussed here. + + In `doc/Makefile.am' we see: + + info_TEXINFOS = hello.texi + hello_TEXINFOS = gpl.texi + + This is sufficient to build, install, and distribute the GNU Hello +manual. + + Here is `tests/Makefile.am': + + TESTS = hello + EXTRA_DIST = hello.in testdata + + The script `hello' is generated by `configure', and is the only test +case. `make check' will run this test. + + Last we have `src/Makefile.am', where all the real work is done: + + bin_PROGRAMS = hello + hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h + hello_LDADD = @INTLLIBS@ @ALLOCA@ + localedir = $(datadir)/locale + INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\" + + +File: automake.info, Node: etags, Prev: Hello, Up: Examples + +Building etags and ctags +======================== + + Here is another, trickier example. It shows how to generate two +programs (`ctags' and `etags') from the same source file (`etags.c'). +The difficult part is that each compilation of `etags.c' requires +different `cpp' flags. + + bin_PROGRAMS = etags ctags + ctags_SOURCES = + ctags_LDADD = ctags.o + + etags.o: etags.c + $(COMPILE) -DETAGS_REGEXPS -c etags.c + + ctags.o: etags.c + $(COMPILE) -DCTAGS -o ctags.o -c etags.c + + Note that `ctags_SOURCES' is defined to be empty--that way no +implicit value is substituted. The implicit value, however, is used to +generate `etags' from `etags.o'. + + `ctags_LDADD' is used to get `ctags.o' into the link line. +`ctags_DEPENDENCIES' is generated by Automake. + + The above rules won't work if your compiler doesn't accept both `-c' +and `-o'. The simplest fix for this is to introduce a bogus dependency +(to avoid problems with a parallel `make'): + + etags.o: etags.c ctags.o + $(COMPILE) -DETAGS_REGEXPS -c etags.c + + ctags.o: etags.c + $(COMPILE) -DCTAGS -c etags.c && mv etags.o ctags.o + + Also, these explicit rules do not work if the de-ANSI-fication +feature is used (*note ANSI::). Supporting de-ANSI-fication requires a +little more work: + + etags._o: etags._c ctags.o + $(COMPILE) -DETAGS_REGEXPS -c etags.c + + ctags._o: etags._c + $(COMPILE) -DCTAGS -c etags.c && mv etags._o ctags.o + + +File: automake.info, Node: Invoking Automake, Next: configure, Prev: Examples, Up: Top + +Creating a `Makefile.in' +************************ + + To create all the `Makefile.in's for a package, run the `automake' +program in the top level directory, with no arguments. `automake' will +automatically find each appropriate `Makefile.am' (by scanning +`configure.in'; *note configure::) and generate the corresponding +`Makefile.in'. Note that `automake' has a rather simplistic view of +what constitutes a package; it assumes that a package has only one +`configure.in', at the top. If your package has multiple +`configure.in's, then you must run `automake' in each directory holding +a `configure.in'. + + You can optionally give `automake' an argument; `.am' is appended to +the argument and the result is used as the name of the input file. +This feature is generally only used to automatically rebuild an +out-of-date `Makefile.in'. Note that `automake' must always be run +from the topmost directory of a project, even if being used to +regenerate the `Makefile.in' in some subdirectory. This is necessary +because `automake' must scan `configure.in', and because `automake' +uses the knowledge that a `Makefile.in' is in a subdirectory to change +its behavior in some cases. + + `automake' accepts the following options: + +`-a' +`--add-missing' + Automake requires certain common files to exist in certain + situations; for instance `config.guess' is required if + `configure.in' runs `AC_CANONICAL_HOST'. Automake is distributed + with several of these files; this option will cause the missing + ones to be automatically added to the package, whenever possible. + In general if Automake tells you a file is missing, try using this + option. By default Automake tries to make a symbolic link + pointing to its own copy of the missing file; this can be changed + with `--copy'. + +`--amdir=DIR' + Look for Automake data files in directory DIR instead of in the + installation directory. This is typically used for debugging. + +`--build-dir=DIR' + Tell Automake where the build directory is. This option is used + when including dependencies into a `Makefile.in' generated by `make + dist'; it should not be used otherwise. + +`-c' + +`--copy' + When used with `--add-missing', causes installed files to be + copied. The default is to make a symbolic link. + +`--cygnus' + Causes the generated `Makefile.in's to follow Cygnus rules, instead + of GNU or Gnits rules. For more information, see *Note Cygnus::. + +`--foreign' + Set the global strictness to `foreign'. For more information, see + *Note Strictness::. + +`--gnits' + Set the global strictness to `gnits'. For more information, see + *Note Gnits::. + +`--gnu' + Set the global strictness to `gnu'. For more information, see + *Note Gnits::. This is the default strictness. + +`--help' + Print a summary of the command line options and exit. + +`-i' +`--include-deps' + Include all automatically generated dependency information (*note + Dependencies::) in the generated `Makefile.in'. This is generally + done when making a distribution; see *Note Dist::. + +`--generate-deps' + Generate a file concatenating all automatically generated + dependency information (*note Dependencies::) into one file, + `.dep_segment'. This is generally done when making a + distribution; see *Note Dist::. It is useful when maintaining a + `SMakefile' or makefiles for other platforms (`Makefile.DOS', + etc.) It can only be used in conjunction with `--include-deps', + `--srcdir-name', and `--build-dir'. Note that if this option is + given, no other processing is done. + +`--no-force' + Ordinarily `automake' creates all `Makefile.in's mentioned in + `configure.in'. This option causes it to only update those + `Makefile.in's which are out of date with respect to one of their + dependents. + +`-o DIR' +`--output-dir=DIR' + Put the generated `Makefile.in' in the directory DIR. Ordinarily + each `Makefile.in' is created in the directory of the + corresponding `Makefile.am'. This option is used when making + distributions. + +`--srcdir-name=DIR' + Tell Automake the name of the source directory associated with the + current build. This option is used when including dependencies + into a `Makefile.in' generated by `make dist'; it should not be + used otherwise. + +`-v' +`--verbose' + Cause Automake to print information about which files are being + read or created. + +`--version' + Print the version number of Automake and exit. + + +File: automake.info, Node: configure, Next: Top level, Prev: Invoking Automake, Up: Top + +Scanning `configure.in' +*********************** + + Automake scans the package's `configure.in' to determine certain +information about the package. Some `autoconf' macros are required and +some variables must be defined in `configure.in'. Automake will also +use information from `configure.in' to further tailor its output. + + Automake also supplies some Autoconf macros to make the maintenance +easier. These macros can automatically be put into your `aclocal.m4' +using the `aclocal' program. + +* Menu: + +* Requirements:: Configuration requirements +* Optional:: Other things Automake recognizes +* Invoking aclocal:: Auto-generating aclocal.m4 +* Macros:: Autoconf macros supplied with Automake +* Extending aclocal:: Writing your own aclocal macros + + +File: automake.info, Node: Requirements, Next: Optional, Prev: configure, Up: configure + +Configuration requirements +========================== + + The simplest way to meet the basic Automake requirements is to use +the macro `AM_INIT_AUTOMAKE' (*note Macros::). But if you prefer, you +can do the required steps by hand: + + * Define the variables `PACKAGE' and `VERSION' with `AC_SUBST'. + `PACKAGE' should be the name of the package as it appears when + bundled for distribution. For instance, Automake defines `PACKAGE' + to be `automake'. `VERSION' should be the version number of the + release that is being developed. We recommend that you make + `configure.in' the only place in your package where the version + number is defined; this makes releases simpler. + + Automake doesn't do any interpretation of `PACKAGE' or `VERSION', + except in `Gnits' mode (*note Gnits::). + + * Use the macro `AC_ARG_PROGRAM' if a program or script is installed. + *Note Transforming Program Names When Installing: + (autoconf)Transforming Names. + + * Use `AC_PROG_MAKE_SET' if the package is not flat. *Note Creating + Output Files: (autoconf)Output. + + * Use `AM_SANITY_CHECK' to make sure the build environment is sane. + + * Call `AC_PROG_INSTALL' (*note Particular Program Checks: + (autoconf)Particular Programs.). + + * Use `AM_MISSING_PROG' to see whether the programs `aclocal', + `autoconf', `automake', `autoheader', and `makeinfo' are in the + build environment. Here is how this is done: + missing_dir=`cd $ac_aux_dir && pwd` + AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) + AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) + AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) + AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) + AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) + + Here are the other macros which Automake requires but which are not +run by `AM_INIT_AUTOMAKE': + +`AC_OUTPUT' + Automake uses this to determine which files to create (*note + Creating Output Files: (autoconf)Output.). Listed files named + `Makefile' are treated as `Makefile's. Other listed files are + treated differently. Currently the only difference is that a + `Makefile' is removed by `make distclean', while other files are + removed by `make clean'. + + +File: automake.info, Node: Optional, Next: Invoking aclocal, Prev: Requirements, Up: configure + +Other things Automake recognizes +================================ + + Automake will also recognize the use of certain macros and tailor the +generated `Makefile.in' appropriately. Currently recognized macros and +their effects are: + +`AC_CONFIG_HEADER' + Automake requires the use of `AM_CONFIG_HEADER', which is similar + to `AC_CONFIG_HEADER' (*note Configuration Header Files: + (autoconf)Configuration Headers.), but does some useful + Automake-specific work. + +`AC_CONFIG_AUX_DIR' + Automake will look for various helper scripts, such as + `mkinstalldirs', in the directory named in this macro invocation. + If not seen, the scripts are looked for in their `standard' + locations (either the top source directory, or in the source + directory corresponding to the current `Makefile.am', whichever is + appropriate). *Note Finding `configure' Input: (autoconf)Input. + FIXME: give complete list of things looked for in this directory + +`AC_PATH_XTRA' + Automake will insert definitions for the variables defined by + `AC_PATH_XTRA' into each `Makefile.in' that builds a C program or + library. *Note System Services: (autoconf)System Services. + +`AC_CANONICAL_HOST' +`AC_CHECK_TOOL' + Automake will ensure that `config.guess' and `config.sub' exist. + Also, the `Makefile' variables `host_alias' and `host_triplet' are + introduced. See both *Note Getting the Canonical System Type: + (autoconf)Canonicalizing, and *Note Generic Program Checks: + (autoconf)Generic Programs. + +`AC_CANONICAL_SYSTEM' + This is similar to `AC_CANONICAL_HOST', but also defines the + `Makefile' variables `build_alias' and `target_alias'. *Note + Getting the Canonical System Type: (autoconf)Canonicalizing. + +`AC_FUNC_ALLOCA' +`AC_FUNC_GETLOADAVG' +`AC_FUNC_MEMCMP' +`AC_STRUCT_ST_BLOCKS' +`AC_FUNC_FNMATCH' +`AM_FUNC_STRTOD' +`AC_REPLACE_FUNCS' +`AC_REPLACE_GNU_GETOPT' +`AM_WITH_REGEX' + Automake will ensure that the appropriate dependencies are + generated for the objects corresponding to these macros. Also, + Automake will verify that the appropriate source files are part of + the distribution. Note that Automake does not come with any of + the C sources required to use these macros, so `automake -a' will + not install the sources. *Note A Library::, for more information. + Also, see *Note Particular Function Checks: (autoconf)Particular + Functions. + +`LIBOBJS' + Automake will detect statements which put `.o' files into + `LIBOBJS', and will treat these additional files as if they were + discovered via `AC_REPLACE_FUNCS'. *Note Generic Function Checks: + (autoconf)Generic Functions. + +`AC_PROG_RANLIB' + This is required if any libraries are built in the package. *Note + Particular Program Checks: (autoconf)Particular Programs. + +`AC_PROG_CXX' + This is required if any C++ source is included. *Note Particular + Program Checks: (autoconf)Particular Programs. + +`AC_PROG_F77' + This is required if any Fortran 77 source is included. This macro + is distributed with Autoconf version 2.13 and later. *Note + Particular Program Checks: (autoconf)Particular Programs. + +`AC_F77_LIBRARY_LDFLAGS' + This is required for programs and shared libraries that are a + mixture of languages that include Fortran 77 (*note Mixing Fortran + 77 With C and C++::). *Note Autoconf macros supplied with + Automake: Macros. + +`AM_PROG_LIBTOOL' + Automake will turn on processing for `libtool' (*note + Introduction: (libtool)Top.). + +`AC_PROG_YACC' + If a Yacc source file is seen, then you must either use this macro + or define the variable `YACC' in `configure.in'. The former is + preferred (*note Particular Program Checks: (autoconf)Particular + Programs.). + +`AC_DECL_YYTEXT' + This macro is required if there is Lex source in the package. + *Note Particular Program Checks: (autoconf)Particular Programs. + +`AC_PROG_LEX' + If a Lex source file is seen, then this macro must be used. *Note + Particular Program Checks: (autoconf)Particular Programs. + +`ALL_LINGUAS' + If Automake sees that this variable is set in `configure.in', it + will check the `po' directory to ensure that all the named `.po' + files exist, and that all the `.po' files that exist are named. + +`AM_C_PROTOTYPES' + This is required when using automatic de-ANSI-fication; see *Note + ANSI::. + +`AM_GNU_GETTEXT' + This macro is required for packages which use GNU gettext (*note + gettext::). It is distributed with gettext. If Automake sees + this macro it ensures that the package meets some of gettext's + requirements. + +`AM_MAINTAINER_MODE' + This macro adds a `--enable-maintainer-mode' option to + `configure'. If this is used, `automake' will cause + `maintainer-only' rules to be turned off by default in the + generated `Makefile.in's. This macro is disallowed in `Gnits' + mode (*note Gnits::). This macro defines the `MAINTAINER_MODE' + conditional, which you can use in your own `Makefile.am'. + +`AC_SUBST' +`AC_CHECK_TOOL' +`AC_CHECK_PROG' +`AC_CHECK_PROGS' +`AC_PATH_PROG' +`AC_PATH_PROGS' + For each of these macros, the first argument is automatically + defined as a variable in each generated `Makefile.in'. *Note + Setting Output Variables: (autoconf)Setting Output Variables, and + *Note Generic Program Checks: (autoconf)Generic Programs. + + +File: automake.info, Node: Invoking aclocal, Next: Macros, Prev: Optional, Up: configure + +Auto-generating aclocal.m4 +========================== + + Automake includes a number of Autoconf macros which can be used in +your package; some of them are actually required by Automake in certain +situations. These macros must be defined in your `aclocal.m4'; +otherwise they will not be seen by `autoconf'. + + The `aclocal' program will automatically generate `aclocal.m4' files +based on the contents of `configure.in'. This provides a convenient +way to get Automake-provided macros, without having to search around. +Also, the `aclocal' mechanism is extensible for use by other packages. + + At startup, `aclocal' scans all the `.m4' files it can find, looking +for macro definitions. Then it scans `configure.in'. Any mention of +one of the macros found in the first step causes that macro, and any +macros it in turn requires, to be put into `aclocal.m4'. + + The contents of `acinclude.m4', if it exists, are also automatically +included in `aclocal.m4'. This is useful for incorporating local +macros into `configure'. + + `aclocal' accepts the following options: + +`--acdir=DIR' + Look for the macro files in DIR instead of the installation + directory. This is typically used for debugging. + +`--help' + Print a summary of the command line options and exit. + +`-I DIR' + Add the directory DIR to the list of directories searched for + `.m4' files. + +`--output=FILE' + Cause the output to be put into FILE instead of `aclocal.m4'. + +`--print-ac-dir' + Prints the name of the directory which `aclocal' will search to + find the `.m4' files. When this option is given, normal processing + is suppressed. This option can be used by a package to determine + where to install a macro file. + +`--verbose' + Print the names of the files it examines. + +`--version' + Print the version number of Automake and exit. + + +File: automake.info, Node: Macros, Next: Extending aclocal, Prev: Invoking aclocal, Up: configure + +Autoconf macros supplied with Automake +====================================== + +`AM_CONFIG_HEADER' + Automake will generate rules to automatically regenerate the config + header. If you do use this macro, you must create the file + `stamp-h.in' in your source directory. It can be empty. + +`AM_ENABLE_MULTILIB' + This is used when a "multilib" library is being built. A + "multilib" library is one that is built multiple times, once per + target flag combination. This is only useful when the library is + intended to be cross-compiled. The first optional argument is the + name of the `Makefile' being generated; it defaults to `Makefile'. + The second option argument is used to find the top source + directory; it defaults to the empty string (generally this should + not be used unless you are familiar with the internals). + +`AM_FUNC_STRTOD' + If the `strtod' function is not available, or does not work + correctly (like the one on SunOS 5.4), add `strtod.o' to output + variable `LIBOBJS'. + +`AM_FUNC_ERROR_AT_LINE' + If the function `error_at_line' is not found, then add `error.o' + to `LIBOBJS'. + +`AM_FUNC_MKTIME' + Check for a working `mktime' function. If not found, add + `mktime.o' to `LIBOBJS'. + +`AM_FUNC_OBSTACK' + Check for the GNU obstacks code; if not found, add `obstack.o' to + `LIBOBJS'. + +`AM_C_PROTOTYPES' + Check to see if function prototypes are understood by the + compiler. If so, define `PROTOTYPES' and set the output variables + `U' and `ANSI2KNR' to the empty string. Otherwise, set `U' to `_' + and `ANSI2KNR' to `./ansi2knr'. Automake uses these values to + implement automatic de-ANSI-fication. + +`AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL' + If the use of `TIOCGWINSZ' requires `', then define + `GWINSZ_IN_SYS_IOCTL'. Otherwise `TIOCGWINSZ' can be found in + `'. + +`AM_INIT_AUTOMAKE' + Runs many macros that most `configure.in''s need. This macro has + two required arguments, the package and the version number. By + default this macro `AC_DEFINE''s `PACKAGE' and `VERSION'. This + can be avoided by passing in a non-empty third argument. + +`AM_PATH_LISPDIR' + Searches for the program `emacs', and, if found, sets the output + variable `lispdir' to the full path to Emacs' site-lisp directory. + +`AM_PROG_CC_STDC' + If the C compiler in not in ANSI C mode by default, try to add an + option to output variable `CC' to make it so. This macro tries + various options that select ANSI C on some system or another. It + considers the compiler to be in ANSI C mode if it handles function + prototypes correctly. + + If you use this macro, you should check after calling it whether + the C compiler has been set to accept ANSI C; if not, the shell + variable `am_cv_prog_cc_stdc' is set to `no'. If you wrote your + source code in ANSI C, you can make an un-ANSIfied copy of it by + using the `ansi2knr' option (*note ANSI::). + +`AM_PROG_LEX' + Like `AC_PROG_LEX' with `AC_DECL_YYTEXT' (*note Particular Program + Checks: (autoconf)Particular Programs.), but uses the `missing' + script on systems that do not have `lex'. `HP-UX 10' is one such + system. + +`AM_SANITY_CHECK' + This checks to make sure that a file created in the build + directory is newer than a file in the source directory. This can + fail on systems where the clock is set incorrectly. This macro is + automatically run from `AM_INIT_AUTOMAKE'. + +`AM_SYS_POSIX_TERMIOS' + Check to see if POSIX termios headers and functions are available + on the system. If so, set the shell variable + `am_cv_sys_posix_termios' to `yes'. If not, set the variable to + `no'. + +`AM_TYPE_PTRDIFF_T' + Define `HAVE_PTRDIFF_T' if the type `ptrdiff_t' is defined in + `'. + +`AM_WITH_DMALLOC' + Add support for the dmalloc + (ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz) package. If + the user configures with `--with-dmalloc', then define + `WITH_DMALLOC' and add `-ldmalloc' to `LIBS'. + +`AM_WITH_REGEX' + Adds `--with-regex' to the `configure' command line. If specified + (the default), then the `regex' regular expression library is + used, `regex.o' is put into `LIBOBJS', and `WITH_REGEX' is + defined.. If `--without-regex' is given, then the `rx' regular + expression library is used, and `rx.o' is put into `LIBOBJS'. + + +File: automake.info, Node: Extending aclocal, Prev: Macros, Up: configure + +Writing your own aclocal macros +=============================== + + The `aclocal' program doesn't have any built-in knowledge of any +macros, so it is easy to extend it with your own macros. + + This is mostly used for libraries which want to supply their own +Autoconf macros for use by other programs. For instance the `gettext' +library supplies a macro `AM_GNU_GETTEXT' which should be used by any +package using `gettext'. When the library is installed, it installs +this macro so that `aclocal' will find it. + + A file of macros should be a series of `AC_DEFUN''s. The `aclocal' +programs also understands `AC_REQUIRE', so it is safe to put each macro +in a separate file. *Note Prerequisite Macros: (autoconf)Prerequisite +Macros, and *Note Macro Definitions: (autoconf)Macro Definitions. + + A macro file's name should end in `.m4'. Such files should be +installed in `$(datadir)/aclocal'. + + +File: automake.info, Node: Top level, Next: Programs, Prev: configure, Up: Top + +The top-level `Makefile.am' +*************************** + + In non-flat packages, the top level `Makefile.am' must tell Automake +which subdirectories are to be built. This is done via the `SUBDIRS' +variable. + + The `SUBDIRS' macro holds a list of subdirectories in which building +of various sorts can occur. Many targets (e.g. `all') in the generated +`Makefile' will run both locally and in all specified subdirectories. +Note that the directories listed in `SUBDIRS' are not required to +contain `Makefile.am's; only `Makefile's (after configuration). This +allows inclusion of libraries from packages which do not use Automake +(such as `gettext'). The directories mentioned in `SUBDIRS' must be +direct children of the current directory. For instance, you cannot put +`src/subdir' into `SUBDIRS'. + + In a deep package, the top-level `Makefile.am' is often very short. +For instance, here is the `Makefile.am' from the GNU Hello distribution: + + EXTRA_DIST = BUGS ChangeLog.O README-alpha + SUBDIRS = doc intl po src tests + + It is possible to override the `SUBDIRS' variable if, like in the +case of GNU `Inetutils', you want to only build a subset of the entire +package. In your `Makefile.am' include: + + SUBDIRS = @SUBDIRS@ + + Then in your `configure.in' you can specify: + + SUBDIRS = "src doc lib po" + AC_SUBST(SUBDIRS) + + The upshot of this is that Automake is tricked into building the +package to take the subdirs, but doesn't actually bind that list until +`configure' is run. + + Although the `SUBDIRS' macro can contain configure substitutions +(e.g. `@DIRS@'); Automake itself does not actually examine the contents +of this variable. + + If `SUBDIRS' is defined, then your `configure.in' must include +`AC_PROG_MAKE_SET'. + + The use of `SUBDIRS' is not restricted to just the top-level +`Makefile.am'. Automake can be used to construct packages of arbitrary +depth. + + By default, Automake generates `Makefiles' which work depth-first +(`postfix'). However, it is possible to change this ordering. You can +do this by putting `.' into `SUBDIRS'. For instance, putting `.' +first will cause a `prefix' ordering of directories. + + +File: automake.info, Node: Programs, Next: Other objects, Prev: Top level, Up: Top + +Building Programs and Libraries +******************************* + + A large part of Automake's functionality is dedicated to making it +easy to build programs and libraries. + +* Menu: + +* A Program:: Building a program +* A Library:: Building a library +* LIBOBJS:: Special handling for LIBOBJS and ALLOCA +* A Shared Library:: Building a Libtool library +* Program variables:: Variables used when building a program +* Yacc and Lex:: Yacc and Lex support +* C++ Support:: +* Fortran 77 Support:: +* Support for Other Languages:: +* ANSI:: Automatic de-ANSI-fication +* Dependencies:: Automatic dependency tracking + + +File: automake.info, Node: A Program, Next: A Library, Prev: Programs, Up: Programs + +Building a program +================== + + In a directory containing source that gets built into a program (as +opposed to a library), the `PROGRAMS' primary is used. Programs can be +installed in `bindir', `sbindir', `libexecdir', `pkglibdir', or not at +all (`noinst'). + + For instance: + + bin_PROGRAMS = hello + + In this simple case, the resulting `Makefile.in' will contain code +to generate a program named `hello'. The variable `hello_SOURCES' is +used to specify which source files get built into an executable: + + hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h + + This causes each mentioned `.c' file to be compiled into the +corresponding `.o'. Then all are linked to produce `hello'. + + If `PROG_SOURCES' is needed, but not specified, then it defaults to +the single file `prog.c'. + + Multiple programs can be built in a single directory. Multiple +programs can share a single source file, which must be listed in each +`_SOURCES' definition. + + Header files listed in a `_SOURCES' definition will be included in +the distribution but otherwise ignored. In case it isn't obvious, you +should not include the header file generated by `configure' in an +`_SOURCES' variable; this file should not be distributed. Lex (`.l') +and Yacc (`.y') files can also be listed; see *Note Yacc and Lex::. + + Automake must know all the source files that could possibly go into a +program, even if not all the files are built in every circumstance. +Any files which are only conditionally built should be listed in the +appropriate `EXTRA_' variable. For instance, if `hello-linux.c' were +conditionally included in `hello', the `Makefile.am' would contain: + + EXTRA_hello_SOURCES = hello-linux.c + + Similarly, sometimes it is useful to determine the programs that are +to be built at configure time. For instance, GNU `cpio' only builds +`mt' and `rmt' under special circumstances. + + In this case, you must notify Automake of all the programs that can +possibly be built, but at the same time cause the generated +`Makefile.in' to use the programs specified by `configure'. This is +done by having `configure' substitute values into each `_PROGRAMS' +definition, while listing all optionally built programs in +`EXTRA_PROGRAMS'. + + If you need to link against libraries that are not found by +`configure', you can use `LDADD' to do so. This variable actually can +be used to add any options to the linker command line. + + Sometimes, multiple programs are built in one directory but do not +share the same link-time requirements. In this case, you can use the +`PROG_LDADD' variable (where PROG is the name of the program as it +appears in some `_PROGRAMS' variable, and usually written in lowercase) +to override the global `LDADD'. If this variable exists for a given +program, then that program is not linked using `LDADD'. + + For instance, in GNU cpio, `pax', `cpio' and `mt' are linked against +the library `libcpio.a'. However, `rmt' is built in the same +directory, and has no such link requirement. Also, `mt' and `rmt' are +only built on certain architectures. Here is what cpio's +`src/Makefile.am' looks like (abridged): + + bin_PROGRAMS = cpio pax @MT@ + libexec_PROGRAMS = @RMT@ + EXTRA_PROGRAMS = mt rmt + + LDADD = ../lib/libcpio.a @INTLLIBS@ + rmt_LDADD = + + cpio_SOURCES = ... + pax_SOURCES = ... + mt_SOURCES = ... + rmt_SOURCES = ... + + `PROG_LDADD' is inappropriate for passing program-specific linker +flags (except for `-l' and `-L'). So, use the `PROG_LDFLAGS' variable +for this purpose. + + It is also occasionally useful to have a program depend on some other +target which is not actually part of that program. This can be done +using the `PROG_DEPENDENCIES' variable. Each program depends on the +contents of such a variable, but no further interpretation is done. + + If `PROG_DEPENDENCIES' is not supplied, it is computed by Automake. +The automatically-assigned value is the contents of `PROG_LDADD', with +most configure substitutions, `-l', and `-L' options removed. The +configure substitutions that are left in are only `@LIBOBJS@' and +`@ALLOCA@'; these are left because it is known that they will not cause +an invalid value for `PROG_DEPENDENCIES' to be generated. + + +File: automake.info, Node: A Library, Next: LIBOBJS, Prev: A Program, Up: Programs + +Building a library +================== + + Building a library is much like building a program. In this case, +the name of the primary is `LIBRARIES'. Libraries can be installed in +`libdir' or `pkglibdir'. + + *Note A Shared Library::, for information on how to build shared +libraries using Libtool and the `LTLIBRARIES' primary. + + Each `_LIBRARIES' variable is a list of the libraries to be built. +For instance to create a library named `libcpio.a', but not install it, +you would write: + + noinst_LIBRARIES = libcpio.a + + The sources that go into a library are determined exactly as they are +for programs, via the `_SOURCES' variables. Note that the library name +is canonicalized (*note Canonicalization::), so the `_SOURCES' variable +corresponding to `liblob.a' is `liblob_a_SOURCES', not +`liblob.a_SOURCES'. + + Extra objects can be added to a library using the `LIBRARY_LIBADD' +variable. This should be used for objects determined by `configure'. +Again from `cpio': + + libcpio_a_LIBADD = @LIBOBJS@ @ALLOCA@ + + +File: automake.info, Node: LIBOBJS, Next: A Shared Library, Prev: A Library, Up: Programs + +Special handling for LIBOBJS and ALLOCA +======================================= + + Automake explicitly recognizes the use of `@LIBOBJS@' and +`@ALLOCA@', and uses this information, plus the list of `LIBOBJS' files +derived from `configure.in' to automatically include the appropriate +source files in the distribution (*note Dist::). These source files +are also automatically handled in the dependency-tracking scheme; see +*Note Dependencies::. + + `@LIBOBJS@' and `@ALLOCA@' are specially recognized in any `_LDADD' +or `_LIBADD' variable. + diff --git a/automake.info-2 b/automake.info-2 new file mode 100644 index 0000000..b27afcd --- /dev/null +++ b/automake.info-2 @@ -0,0 +1,1262 @@ +This is automake.info, produced by makeinfo version 4.1 from +automake.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* automake: (automake). Making Makefile.in's +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 +END-INFO-DIR-ENTRY + + This file documents GNU automake 1.4-p6 + + Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: automake.info, Node: A Shared Library, Next: Program variables, Prev: LIBOBJS, Up: Programs + +Building a Shared Library +========================= + + Building shared libraries is a relatively complex matter. For this +reason, GNU Libtool (*note Introduction: (libtool)Top.) was created to +help build shared libraries in a platform-independent way. + + Automake uses Libtool to build libraries declared with the +`LTLIBRARIES' primary. Each `_LTLIBRARIES' variable is a list of +shared libraries to build. For instance, to create a library named +`libgettext.a' and its corresponding shared libraries, and install them +in `libdir', write: + + lib_LTLIBRARIES = libgettext.la + + Note that shared libraries _must_ be installed, so +`check_LTLIBRARIES' is not allowed. However, `noinst_LTLIBRARIES' is +allowed. This feature should be used for libtool "convenience +libraries". + + For each library, the `LIBRARY_LIBADD' variable contains the names +of extra libtool objects (`.lo' files) to add to the shared library. +The `LIBRARY_LDFLAGS' variable contains any additional libtool flags, +such as `-version-info' or `-static'. + + Where an ordinary library might include `@LIBOBJS@', a libtool +library must use `@LTLIBOBJS@'. This is required because the object +files that libtool operates on do not necessarily end in `.o'. The +libtool manual contains more details on this topic. + + For libraries installed in some directory, Automake will +automatically supply the appropriate `-rpath' option. However, for +libraries determined at configure time (and thus mentioned in +`EXTRA_LTLIBRARIES'), Automake does not know the eventual installation +directory; for such libraries you must add the `-rpath' option to the +appropriate `_LDFLAGS' variable by hand. + + *Note Using Automake with Libtool: (libtool)Using Automake, for more +information. + + +File: automake.info, Node: Program variables, Next: Yacc and Lex, Prev: A Shared Library, Up: Programs + +Variables used when building a program +====================================== + + Occasionally it is useful to know which `Makefile' variables +Automake uses for compilations; for instance you might need to do your +own compilation in some special cases. + + Some variables are inherited from Autoconf; these are `CC', +`CFLAGS', `CPPFLAGS', `DEFS', `LDFLAGS', and `LIBS'. + + There are some additional variables which Automake itself defines: + +`INCLUDES' + A list of `-I' options. This can be set in your `Makefile.am' if + you have special directories you want to look in. Automake already + provides some `-I' options automatically. In particular it + generates `-I$(srcdir)' and a `-I' pointing to the directory + holding `config.h' (if you've used `AC_CONFIG_HEADER' or + `AM_CONFIG_HEADER'). + + `INCLUDES' can actually be used for other `cpp' options besides + `-I'. For instance, it is sometimes used to pass arbitrary `-D' + options to the compiler. + +`COMPILE' + This is the command used to actually compile a C source file. The + filename is appended to form the complete command line. + +`LINK' + This is the command used to actually link a C program. + + +File: automake.info, Node: Yacc and Lex, Next: C++ Support, Prev: Program variables, Up: Programs + +Yacc and Lex support +==================== + + Automake has somewhat idiosyncratic support for Yacc and Lex. + + Automake assumes that the `.c' file generated by `yacc' (or `lex') +should be named using the basename of the input file. That is, for a +yacc source file `foo.y', Automake will cause the intermediate file to +be named `foo.c' (as opposed to `y.tab.c', which is more traditional). + + The extension of a yacc source file is used to determine the +extension of the resulting `C' or `C++' file. Files with the extension +`.y' will be turned into `.c' files; likewise, `.yy' will become `.cc'; +`.y++', `c++'; and `.yxx', `.cxx'. + + Likewise, lex source files can be used to generate `C' or `C++'; the +extensions `.l', `.ll', `.l++', and `.lxx' are recognized. + + You should never explicitly mention the intermediate (`C' or `C++') +file in any `SOURCES' variable; only list the source file. + + The intermediate files generated by `yacc' (or `lex') will be +included in any distribution that is made. That way the user doesn't +need to have `yacc' or `lex'. + + If a `yacc' source file is seen, then your `configure.in' must +define the variable `YACC'. This is most easily done by invoking the +macro `AC_PROG_YACC' (*note Particular Program Checks: +(autoconf)Particular Programs.). + + Similarly, if a `lex' source file is seen, then your `configure.in' +must define the variable `LEX'. You can use `AC_PROG_LEX' to do this +(*note Particular Program Checks: (autoconf)Particular Programs.). +Automake's `lex' support also requires that you use the `AC_DECL_YYTEXT' +macro--automake needs to know the value of `LEX_OUTPUT_ROOT'. This is +all handled for you if you use the `AM_PROG_LEX' macro (*note Macros::). + + Automake makes it possible to include multiple `yacc' (or `lex') +source files in a single program. Automake uses a small program called +`ylwrap' to run `yacc' (or `lex') in a subdirectory. This is necessary +because yacc's output filename is fixed, and a parallel make could +conceivably invoke more than one instance of `yacc' simultaneously. +The `ylwrap' program is distributed with Automake. It should appear in +the directory specified by `AC_CONFIG_AUX_DIR' (*note Finding +`configure' Input: (autoconf)Input.), or the current directory if that +macro is not used in `configure.in'. + + For `yacc', simply managing locking is insufficient. The output of +`yacc' always uses the same symbol names internally, so it isn't +possible to link two `yacc' parsers into the same executable. + + We recommend using the following renaming hack used in `gdb': + #define yymaxdepth c_maxdepth + #define yyparse c_parse + #define yylex c_lex + #define yyerror c_error + #define yylval c_lval + #define yychar c_char + #define yydebug c_debug + #define yypact c_pact + #define yyr1 c_r1 + #define yyr2 c_r2 + #define yydef c_def + #define yychk c_chk + #define yypgo c_pgo + #define yyact c_act + #define yyexca c_exca + #define yyerrflag c_errflag + #define yynerrs c_nerrs + #define yyps c_ps + #define yypv c_pv + #define yys c_s + #define yy_yys c_yys + #define yystate c_state + #define yytmp c_tmp + #define yyv c_v + #define yy_yyv c_yyv + #define yyval c_val + #define yylloc c_lloc + #define yyreds c_reds + #define yytoks c_toks + #define yylhs c_yylhs + #define yylen c_yylen + #define yydefred c_yydefred + #define yydgoto c_yydgoto + #define yysindex c_yysindex + #define yyrindex c_yyrindex + #define yygindex c_yygindex + #define yytable c_yytable + #define yycheck c_yycheck + #define yyname c_yyname + #define yyrule c_yyrule + + For each define, replace the `c_' prefix with whatever you like. +These defines work for `bison', `byacc', and traditional `yacc's. If +you find a parser generator that uses a symbol not covered here, please +report the new name so it can be added to the list. + + +File: automake.info, Node: C++ Support, Next: Fortran 77 Support, Prev: Yacc and Lex, Up: Programs + +C++ Support +=========== + + Automake includes full support for C++. + + Any package including C++ code must define the output variable `CXX' +in `configure.in'; the simplest way to do this is to use the +`AC_PROG_CXX' macro (*note Particular Program Checks: +(autoconf)Particular Programs.). + + A few additional variables are defined when a C++ source file is +seen: + +`CXX' + The name of the C++ compiler. + +`CXXFLAGS' + Any flags to pass to the C++ compiler. + +`CXXCOMPILE' + The command used to actually compile a C++ source file. The file + name is appended to form the complete command line. + +`CXXLINK' + The command used to actually link a C++ program. + + +File: automake.info, Node: Fortran 77 Support, Next: Support for Other Languages, Prev: C++ Support, Up: Programs + +Fortran 77 Support +================== + + Automake includes full support for Fortran 77. + + Any package including Fortran 77 code must define the output variable +`F77' in `configure.in'; the simplest way to do this is to use the +`AC_PROG_F77' macro (*note Particular Program Checks: +(autoconf)Particular Programs.). *Note Fortran 77 and Autoconf::. + + A few additional variables are defined when a Fortran 77 source file +is seen: + +`F77' + The name of the Fortran 77 compiler. + +`FFLAGS' + Any flags to pass to the Fortran 77 compiler. + +`RFLAGS' + Any flags to pass to the Ratfor compiler. + +`F77COMPILE' + The command used to actually compile a Fortran 77 source file. + The file name is appended to form the complete command line. + +`FLINK' + The command used to actually link a pure Fortran 77 program or + shared library. + + Automake can handle preprocessing Fortran 77 and Ratfor source files +in addition to compiling them(1). Automake also contains some support +for creating programs and shared libraries that are a mixture of +Fortran 77 and other languages (*note Mixing Fortran 77 With C and +C++::). + + These issues are covered in the following sections. + +* Menu: + +* Preprocessing Fortran 77:: +* Compiling Fortran 77 Files:: +* Mixing Fortran 77 With C and C++:: +* Fortran 77 and Autoconf:: + + ---------- Footnotes ---------- + + (1) Much, if not most, of the information in the following sections +pertaining to preprocessing Fortran 77 programs was taken almost +verbatim from *Note Catalogue of Rules: (make)Catalogue of Rules. + + +File: automake.info, Node: Preprocessing Fortran 77, Next: Compiling Fortran 77 Files, Prev: Fortran 77 Support, Up: Fortran 77 Support + +Preprocessing Fortran 77 +------------------------ + + `N.f' is made automatically from `N.F' or `N.r'. This rule runs +just the preprocessor to convert a preprocessable Fortran 77 or Ratfor +source file into a strict Fortran 77 source file. The precise command +used is as follows: + +`.F' + `$(F77) -F $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + $(AM_FFLAGS) $(FFLAGS)' + +`.r' + `$(F77) -F $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)' + + +File: automake.info, Node: Compiling Fortran 77 Files, Next: Mixing Fortran 77 With C and C++, Prev: Preprocessing Fortran 77, Up: Fortran 77 Support + +Compiling Fortran 77 Files +-------------------------- + + `N.o' is made automatically from `N.f', `N.F' or `N.r' by running +the Fortran 77 compiler. The precise command used is as follows: + +`.f' + `$(F77) -c $(AM_FFLAGS) $(FFLAGS)' + +`.F' + `$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + $(AM_FFLAGS) $(FFLAGS)' + +`.r' + `$(F77) -c $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)' + + +File: automake.info, Node: Mixing Fortran 77 With C and C++, Next: Fortran 77 and Autoconf, Prev: Compiling Fortran 77 Files, Up: Fortran 77 Support + +Mixing Fortran 77 With C and C++ +-------------------------------- + + Automake currently provides _limited_ support for creating programs +and shared libraries that are a mixture of Fortran 77 and C and/or C++. +However, there are many other issues related to mixing Fortran 77 with +other languages that are _not_ (currently) handled by Automake, but +that are handled by other packages(1). + + Automake can help in two ways: + + 1. Automatic selection of the linker depending on which combinations + of source code. + + 2. Automatic selection of the appropriate linker flags (e.g. `-L' and + `-l') to pass to the automatically selected linker in order to link + in the appropriate Fortran 77 intrinsic and run-time libraries. + + These extra Fortran 77 linker flags are supplied in the output + variable `FLIBS' by the `AC_F77_LIBRARY_LDFLAGS' Autoconf macro + supplied with newer versions of Autoconf (Autoconf version 2.13 and + later). *Note Fortran 77 Compiler Characteristics: + (autoconf)Fortran 77 Compiler Characteristics. + + If Automake detects that a program or shared library (as mentioned in +some `_PROGRAMS' or `_LTLIBRARIES' primary) contains source code that +is a mixture of Fortran 77 and C and/or C++, then it requires that the +macro `AC_F77_LIBRARY_LDFLAGS' be called in `configure.in', and that +either `$(FLIBS)' or `@FLIBS@' appear in the appropriate `_LDADD' (for +programs) or `_LIBADD' (for shared libraries) variables. It is the +responsibility of the person writing the `Makefile.am' to make sure +that `$(FLIBS)' or `@FLIBS@' appears in the appropriate `_LDADD' or +`_LIBADD' variable. + + For example, consider the following `Makefile.am': + + bin_PROGRAMS = foo + foo_SOURCES = main.cc foo.f + foo_LDADD = libfoo.la @FLIBS@ + + pkglib_LTLIBRARIES = libfoo.la + libfoo_la_SOURCES = bar.f baz.c zardoz.cc + libfoo_la_LIBADD = $(FLIBS) + + In this case, Automake will insist that `AC_F77_LIBRARY_LDFLAGS' is +mentioned in `configure.in'. Also, if `@FLIBS@' hadn't been mentioned +in `foo_LDADD' and `libfoo_la_LIBADD', then Automake would have issued +a warning. + +* Menu: + +* How the Linker is Chosen:: + + ---------- Footnotes ---------- + + (1) For example, the cfortran package +(http://www-zeus.desy.de/~burow/cfortran/) addresses all of these +inter-language issues, and runs under nearly all Fortran 77, C and C++ +compilers on nearly all platforms. However, `cfortran' is not yet Free +Software, but it will be in the next major release. + + +File: automake.info, Node: How the Linker is Chosen, Prev: Mixing Fortran 77 With C and C++, Up: Mixing Fortran 77 With C and C++ + +How the Linker is Chosen +........................ + + The following diagram demonstrates under what conditions a particular +linker is chosen by Automake. + + For example, if Fortran 77, C and C++ source code were to be compiled +into a program, then the C++ linker will be used. In this case, if the +C or Fortran 77 linkers required any special libraries that weren't +included by the C++ linker, then they must be manually added to an +`_LDADD' or `_LIBADD' variable by the user writing the `Makefile.am'. + + \ Linker + source \ + code \ C C++ Fortran + ----------------- +---------+---------+---------+ + | | | | + C | x | | | + | | | | + +---------+---------+---------+ + | | | | + C++ | | x | | + | | | | + +---------+---------+---------+ + | | | | + Fortran | | | x | + | | | | + +---------+---------+---------+ + | | | | + C + C++ | | x | | + | | | | + +---------+---------+---------+ + | | | | + C + Fortran | | | x | + | | | | + +---------+---------+---------+ + | | | | + C++ + Fortran | | x | | + | | | | + +---------+---------+---------+ + | | | | + C + C++ + Fortran | | x | | + | | | | + +---------+---------+---------+ + + +File: automake.info, Node: Fortran 77 and Autoconf, Prev: Mixing Fortran 77 With C and C++, Up: Fortran 77 Support + +Fortran 77 and Autoconf +----------------------- + + The current Automake support for Fortran 77 requires a recent enough +version Autoconf that also includes support for Fortran 77. Full +Fortran 77 support was added to Autoconf 2.13, so you will want to use +that version of Autoconf or later. + + +File: automake.info, Node: Support for Other Languages, Next: ANSI, Prev: Fortran 77 Support, Up: Programs + +Support for Other Languages +=========================== + + Automake currently only includes full support for C, C++ (*note C++ +Support::)and Fortran 77 (*note Fortran 77 Support::). There is only +rudimentary support for other languages, support for which will be +improved based on user demand. + + +File: automake.info, Node: ANSI, Next: Dependencies, Prev: Support for Other Languages, Up: Programs + +Automatic de-ANSI-fication +========================== + + Although the GNU standards allow the use of ANSI C, this can have the +effect of limiting portability of a package to some older compilers +(notably SunOS). + + Automake allows you to work around this problem on such machines by +"de-ANSI-fying" each source file before the actual compilation takes +place. + + If the `Makefile.am' variable `AUTOMAKE_OPTIONS' (*note Options::) +contains the option `ansi2knr' then code to handle de-ANSI-fication is +inserted into the generated `Makefile.in'. + + This causes each C source file in the directory to be treated as +ANSI C. If an ANSI C compiler is available, it is used. If no ANSI C +compiler is available, the `ansi2knr' program is used to convert the +source files into K&R C, which is then compiled. + + The `ansi2knr' program is simple-minded. It assumes the source code +will be formatted in a particular way; see the `ansi2knr' man page for +details. + + Support for de-ANSI-fication requires the source files `ansi2knr.c' +and `ansi2knr.1' to be in the same package as the ANSI C source; these +files are distributed with Automake. Also, the package `configure.in' +must call the macro `AM_C_PROTOTYPES' (*note Macros::). + + Automake also handles finding the `ansi2knr' support files in some +other directory in the current package. This is done by prepending the +relative path to the appropriate directory to the `ansi2knr' option. +For instance, suppose the package has ANSI C code in the `src' and +`lib' subdirs. The files `ansi2knr.c' and `ansi2knr.1' appear in +`lib'. Then this could appear in `src/Makefile.am': + + AUTOMAKE_OPTIONS = ../lib/ansi2knr + + If no directory prefix is given, the files are assumed to be in the +current directory. + + Files mentioned in `LIBOBJS' which need de-ANSI-fication will not be +automatically handled. That's because `configure' will generate an +object name like `regex.o', while `make' will be looking for `regex_.o' +(when de-ANSI-fying). Eventually this problem will be fixed via +`autoconf' magic, but for now you must put this code into your +`configure.in', just before the `AC_OUTPUT' call: + + # This is necessary so that .o files in LIBOBJS are also built via + # the ANSI2KNR-filtering rules. + LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` + + +File: automake.info, Node: Dependencies, Prev: ANSI, Up: Programs + +Automatic dependency tracking +============================= + + As a developer it is often painful to continually update the +`Makefile.in' whenever the include-file dependencies change in a +project. Automake supplies a way to automatically track dependency +changes, and distribute the dependencies in the generated `Makefile.in'. + + Currently this support requires the use of GNU `make' and `gcc'. It +might become possible in the future to supply a different dependency +generating program, if there is enough demand. In the meantime, this +mode is enabled by default if any C program or library is defined in +the current directory, so you may get a `Must be a separator' error +from non-GNU make. + + When you decide to make a distribution, the `dist' target will +re-run `automake' with `--include-deps' and other options. *Note +Invoking Automake::, and *Note Options::. This will cause the +previously generated dependencies to be inserted into the generated +`Makefile.in', and thus into the distribution. This step also turns +off inclusion of the dependency generation code, so that those who +download your distribution but don't use GNU `make' and `gcc' will not +get errors. + + When added to the `Makefile.in', the dependencies have all +system-specific dependencies automatically removed. This can be done by +listing the files in `OMIT_DEPENDENCIES'. For instance all references +to system header files are removed by Automake. Sometimes it is useful +to specify that a certain header file should be removed. For instance +if your `configure.in' uses `AM_WITH_REGEX', then any dependency on +`rx.h' or `regex.h' should be removed, because the correct one cannot +be known until the user configures the package. + + As it turns out, Automake is actually smart enough to handle the +particular case of the regular expression header. It will also +automatically omit `libintl.h' if `AM_GNU_GETTEXT' is used. + + Automatic dependency tracking can be suppressed by putting +`no-dependencies' in the variable `AUTOMAKE_OPTIONS'. + + If you unpack a distribution made by `make dist', and you want to +turn on the dependency-tracking code again, simply re-run `automake'. + + The actual dependency files are put under the build directory, in a +subdirectory named `.deps'. These dependencies are machine specific. +It is safe to delete them if you like; they will be automatically +recreated during the next build. + + +File: automake.info, Node: Other objects, Next: Other GNU Tools, Prev: Programs, Up: Top + +Other Derived Objects +********************* + + Automake can handle derived objects which are not C programs. +Sometimes the support for actually building such objects must be +explicitly supplied, but Automake will still automatically handle +installation and distribution. + +* Menu: + +* Scripts:: Executable scripts +* Headers:: Header files +* Data:: Architecture-independent data files +* Sources:: Derived sources + + +File: automake.info, Node: Scripts, Next: Headers, Prev: Other objects, Up: Other objects + +Executable Scripts +================== + + It is possible to define and install programs which are scripts. +Such programs are listed using the `SCRIPTS' primary name. Automake +doesn't define any dependencies for scripts; the `Makefile.am' should +include the appropriate rules. + + Automake does not assume that scripts are derived objects; such +objects must be deleted by hand (*note Clean::). + + The `automake' program itself is a Perl script that is generated at +configure time from `automake.in'. Here is how this is handled: + + bin_SCRIPTS = automake + + Since `automake' appears in the `AC_OUTPUT' macro, a target for it +is automatically generated. + + Script objects can be installed in `bindir', `sbindir', +`libexecdir', or `pkgdatadir'. + + +File: automake.info, Node: Headers, Next: Data, Prev: Scripts, Up: Other objects + +Header files +============ + + Header files are specified by the `HEADERS' family of variables. +Generally header files are not installed, so the `noinst_HEADERS' +variable will be the most used. + + All header files must be listed somewhere; missing ones will not +appear in the distribution. Often it is clearest to list uninstalled +headers with the rest of the sources for a program. *Note A Program::. +Headers listed in a `_SOURCES' variable need not be listed in any +`_HEADERS' variable. + + Headers can be installed in `includedir', `oldincludedir', or +`pkgincludedir'. + + +File: automake.info, Node: Data, Next: Sources, Prev: Headers, Up: Other objects + +Architecture-independent data files +=================================== + + Automake supports the installation of miscellaneous data files using +the `DATA' family of variables. + + Such data can be installed in the directories `datadir', +`sysconfdir', `sharedstatedir', `localstatedir', or `pkgdatadir'. + + By default, data files are _not_ included in a distribution. + + Here is how Automake installs its auxiliary data files: + + pkgdata_DATA = clean-kr.am clean.am ... + + +File: automake.info, Node: Sources, Prev: Data, Up: Other objects + +Built sources +============= + + Occasionally a file which would otherwise be called `source' (e.g. a +C `.h' file) is actually derived from some other file. Such files +should be listed in the `BUILT_SOURCES' variable. + + Built sources are also not compiled by default. You must explicitly +mention them in some other `_SOURCES' variable for this to happen. + + Note that, in some cases, `BUILT_SOURCES' will work in somewhat +surprising ways. In order to get the built sources to work with +automatic dependency tracking, the `Makefile' must depend on +`$(BUILT_SOURCES)'. This can cause these sources to be rebuilt at what +might seem like funny times. + + +File: automake.info, Node: Other GNU Tools, Next: Documentation, Prev: Other objects, Up: Top + +Other GNU Tools +*************** + + Since Automake is primarily intended to generate `Makefile.in's for +use in GNU programs, it tries hard to interoperate with other GNU tools. + +* Menu: + +* Emacs Lisp:: Emacs Lisp +* gettext:: Gettext +* Guile:: Guile +* Libtool:: Libtool +* Java:: Java + + +File: automake.info, Node: Emacs Lisp, Next: gettext, Prev: Other GNU Tools, Up: Other GNU Tools + +Emacs Lisp +========== + + Automake provides some support for Emacs Lisp. The `LISP' primary +is used to hold a list of `.el' files. Possible prefixes for this +primary are `lisp_' and `noinst_'. Note that if `lisp_LISP' is +defined, then `configure.in' must run `AM_PATH_LISPDIR' (*note +Macros::). + + By default Automake will byte-compile all Emacs Lisp source files +using the Emacs found by `AM_PATH_LISPDIR'. If you wish to avoid +byte-compiling, simply define the variable `ELCFILES' to be empty. +Byte-compiled Emacs Lisp files are not portable among all versions of +Emacs, so it makes sense to turn this off if you expect sites to have +more than one version of Emacs installed. Furthermore, many packages +don't actually benefit from byte-compilation. Still, we recommend that +you leave it enabled by default. It is probably better for sites with +strange setups to cope for themselves than to make the installation less +nice for everybody else. + + +File: automake.info, Node: gettext, Next: Guile, Prev: Emacs Lisp, Up: Other GNU Tools + +Gettext +======= + + If `AM_GNU_GETTEXT' is seen in `configure.in', then Automake turns +on support for GNU gettext, a message catalog system for +internationalization (*note GNU Gettext: (gettext)GNU Gettext.). + + The `gettext' support in Automake requires the addition of two +subdirectories to the package, `intl' and `po'. Automake insures that +these directories exist and are mentioned in `SUBDIRS'. + + Furthermore, Automake checks that the definition of `ALL_LINGUAS' in +`configure.in' corresponds to all the valid `.po' files, and nothing +more. + + +File: automake.info, Node: Guile, Next: Libtool, Prev: gettext, Up: Other GNU Tools + +Guile +===== + + Automake provides some automatic support for writing Guile modules. +Automake will turn on Guile support if the `AM_INIT_GUILE_MODULE' macro +is used in `configure.in'. + + Right now Guile support just means that the `AM_INIT_GUILE_MODULE' +macro is understood to mean: + * `AM_INIT_AUTOMAKE' is run. + + * `AC_CONFIG_AUX_DIR' is run, with a path of `..'. + + As the Guile module code matures, no doubt the Automake support will +grow as well. + + +File: automake.info, Node: Libtool, Next: Java, Prev: Guile, Up: Other GNU Tools + +Libtool +======= + + Automake provides support for GNU Libtool (*note Introduction: +(libtool)Top.) with the `LTLIBRARIES' primary. *Note A Shared +Library::. + + +File: automake.info, Node: Java, Prev: Libtool, Up: Other GNU Tools + +Java +==== + + Automake provides some minimal support for Java compilation with the +`JAVA' primary. + + Any `.java' files listed in a `_JAVA' variable will be compiled with +`JAVAC' at build time. By default, `.class' files are not included in +the distribution. + + Currently Automake enforces the restriction that only one `_JAVA' +primary can be used in a given `Makefile.am'. The reason for this +restriction is that, in general, it isn't possible to know which +`.class' files were generated from which `.java' files - so it would be +impossible to know which files to install where. + + +File: automake.info, Node: Documentation, Next: Install, Prev: Other GNU Tools, Up: Top + +Building documentation +********************** + + Currently Automake provides support for Texinfo and man pages. + +* Menu: + +* Texinfo:: Texinfo +* Man pages:: Man pages + + +File: automake.info, Node: Texinfo, Next: Man pages, Prev: Documentation, Up: Documentation + +Texinfo +======= + + If the current directory contains Texinfo source, you must declare it +with the `TEXINFOS' primary. Generally Texinfo files are converted +into info, and thus the `info_TEXINFOS' macro is most commonly used +here. Note that any Texinfo source file must end in the `.texi' or +`.texinfo' extension. + + If the `.texi' file `@include's `version.texi', then that file will +be automatically generated. The file `version.texi' defines three +Texinfo macros you can reference: `EDITION', `VERSION', and `UPDATED'. +The first two hold the version number of your package (but are kept +separate for clarity); the last is the date the primary file was last +modified. The `version.texi' support requires the `mdate-sh' program; +this program is supplied with Automake and automatically included when +`automake' is invoked with the `--add-missing' option. + + Sometimes an info file actually depends on more than one `.texi' +file. For instance, in GNU Hello, `hello.texi' includes the file +`gpl.texi'. You can tell Automake about these dependencies using the +`TEXI_TEXINFOS' variable. Here is how GNU Hello does it: + + info_TEXINFOS = hello.texi + hello_TEXINFOS = gpl.texi + + By default, Automake requires the file `texinfo.tex' to appear in +the same directory as the Texinfo source. However, if you used +`AC_CONFIG_AUX_DIR' in `configure.in' (*note Finding `configure' Input: +(autoconf)Input.), then `texinfo.tex' is looked for there. Automake +supplies `texinfo.tex' if `--add-missing' is given. + + If your package has Texinfo files in many directories, you can use +the variable `TEXINFO_TEX' to tell Automake where to find the canonical +`texinfo.tex' for your package. The value of this variable should be +the relative path from the current `Makefile.am' to `texinfo.tex': + + TEXINFO_TEX = ../doc/texinfo.tex + + The option `no-texinfo.tex' can be used to eliminate the requirement +for `texinfo.tex'. Use of the variable `TEXINFO_TEX' is preferable, +however, because that allows the `dvi' target to still work. + + Automake generates an `install-info' target; some people apparently +use this. By default, info pages are installed by `make install'. +This can be prevented via the `no-installinfo' option. + + +File: automake.info, Node: Man pages, Prev: Texinfo, Up: Documentation + +Man pages +========= + + A package can also include man pages (but see the GNU standards on +this matter, *Note Man Pages: (standards)Man Pages.) Man pages are +declared using the `MANS' primary. Generally the `man_MANS' macro is +used. Man pages are automatically installed in the correct +subdirectory of `mandir', based on the file extension. They are not +automatically included in the distribution. + + By default, man pages are installed by `make install'. However, +since the GNU project does not require man pages, many maintainers do +not expend effort to keep the man pages up to date. In these cases, the +`no-installman' option will prevent the man pages from being installed +by default. The user can still explicitly install them via `make +install-man'. + + Here is how the documentation is handled in GNU `cpio' (which +includes both Texinfo documentation and man pages): + + info_TEXINFOS = cpio.texi + man_MANS = cpio.1 mt.1 + EXTRA_DIST = $(man_MANS) + + Texinfo source and info pages are all considered to be source for the +purposes of making a distribution. + + Man pages are not currently considered to be source, because it is +not uncommon for man pages to be automatically generated. For the same +reason, they are not automatically included in the distribution. + + +File: automake.info, Node: Install, Next: Clean, Prev: Documentation, Up: Top + +What Gets Installed +******************* + + Naturally, Automake handles the details of actually installing your +program once it has been built. All `PROGRAMS', `SCRIPTS', +`LIBRARIES', `LISP', `DATA' and `HEADERS' are automatically installed +in the appropriate places. + + Automake also handles installing any specified info and man pages. + + Automake generates separate `install-data' and `install-exec' +targets, in case the installer is installing on multiple machines which +share directory structure--these targets allow the machine-independent +parts to be installed only once. The `install' target depends on both +of these targets. + + Automake also generates an `uninstall' target, an `installdirs' +target, and an `install-strip' target. + + It is possible to extend this mechanism by defining an +`install-exec-local' or `install-data-local' target. If these targets +exist, they will be run at `make install' time. + + Variables using the standard directory prefixes `data', `info', +`man', `include', `oldinclude', `pkgdata', or `pkginclude' (e.g. +`data_DATA') are installed by `install-data'. + + Variables using the standard directory prefixes `bin', `sbin', +`libexec', `sysconf', `localstate', `lib', or `pkglib' (e.g. +`bin_PROGRAMS') are installed by `install-exec'. + + Any variable using a user-defined directory prefix with `exec' in +the name (e.g. `myexecbin_PROGRAMS' is installed by `install-exec'. +All other user-defined prefixes are installed by `install-data'. + + Automake generates support for the `DESTDIR' variable in all install +rules. `DESTDIR' is used during the `make install' step to relocate +install objects into a staging area. Each object and path is prefixed +with the value of `DESTDIR' before being copied into the install area. +Here is an example of typical DESTDIR usage: + + make DESTDIR=/tmp/staging install + + This places install objects in a directory tree built under +`/tmp/staging'. If `/gnu/bin/foo' and `/gnu/share/aclocal/foo.m4' are +to be installed, the above command would install +`/tmp/staging/gnu/bin/foo' and `/tmp/staging/gnu/share/aclocal/foo.m4'. + + This feature is commonly used to build install images and packages. +For more information, see *Note Makefile Conventions: +(standards)Makefile Conventions. + + +File: automake.info, Node: Clean, Next: Dist, Prev: Install, Up: Top + +What Gets Cleaned +***************** + + The GNU Makefile Standards specify a number of different clean rules. +Generally the files that can be cleaned are determined automatically by +Automake. Of course, Automake also recognizes some variables that can +be defined to specify additional files to clean. These variables are +`MOSTLYCLEANFILES', `CLEANFILES', `DISTCLEANFILES', and +`MAINTAINERCLEANFILES'. + + +File: automake.info, Node: Dist, Next: Tests, Prev: Clean, Up: Top + +What Goes in a Distribution +*************************** + + The `dist' target in the generated `Makefile.in' can be used to +generate a gzip'd `tar' file for distribution. The tar file is named +based on the `PACKAGE' and `VERSION' variables; more precisely it is +named `PACKAGE-VERSION.tar.gz'. You can use the `make' variable +`GZIP_ENV' to control how gzip is run. The default setting is `--best'. + + For the most part, the files to distribute are automatically found by +Automake: all source files are automatically included in a distribution, +as are all `Makefile.am's and `Makefile.in's. Automake also has a +built-in list of commonly used files which, if present in the current +directory, are automatically included. This list is printed by +`automake --help'. Also, files which are read by `configure' (i.e. the +source files corresponding to the files specified in the `AC_OUTPUT' +invocation) are automatically distributed. + + Still, sometimes there are files which must be distributed, but which +are not covered in the automatic rules. These files should be listed in +the `EXTRA_DIST' variable. You can mention files from subdirectories +in `EXTRA_DIST'. You can also mention a directory there; in this case +the entire directory will be recursively copied into the distribution. + + If you define `SUBDIRS', Automake will recursively include the +subdirectories in the distribution. If `SUBDIRS' is defined +conditionally (*note Conditionals::), Automake will normally include all +directories that could possibly appear in `SUBDIRS' in the +distribution. If you need to specify the set of directories +conditionally, you can set the variable `DIST_SUBDIRS' to the exact +list of subdirectories to include in the distribution. + + Occasionally it is useful to be able to change the distribution +before it is packaged up. If the `dist-hook' target exists, it is run +after the distribution directory is filled, but before the actual tar +(or shar) file is created. One way to use this is for distributing +files in subdirectories for which a new `Makefile.am' is overkill: + + dist-hook: + mkdir $(distdir)/random + cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random + + Automake also generates a `distcheck' target which can be help to +ensure that a given distribution will actually work. `distcheck' makes +a distribution, and then tries to do a `VPATH' build. + + +File: automake.info, Node: Tests, Next: Options, Prev: Dist, Up: Top + +Support for test suites +*********************** + + Automake supports two forms of test suites. + + If the variable `TESTS' is defined, its value is taken to be a list +of programs to run in order to do the testing. The programs can either +be derived objects or source objects; the generated rule will look both +in `srcdir' and `.'. Programs needing data files should look for them +in `srcdir' (which is both an environment variable and a make variable) +so they work when building in a separate directory (*note Build +Directories: (autoconf)Build Directories.), and in particular for the +`distcheck' target (*note Dist::). + + The number of failures will be printed at the end of the run. If a +given test program exits with a status of 77, then its result is ignored +in the final count. This feature allows non-portable tests to be +ignored in environments where they don't make sense. + + The variable `TESTS_ENVIRONMENT' can be used to set environment +variables for the test run; the environment variable `srcdir' is set in +the rule. If all your test programs are scripts, you can also set +`TESTS_ENVIRONMENT' to an invocation of the shell (e.g. `$(SHELL) +-x'); this can be useful for debugging the tests. + + If `dejagnu' (ftp://prep.ai.mit.edu/pub/gnu/dejagnu-1.3.tar.gz) +appears in `AUTOMAKE_OPTIONS', then a `dejagnu'-based test suite is +assumed. The value of the variable `DEJATOOL' is passed as the +`--tool' argument to `runtest'; it defaults to the name of the package. + + The variable `RUNTESTDEFAULTFLAGS' holds the `--tool' and `--srcdir' +flags that are passed to dejagnu by default; this can be overridden if +necessary. + + The variables `EXPECT', `RUNTEST' and `RUNTESTFLAGS' can also be +overridden to provide project-specific values. For instance, you will +need to do this if you are testing a compiler toolchain, because the +default values do not take into account host and target names. + + In either case, the testing is done via `make check'. + + +File: automake.info, Node: Options, Next: Miscellaneous, Prev: Tests, Up: Top + +Changing Automake's Behavior +**************************** + + Various features of Automake can be controlled by options in the +`Makefile.am'. Such options are listed in a special variable named +`AUTOMAKE_OPTIONS'. Currently understood options are: + +`gnits' +`gnu' +`foreign' + +`cygnus' + Set the strictness as appropriate. The `gnits' option also implies + `readme-alpha' and `check-news'. + +`ansi2knr' +`path/ansi2knr' + Turn on automatic de-ANSI-fication. *Note ANSI::. If preceded by + a path, the generated `Makefile.in' will look in the specified + directory to find the `ansi2knr' program. Generally the path + should be a relative path to another directory in the same + distribution (though Automake currently does not check this). + +`check-news' + Cause `make dist' to fail unless the current version number appears + in the first few lines of the `NEWS' file. + +`dejagnu' + Cause `dejagnu'-specific rules to be generated. *Note Tests::. + +`dist-shar' + Generate a `dist-shar' target as well as the ordinary `dist' + target. This new target will create a shar archive of the + distribution. + +`dist-zip' + Generate a `dist-zip' target as well as the ordinary `dist' + target. This new target will create a zip archive of the + distribution. + +`dist-tarZ' + Generate a `dist-tarZ' target as well as the ordinary `dist' + target. This new target will create a compressed tar archive of + the distribution; a traditional `tar' and `compress' will be + assumed. Warning: if you are actually using `GNU tar', then the + generated archive might contain nonportable constructs. + +`no-dependencies' + This is similar to using `--include-deps' on the command line, but + is useful for those situations where you don't have the necessary + bits to make automatic dependency tracking work *Note + Dependencies::. In this case the effect is to effectively disable + automatic dependency tracking. + +`no-installinfo' + The generated `Makefile.in' will not cause info pages to be built + or installed by default. However, `info' and `install-info' + targets will still be available. This option is disallowed at + `GNU' strictness and above. + +`no-installman' + The generated `Makefile.in' will not cause man pages to be + installed by default. However, an `install-man' target will still + be available for optional installation. This option is disallowed + at `GNU' strictness and above. + +`no-texinfo.tex' + Don't require `texinfo.tex', even if there are texinfo files in + this directory. + +`readme-alpha' + If this release is an alpha release, and the file `README-alpha' + exists, then it will be added to the distribution. If this option + is given, version numbers are expected to follow one of two forms. + The first form is `MAJOR.MINOR.ALPHA', where each element is a + number; the final period and number should be left off for + non-alpha releases. The second form is `MAJOR.MINORALPHA', where + ALPHA is a letter; it should be omitted for non-alpha releases. + +VERSION + A version number (e.g. `0.30') can be specified. If Automake is + not newer than the version specified, creation of the `Makefile.in' + will be suppressed. + + Unrecognized options are diagnosed by `automake'. + + +File: automake.info, Node: Miscellaneous, Next: Include, Prev: Options, Up: Top + +Miscellaneous Rules +******************* + + There are a few rules and variables that didn't fit anywhere else. + +* Menu: + +* Tags:: Interfacing to etags and mkid +* Suffixes:: Handling new file extensions + + +File: automake.info, Node: Tags, Next: Suffixes, Prev: Miscellaneous, Up: Miscellaneous + +Interfacing to `etags' +====================== + + Automake will generate rules to generate `TAGS' files for use with +GNU Emacs under some circumstances. + + If any C, C++ or Fortran 77 source code or headers are present, then +`tags' and `TAGS' targets will be generated for the directory. + + At the topmost directory of a multi-directory package, a `tags' +target file will be generated which, when run, will generate a `TAGS' +file that includes by reference all `TAGS' files from subdirectories. + + Also, if the variable `ETAGS_ARGS' is defined, a `tags' target will +be generated. This variable is intended for use in directories which +contain taggable source that `etags' does not understand. + + Here is how Automake generates tags for its source, and for nodes in +its Texinfo file: + + ETAGS_ARGS = automake.in --lang=none \ + --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi + + If you add filenames to `ETAGS_ARGS', you will probably also want to +set `TAGS_DEPENDENCIES'. The contents of this variable are added +directly to the dependencies for the `tags' target. + + Automake will also generate an `ID' target which will run `mkid' on +the source. This is only supported on a directory-by-directory basis. + + +File: automake.info, Node: Suffixes, Prev: Tags, Up: Miscellaneous + +Handling new file extensions +============================ + + It is sometimes useful to introduce a new implicit rule to handle a +file type that Automake does not know about. If this is done, you must +notify GNU Make of the new suffixes. This can be done by putting a list +of new suffixes in the `SUFFIXES' variable. + + For instance, currently Automake does not provide any Java support. +If you wrote a macro to generate `.class' files from `.java' source +files, you would also need to add these suffixes to the list: + + SUFFIXES = .java .class + + +File: automake.info, Node: Include, Next: Conditionals, Prev: Miscellaneous, Up: Top + +Include +******* + + To include another file (perhaps for common rules), the following +syntax is supported: + + include ($(srcdir)|$(top_srcdir))/filename + + Using files in the current directory: + include $(srcdir)/Makefile.extra + + include Makefile.generated + + Using a file in the top level directory: + include $(top_srcdir)/filename + + +File: automake.info, Node: Conditionals, Next: Gnits, Prev: Include, Up: Top + +Conditionals +************ + + Automake supports a simple type of conditionals. + + Before using a conditional, you must define it by using +`AM_CONDITIONAL' in the `configure.in' file (*note Macros::). The +`AM_CONDITIONAL' macro takes two arguments. + + The first argument to `AM_CONDITIONAL' is the name of the +conditional. This should be a simple string starting with a letter and +containing only letters, digits, and underscores. + + The second argument to `AM_CONDITIONAL' is a shell condition, +suitable for use in a shell `if' statement. The condition is evaluated +when `configure' is run. + + Conditionals typically depend upon options which the user provides to +the `configure' script. Here is an example of how to write a +conditional which is true if the user uses the `--enable-debug' option. + + AC_ARG_ENABLE(debug, + [ --enable-debug Turn on debugging], + [case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac],[debug=false]) + AM_CONDITIONAL(DEBUG, test x$debug = xtrue) + + Here is an example of how to use that conditional in `Makefile.am': + + if DEBUG + DBG = debug + else + DBG = + endif + noinst_PROGRAMS = $(DBG) + + This trivial example could also be handled using EXTRA_PROGRAMS +(*note A Program::). + + You may only test a single variable in an `if' statement. The +`else' statement may be omitted. Conditionals may be nested to any +depth. + + Note that conditionals in Automake are not the same as conditionals +in GNU Make. Automake conditionals are checked at configure time by the +`configure' script, and affect the translation from `Makefile.in' to +`Makefile'. They are based on options passed to `configure' and on +results that `configure' has discovered about the host system. GNU +Make conditionals are checked at `make' time, and are based on +variables passed to the make program or defined in the `Makefile'. + + Automake conditionals will work with any make program. + diff --git a/automake.info-3 b/automake.info-3 new file mode 100644 index 0000000..df4355f --- /dev/null +++ b/automake.info-3 @@ -0,0 +1,690 @@ +This is automake.info, produced by makeinfo version 4.1 from +automake.texi. + +INFO-DIR-SECTION GNU admin +START-INFO-DIR-ENTRY +* automake: (automake). Making Makefile.in's +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 +END-INFO-DIR-ENTRY + + This file documents GNU automake 1.4-p6 + + Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions, except that this permission notice may be stated in a +translation approved by the Foundation. + + +File: automake.info, Node: Gnits, Next: Cygnus, Prev: Conditionals, Up: Top + +The effect of `--gnu' and `--gnits' +*********************************** + + The `--gnu' option (or `gnu' in the `AUTOMAKE_OPTIONS' variable) +causes `automake' to check the following: + + * The files `INSTALL', `NEWS', `README', `COPYING', `AUTHORS', and + `ChangeLog' are required at the topmost directory of the package. + + * The options `no-installman' and `no-installinfo' are prohibited. + + Note that this option will be extended in the future to do even more +checking; it is advisable to be familiar with the precise requirements +of the GNU standards. Also, `--gnu' can require certain non-standard +GNU programs to exist for use by various maintainer-only targets; for +instance in the future `pathchk' might be required for `make dist'. + + The `--gnits' option does everything that `--gnu' does, and checks +the following as well: + + * `make dist' will check to make sure the `NEWS' file has been + updated to the current version. + + * The file `COPYING.LIB' is prohibited. The LGPL is apparently + considered a failed experiment. + + * `VERSION' is checked to make sure its format complies with Gnits + standards. + + * If `VERSION' indicates that this is an alpha release, and the file + `README-alpha' appears in the topmost directory of a package, then + it is included in the distribution. This is done in `--gnits' + mode, and no other, because this mode is the only one where version + number formats are constrained, and hence the only mode where + Automake can automatically determine whether `README-alpha' should + be included. + + * The file `THANKS' is required. + + +File: automake.info, Node: Cygnus, Next: Extending, Prev: Gnits, Up: Top + +The effect of `--cygnus' +************************ + + Cygnus Solutions has slightly different rules for how a +`Makefile.in' is to be constructed. Passing `--cygnus' to `automake' +will cause any generated `Makefile.in' to comply with Cygnus rules. + + Here are the precise effects of `--cygnus': + + * Info files are always created in the build directory, and not in + the source directory. + + * `texinfo.tex' is not required if a Texinfo source file is + specified. The assumption is that the file will be supplied, but + in a place that Automake cannot find. This assumption is an + artifact of how Cygnus packages are typically bundled. + + * `make dist' will look for files in the build directory as well as + the source directory. This is required to support putting info + files into the build directory. + + * Certain tools will be searched for in the build tree as well as in + the user's `PATH'. These tools are `runtest', `expect', + `makeinfo' and `texi2dvi'. + + * `--foreign' is implied. + + * The options `no-installinfo' and `no-dependencies' are implied. + + * The macros `AM_MAINTAINER_MODE' and `AM_CYGWIN32' are required. + + * The `check' target doesn't depend on `all'. + + GNU maintainers are advised to use `gnu' strictness in preference to +the special Cygnus mode. + + +File: automake.info, Node: Extending, Next: Distributing, Prev: Cygnus, Up: Top + +When Automake Isn't Enough +************************** + + Automake's implicit copying semantics means that many problems can be +worked around by simply adding some `make' targets and rules to +`Makefile.in'. Automake will ignore these additions. + + There are some caveats to doing this. Although you can overload a +target already used by Automake, it is often inadvisable, particularly +in the topmost directory of a non-flat package. However, various useful +targets have a `-local' version you can specify in your `Makefile.in'. +Automake will supplement the standard target with these user-supplied +targets. + + The targets that support a local version are `all', `info', `dvi', +`check', `install-data', `install-exec', `uninstall', and the various +`clean' targets (`mostlyclean', `clean', `distclean', and +`maintainer-clean'). Note that there are no `uninstall-exec-local' or +`uninstall-data-local' targets; just use `uninstall-local'. It doesn't +make sense to uninstall just data or just executables. + + For instance, here is one way to install a file in `/etc': + + install-data-local: + $(INSTALL_DATA) $(srcdir)/afile /etc/afile + + Some targets also have a way to run another target, called a "hook", +after their work is done. The hook is named after the principal target, +with `-hook' appended. The targets allowing hooks are `install-data', +`install-exec', `dist', and `distcheck'. + + For instance, here is how to create a hard link to an installed +program: + + install-exec-hook: + ln $(bindir)/program $(bindir)/proglink + + +File: automake.info, Node: Distributing, Next: Future, Prev: Extending, Up: Top + +Distributing `Makefile.in's +*************************** + + Automake places no restrictions on the distribution of the resulting +`Makefile.in's. We still encourage software authors to distribute +their work under terms like those of the GPL, but doing so is not +required to use Automake. + + Some of the files that can be automatically installed via the +`--add-missing' switch do fall under the GPL; examine each file to see. + + +File: automake.info, Node: Future, Next: Macro and Variable Index, Prev: Distributing, Up: Top + +Some ideas for the future +************************* + + Here are some things that might happen in the future: + + * HTML support. + + * The output will be cleaned up. For instance, only variables which + are actually used will appear in the generated `Makefile.in'. + + * There will be support for automatically recoding a distribution. + The intent is to allow a maintainer to use whatever character set + is most convenient locally, but for all distributions to be + Unicode or ISO 10646 with the UTF-8 encoding. + + * Rewrite in Guile. This won't happen in the near future, but it + will eventually happen. + + +File: automake.info, Node: Macro and Variable Index, Next: General Index, Prev: Future, Up: Top + +Macro and Variable Index +************************ + +* Menu: + +* _LDADD: A Program. +* _LDFLAGS: A Program. +* _LIBADD: A Library. +* _SOURCES: A Program. +* _TEXINFOS: Texinfo. +* AC_ARG_PROGRAM: Requirements. +* AC_CANONICAL_HOST: Optional. +* AC_CANONICAL_SYSTEM: Optional. +* AC_CHECK_PROG: Optional. +* AC_CHECK_PROGS: Optional. +* AC_CHECK_TOOL: Optional. +* AC_CONFIG_AUX_DIR: Optional. +* AC_CONFIG_HEADER: Optional. +* AC_DECL_YYTEXT: Optional. +* AC_F77_LIBRARY_LDFLAGS: Optional. +* AC_FUNC_ALLOCA: Optional. +* AC_FUNC_FNMATCH: Optional. +* AC_FUNC_GETLOADAVG: Optional. +* AC_FUNC_MEMCMP: Optional. +* AC_OUTPUT: Requirements. +* AC_PATH_PROG: Optional. +* AC_PATH_PROGS: Optional. +* AC_PATH_XTRA: Optional. +* AC_PROG_CXX: Optional. +* AC_PROG_F77: Optional. +* AC_PROG_INSTALL: Requirements. +* AC_PROG_LEX: Optional. +* AC_PROG_MAKE_SET: Requirements. +* AC_PROG_RANLIB: Optional. +* AC_PROG_YACC: Optional. +* AC_REPLACE_FUNCS: Optional. +* AC_REPLACE_GNU_GETOPT: Optional. +* AC_STRUCT_ST_BLOCKS: Optional. +* AC_SUBST: Optional. +* ALL_LINGUAS: Optional. +* AM_C_PROTOTYPES <1>: ANSI. +* AM_C_PROTOTYPES <2>: Macros. +* AM_C_PROTOTYPES: Optional. +* AM_CONDITIONAL: Conditionals. +* AM_CONFIG_HEADER: Macros. +* am_cv_sys_posix_termios: Macros. +* AM_FUNC_ERROR_AT_LINE: Macros. +* AM_FUNC_MKTIME: Macros. +* AM_FUNC_OBSTACK: Macros. +* AM_FUNC_STRTOD <1>: Macros. +* AM_FUNC_STRTOD: Optional. +* AM_GNU_GETTEXT: Optional. +* AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL: Macros. +* AM_INIT_AUTOMAKE: Requirements. +* AM_MAINTAINER_MODE: Optional. +* AM_PATH_LISPDIR: Macros. +* AM_PROG_LIBTOOL: Optional. +* AM_WITH_REGEX: Optional. +* AUTOMAKE_OPTIONS <1>: Options. +* AUTOMAKE_OPTIONS <2>: Dependencies. +* AUTOMAKE_OPTIONS: ANSI. +* bin_PROGRAMS: A Program. +* bin_SCRIPTS: Scripts. +* build_alias: Optional. +* BUILT_SOURCES: Sources. +* check_LTLIBRARIES: A Shared Library. +* CLEANFILES: Clean. +* COMPILE: Program variables. +* CXX: C++ Support. +* CXXCOMPILE: C++ Support. +* CXXFLAGS: C++ Support. +* CXXLINK: C++ Support. +* DATA <1>: Data. +* DATA: Uniform. +* data_DATA: Data. +* DEJATOOL: Tests. +* DESTDIR: Install. +* DIST_SUBDIRS: Dist. +* DISTCLEANFILES: Clean. +* ELCFILES: Emacs Lisp. +* ETAGS_ARGS: Tags. +* EXPECT: Tests. +* EXTRA_DIST: Dist. +* EXTRA_PROGRAMS: A Program. +* F77: Fortran 77 Support. +* F77COMPILE: Fortran 77 Support. +* FFLAGS: Fortran 77 Support. +* FLINK: Fortran 77 Support. +* HAVE_PTRDIFF_T: Macros. +* HEADERS <1>: Headers. +* HEADERS: Uniform. +* host_alias: Optional. +* host_triplet: Optional. +* include_HEADERS: Headers. +* INCLUDES: Program variables. +* info_TEXINFOS: Texinfo. +* LDADD: A Program. +* LDFLAGS: Program variables. +* lib_LIBRARIES: A Library. +* lib_LTLIBRARIES: A Shared Library. +* LIBADD: A Library. +* libexec_PROGRAMS: A Program. +* libexec_SCRIPTS: Scripts. +* LIBOBJS: Optional. +* LIBRARIES: Uniform. +* LINK: Program variables. +* LISP <1>: Emacs Lisp. +* LISP: Uniform. +* lisp_LISP: Emacs Lisp. +* localstate_DATA: Data. +* MAINTAINERCLEANFILES: Clean. +* man_MANS: Man pages. +* MANS <1>: Man pages. +* MANS: Uniform. +* MOSTLYCLEANFILES: Clean. +* noinst_HEADERS: Headers. +* noinst_LIBRARIES: A Library. +* noinst_LISP: Emacs Lisp. +* noinst_LTLIBRARIES: A Shared Library. +* noinst_PROGRAMS: A Program. +* noinst_SCRIPTS: Scripts. +* oldinclude_HEADERS: Headers. +* OMIT_DEPENDENCIES: Dependencies. +* PACKAGE <1>: Dist. +* PACKAGE <2>: Requirements. +* PACKAGE: Uniform. +* pkgdata_DATA: Data. +* pkgdata_SCRIPTS: Scripts. +* pkgdatadir: Uniform. +* pkginclude_HEADERS: Headers. +* pkgincludedir: Uniform. +* pkglib_LIBRARIES: A Library. +* pkglib_LTLIBRARIES: A Shared Library. +* pkglib_PROGRAMS: A Program. +* pkglibdir: Uniform. +* PROGRAMS: Uniform. +* ptrdiff_t: Macros. +* RFLAGS: Fortran 77 Support. +* RUNTEST: Tests. +* RUNTESTDEFAULTFLAGS: Tests. +* RUNTESTFLAGS: Tests. +* sbin_PROGRAMS: A Program. +* sbin_SCRIPTS: Scripts. +* SCRIPTS <1>: Scripts. +* SCRIPTS: Uniform. +* sharedstate_DATA: Data. +* SOURCES: A Program. +* SUBDIRS <1>: Top level. +* SUBDIRS: Depth. +* SUFFIXES: Suffixes. +* sysconf_DATA: Data. +* TAGS_DEPENDENCIES: Tags. +* target_alias: Optional. +* TESTS: Tests. +* TESTS_ENVIRONMENT: Tests. +* TEXINFO_TEX: Texinfo. +* TEXINFOS <1>: Texinfo. +* TEXINFOS: Uniform. +* VERSION <1>: Dist. +* VERSION: Requirements. +* WITH_DMALLOC: Macros. +* WITH_REGEX: Macros. +* YACC: Optional. + + +File: automake.info, Node: General Index, Prev: Macro and Variable Index, Up: Top + +General Index +************* + +* Menu: + +* ## (special Automake comment): General Operation. +* --acdir: Invoking aclocal. +* --add-missing: Invoking Automake. +* --amdir: Invoking Automake. +* --build-dir: Invoking Automake. +* --cygnus: Invoking Automake. +* --enable-maintainer-mode: Optional. +* --foreign: Invoking Automake. +* --generate-deps: Invoking Automake. +* --gnits: Invoking Automake. +* --gnu: Invoking Automake. +* --help <1>: Invoking aclocal. +* --help: Invoking Automake. +* --include-deps: Invoking Automake. +* --no-force: Invoking Automake. +* --output: Invoking aclocal. +* --output-dir: Invoking Automake. +* --print-ac-dir: Invoking aclocal. +* --srcdir-name: Invoking Automake. +* --verbose <1>: Invoking aclocal. +* --verbose: Invoking Automake. +* --version <1>: Invoking aclocal. +* --version: Invoking Automake. +* --with-dmalloc: Macros. +* --with-regex: Macros. +* -a: Invoking Automake. +* -enable-debug, example: Conditionals. +* -gnits, complete description: Gnits. +* -gnu, complete description: Gnits. +* -gnu, required files: Gnits. +* -hook targets: Extending. +* -I: Invoking aclocal. +* -i: Invoking Automake. +* -local targets: Extending. +* -o: Invoking Automake. +* -v: Invoking Automake. +* @ALLOCA@, special handling: LIBOBJS. +* @LIBOBJS@, special handling: LIBOBJS. +* @LTLIBOBJS@, special handling: A Shared Library. +* _DATA primary, defined: Data. +* _DEPENDENCIES, defined: A Program. +* _HEADERS primary, defined: Headers. +* _JAVA primary, defined: Java. +* _LDFLAGS, defined: A Program. +* _LIBADD primary, defined: A Library. +* _LIBRARIES primary, defined: A Library. +* _LISP primary, defined: Emacs Lisp. +* _LTLIBRARIES primary, defined: A Shared Library. +* _MANS primary, defined: Man pages. +* _PROGRAMS primary variable: Uniform. +* _SCRIPTS primary, defined: Scripts. +* _SOURCES and header files: A Program. +* _SOURCES primary, defined: A Program. +* _TEXINFOS primary, defined: Texinfo. +* AC_OUTPUT, scanning: Requirements. +* acinclude.m4, defined: Complete. +* aclocal program, introduction: Complete. +* aclocal, extending: Extending aclocal. +* aclocal, Invoking: Invoking aclocal. +* aclocal.m4, preexisting: Complete. +* Adding new SUFFIXES: Suffixes. +* all: Extending. +* all-local: Extending. +* AM_INIT_AUTOMAKE, example use: Complete. +* ansi2knr: ANSI. +* Automake constraints: Introduction. +* Automake options: Invoking Automake. +* Automake requirements <1>: Requirements. +* Automake requirements: Introduction. +* Automake, invoking: Invoking Automake. +* Automake, recursive operation: General Operation. +* Automatic linker selection: How the Linker is Chosen. +* BUGS, reporting: Introduction. +* BUILT_SOURCES, defined: Sources. +* C++ support: C++ Support. +* canonicalizing Automake macros: Canonicalization. +* cfortran: Mixing Fortran 77 With C and C++. +* check: Extending. +* check primary prefix, definition: Uniform. +* check-local: Extending. +* check_LTLIBRARIES, not allowed: A Shared Library. +* clean-local: Extending. +* Comment, special to Automake: General Operation. +* Complete example: Complete. +* Conditional example, -enable-debug: Conditionals. +* Conditionals: Conditionals. +* config.guess: Invoking Automake. +* configure.in, from GNU Hello: Hello. +* configure.in, scanning: configure. +* Constraints of Automake: Introduction. +* cpio example: Uniform. +* ctags Example: etags. +* cvs-dist: General Operation. +* cvs-dist, non-standard example: General Operation. +* Cygnus strictness: Cygnus. +* DATA primary, defined: Data. +* de-ANSI-fication, defined: ANSI. +* Deep package: Depth. +* dejagnu: Tests. +* dist <1>: Dist. +* dist: Dependencies. +* dist-hook <1>: Extending. +* dist-hook: Dist. +* dist-shar: Options. +* dist-tarZ: Options. +* dist-zip: Options. +* distcheck: Dist. +* distclean-local: Extending. +* dmalloc, support for: Macros. +* dvi: Extending. +* dvi-local: Extending. +* E-mail, bug reports: Introduction. +* EDITION Texinfo macro: Texinfo. +* else: Conditionals. +* endif: Conditionals. +* etags Example: etags. +* Example conditional -enable-debug: Conditionals. +* Example of recursive operation: General Operation. +* Example of shared libraries: A Shared Library. +* Example, ctags and etags: etags. +* Example, EXTRA_PROGRAMS: Uniform. +* Example, GNU Hello: Hello. +* Example, handling Texinfo files: Hello. +* Example, mixed language: Mixing Fortran 77 With C and C++. +* Example, regression test: Hello. +* Exit status 77, special interpretation: Tests. +* Extending aclocal: Extending aclocal. +* Extending list of installation directories: Uniform. +* Extra files distributed with Automake: Invoking Automake. +* EXTRA_, prepending: Uniform. +* EXTRA_prog_SOURCES, defined: A Program. +* EXTRA_PROGRAMS, defined <1>: A Program. +* EXTRA_PROGRAMS, defined: Uniform. +* Files distributed with Automake: Invoking Automake. +* First line of Makefile.am: General Operation. +* Flat package: Depth. +* FLIBS, defined: Mixing Fortran 77 With C and C++. +* foreign strictness: Strictness. +* Fortran 77 support: Fortran 77 Support. +* Fortran 77, mixing with C and C++: Mixing Fortran 77 With C and C++. +* Fortran 77, Preprocessing: Preprocessing Fortran 77. +* Future directions: Future. +* Gettext support: gettext. +* gnits strictness: Strictness. +* GNU Gettext support: gettext. +* GNU Hello, configure.in: Hello. +* GNU Hello, example: Hello. +* GNU make extensions: General Operation. +* GNU Makefile standards: Introduction. +* Guile rewrite: Future. +* Header files in _SOURCES: A Program. +* HEADERS primary, defined: Headers. +* HEADERS, installation directories: Headers. +* Hello example: Hello. +* Hello, configure.in: Hello. +* hook targets: Extending. +* HP-UX 10, lex problems: Macros. +* HTML support, example: Uniform. +* id: Tags. +* if: Conditionals. +* include: Include. +* INCLUDES, example usage: Hello. +* info <1>: Extending. +* info: Options. +* info-local: Extending. +* install: Install. +* install-data <1>: Extending. +* install-data: Install. +* install-data-hook: Extending. +* install-data-local <1>: Extending. +* install-data-local: Install. +* install-exec <1>: Extending. +* install-exec: Install. +* install-exec-hook: Extending. +* install-exec-local <1>: Extending. +* install-exec-local: Install. +* install-info <1>: Options. +* install-info: Texinfo. +* install-info target: Texinfo. +* install-man <1>: Options. +* install-man: Man pages. +* install-man target: Man pages. +* install-strip: Install. +* Installation directories, extending list: Uniform. +* Installation support: Install. +* installdirs: Install. +* Installing headers: Headers. +* Installing scripts: Scripts. +* Invoking aclocal: Invoking aclocal. +* Invoking Automake: Invoking Automake. +* JAVA primary, defined: Java. +* JAVA restrictions: Java. +* lex problems with HP-UX 10: Macros. +* lex, multiple lexers: Yacc and Lex. +* LIBADD primary, defined: A Library. +* LIBRARIES primary, defined: A Library. +* Linking Fortran 77 with C and C++: Mixing Fortran 77 With C and C++. +* LISP primary, defined: Emacs Lisp. +* local targets: Extending. +* LTLIBRARIES primary, defined: A Shared Library. +* Macros Automake recognizes: Optional. +* Macros, overriding: General Operation. +* make check: Tests. +* make clean support: Clean. +* make dist: Dist. +* make distcheck: Dist. +* make install support: Install. +* Make targets, overriding: General Operation. +* Makefile.am, first line: General Operation. +* MANS primary, defined: Man pages. +* mdate-sh: Texinfo. +* Mixed language example: Mixing Fortran 77 With C and C++. +* Mixing Fortran 77 with C and C++: Mixing Fortran 77 With C and C++. +* Mixing Fortran 77 with C and/or C++: Mixing Fortran 77 With C and C++. +* mostlyclean-local: Extending. +* Multiple configure.in files: Invoking Automake. +* Multiple lex lexers: Yacc and Lex. +* Multiple yacc parsers: Yacc and Lex. +* no-dependencies: Dependencies. +* no-installinfo: Texinfo. +* no-installman: Man pages. +* no-texinfo.tex: Texinfo. +* noinst primary prefix, definition: Uniform. +* noinstall-info target: Texinfo. +* noinstall-man target: Man pages. +* Non-GNU packages: Strictness. +* Non-standard targets: General Operation. +* Option, ansi2knr: Options. +* Option, check-news: Options. +* Option, cygnus: Options. +* Option, dejagnu: Options. +* Option, dist-shar: Options. +* Option, dist-tarZ: Options. +* Option, dist-zip: Options. +* Option, foreign: Options. +* Option, gnits: Options. +* Option, gnu: Options. +* Option, no-dependencies: Options. +* Option, no-installinfo: Options. +* Option, no-installman: Options. +* Option, no-texinfo: Options. +* Option, readme-alpha: Options. +* Option, version: Options. +* Options, Automake: Invoking Automake. +* Overriding make macros: General Operation. +* Overriding make targets: General Operation. +* Overriding SUBDIRS: Top level. +* Package, deep: Depth. +* Package, Flat: Depth. +* Package, shallow: Depth. +* pkgdatadir, defined: Uniform. +* pkgincludedir, defined: Uniform. +* pkglibdir, defined: Uniform. +* POSIX termios headers: Macros. +* Preprocessing Fortran 77: Preprocessing Fortran 77. +* Primary variable, DATA: Data. +* Primary variable, defined: Uniform. +* Primary variable, HEADERS: Headers. +* Primary variable, JAVA: Java. +* Primary variable, LIBADD: A Library. +* Primary variable, LIBRARIES: A Library. +* Primary variable, LISP: Emacs Lisp. +* Primary variable, LTLIBRARIES: A Shared Library. +* Primary variable, MANS: Man pages. +* Primary variable, PROGRAMS: Uniform. +* Primary variable, SCRIPTS: Scripts. +* Primary variable, SOURCES: A Program. +* Primary variable, TEXINFOS: Texinfo. +* prog_LDADD, defined: A Program. +* PROGRAMS primary variable: Uniform. +* PROGRAMS, bindir: A Program. +* Ratfor programs: Preprocessing Fortran 77. +* README-alpha: Gnits. +* Recognized macros by Automake: Optional. +* Recursive operation of Automake: General Operation. +* regex package: Macros. +* Regression test example: Hello. +* Reporting BUGS: Introduction. +* Requirements of Automake: Requirements. +* Requirements, Automake: Introduction. +* Restrictions for JAVA: Java. +* rx package: Macros. +* Scanning configure.in: configure. +* SCRIPTS primary, defined: Scripts. +* SCRIPTS, installation directories: Scripts. +* Selecting the linker automatically: How the Linker is Chosen. +* Shallow package: Depth. +* Shared libraries, support for: A Shared Library. +* SOURCES primary, defined: A Program. +* Special Automake comment: General Operation. +* Strictness, defined: Strictness. +* Strictness, foreign: Strictness. +* Strictness, gnits: Strictness. +* Strictness, gnu: Strictness. +* SUBDIRS, deep package: Depth. +* SUBDIRS, explained: Top level. +* SUBDIRS, overriding: Top level. +* suffix .la, defined: A Shared Library. +* suffix .lo, defined: A Shared Library. +* SUFFIXES, adding: Suffixes. +* Support for C++: C++ Support. +* Support for Fortran 77: Fortran 77 Support. +* Support for GNU Gettext: gettext. +* tags: Tags. +* TAGS support: Tags. +* Target, install-info: Texinfo. +* Target, install-man: Man pages. +* Target, noinstall-info: Texinfo. +* Target, noinstall-man: Man pages. +* termios POSIX headers: Macros. +* Test suites: Tests. +* Texinfo file handling example: Hello. +* Texinfo macro, EDITION: Texinfo. +* Texinfo macro, UPDATED: Texinfo. +* Texinfo macro, VERSION: Texinfo. +* texinfo.tex: Texinfo. +* TEXINFOS primary, defined: Texinfo. +* Uniform naming scheme: Uniform. +* uninstall <1>: Extending. +* uninstall: Install. +* uninstall-local: Extending. +* UPDATED Texinfo macro: Texinfo. +* VERSION Texinfo macro: Texinfo. +* yacc, multiple parsers: Yacc and Lex. +* ylwrap: Yacc and Lex. +* zardoz example: Complete. + + diff --git a/automake.texi b/automake.texi new file mode 100644 index 0000000..80008ce --- /dev/null +++ b/automake.texi @@ -0,0 +1,3477 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename automake.info +@settitle automake +@setchapternewpage off +@c %**end of header + +@include version.texi + +@dircategory GNU admin +@direntry +* automake: (automake). Making Makefile.in's +@end direntry + +@dircategory Individual utilities +@direntry +* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 +@end direntry + +@ifinfo +This file documents GNU automake @value{VERSION} + +Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph + + +@end ignore +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + + +@titlepage +@title GNU Automake +@subtitle For version @value{VERSION}, @value{UPDATED} +@author David MacKenzie and Tom Tromey + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1995, 96 Free Software Foundation, Inc. +@sp 2 +This is the first edition of the GNU Automake documentation,@* +and is consistent with GNU Automake @value{VERSION}.@* +@sp 2 +Published by the Free Software Foundation @* +59 Temple Place - Suite 330, @* +Boston, MA 02111-1307 USA @* + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end titlepage + +@c Define an index of configure output variables. +@defcodeindex ov +@c Define an index of configure variables. +@defcodeindex cv +@c Define an index of options. +@defcodeindex op +@c Define an index of targets. +@defcodeindex tr +@c Define an index of commands. +@defcodeindex cm + +@c Put the macros and variables into their own index. +@c @syncodeindex fn cp +@syncodeindex ov vr +@syncodeindex cv vr +@syncodeindex fn vr + +@c Put everything else into one index (arbitrarily chosen to be the concept index). +@syncodeindex op cp +@syncodeindex tr cp +@syncodeindex cm cp + +@ifinfo +@node Top, Introduction, (dir), (dir) +@comment node-name, next, previous, up +@top GNU Automake + +This file documents the GNU Automake package for creating GNU +Standards-compliant Makefiles from template files. This edition +documents version @value{VERSION}. + +@menu +* Introduction:: Automake's purpose +* Generalities:: General ideas +* Examples:: Some example packages +* Invoking Automake:: Creating a Makefile.in +* configure:: Scanning configure.in +* Top level:: The top-level Makefile.am +* Programs:: Building programs and libraries +* Other objects:: Other derived objects +* Other GNU Tools:: Other GNU Tools +* Documentation:: Building documentation +* Install:: What gets installed +* Clean:: What gets cleaned +* Dist:: What goes in a distribution +* Tests:: Support for test suites +* Options:: Changing Automake's behavior +* Miscellaneous:: Miscellaneous rules +* Include:: Including extra files in an Automake template. +* Conditionals:: Conditionals +* Gnits:: The effect of @code{--gnu} and @code{--gnits} +* Cygnus:: The effect of @code{--cygnus} +* Extending:: Extending Automake +* Distributing:: Distributing the Makefile.in +* Future:: Some ideas for the future +* Macro and Variable Index:: +* General Index:: +@end menu + +@end ifinfo + + +@node Introduction, Generalities, Top, Top +@chapter Introduction + +Automake is a tool for automatically generating @file{Makefile.in}s from +files called @file{Makefile.am}. Each @file{Makefile.am} is basically a +series of @code{make} macro definitions (with rules being thrown in +occasionally). The generated @file{Makefile.in}s are compliant with the +GNU Makefile standards. + +@cindex GNU Makefile standards + +The GNU Makefile Standards Document +(@pxref{Makefile Conventions, , , standards, The GNU Coding Standards}) +is long, complicated, and subject to change. The goal of Automake is to +remove the burden of Makefile maintenance from the back of the +individual GNU maintainer (and put it on the back of the Automake +maintainer). + +The typical Automake input file is simply a series of macro definitions. +Each such file is processed to create a @file{Makefile.in}. There +should generally be one @file{Makefile.am} per directory of a project. + +@cindex Constraints of Automake +@cindex Automake constraints + +Automake does constrain a project in certain ways; for instance it +assumes that the project uses Autoconf (@pxref{Top, , Introduction, +autoconf, The Autoconf Manual}), and enforces certain restrictions on +the @file{configure.in} contents. + +@cindex Automake requirements +@cindex Requirements, Automake + +Automake requires @code{perl} in order to generate the +@file{Makefile.in}s. However, the distributions created by Automake are +fully GNU standards-compliant, and do not require @code{perl} in order +to be built. + +@cindex BUGS, reporting +@cindex Reporting BUGS +@cindex E-mail, bug reports + +Mail suggestions and bug reports for Automake to +@email{bug-automake@@gnu.org}. + + +@node Generalities, Examples, Introduction, Top +@chapter General ideas + +The following sections cover a few basic ideas that will help you +understand how Automake works. + +@menu +* General Operation:: General operation of Automake +* Depth:: The kinds of packages +* Strictness:: Standards conformance checking +* Uniform:: The Uniform Naming Scheme +* Canonicalization:: How derived variables are named +@end menu + + +@node General Operation, Depth, Generalities, Generalities +@section General Operation + +Automake works by reading a @file{Makefile.am} and generating a +@file{Makefile.in}. Certain macros and targets defined in the +@file{Makefile.am} instruct Automake to generate more specialized code; +for instance, a @samp{bin_PROGRAMS} macro definition will cause targets +for compiling and linking programs to be generated. + +@cindex Non-standard targets +@cindex cvs-dist, non-standard example +@trindex cvs-dist + +The macro definitions and targets in the @file{Makefile.am} are copied +verbatim into the generated file. This allows you to add arbitrary code +into the generated @file{Makefile.in}. For instance the Automake +distribution includes a non-standard @code{cvs-dist} target, which the +Automake maintainer uses to make distributions from his source control +system. + +@cindex GNU make extensions + +Note that GNU make extensions are not recognized by Automake. Using +such extensions in a @file{Makefile.am} will lead to errors or confusing +behavior. + +Automake tries to group comments with adjoining targets and macro +definitions in an intelligent way. + +@cindex Make targets, overriding +@cindex Overriding make targets + +A target defined in @file{Makefile.am} generally overrides any such +target of a similar name that would be automatically generated by +@code{automake}. Although this is a supported feature, it is generally +best to avoid making use of it, as sometimes the generated rules are +very particular. + +@cindex Macros, overriding +@cindex Overriding make macros + +Similarly, a macro defined in @file{Makefile.am} will override any +definition of the macro that @code{automake} would ordinarily create. +This feature is more often useful than the ability to override a target +definition. Be warned that many of the macros generated by +@code{automake} are considered to be for internal use only, and their +names might change in future releases. + +@cindex Recursive operation of Automake +@cindex Automake, recursive operation +@cindex Example of recursive operation + +When examining a macro definition, Automake will recursively examine +macros referenced in the definition. For example, if Automake is +looking at the content of @code{foo_SOURCES} in this snippet + +@example +xs = a.c b.c +foo_SOURCES = c.c $(xs) +@end example + +it would use the files @file{a.c}, @file{b.c}, and @file{c.c} as the +contents of @code{foo_SOURCES}. + +@cindex ## (special Automake comment) +@cindex Special Automake comment +@cindex Comment, special to Automake + +Automake also allows a form of comment which is @emph{not} copied into +the output; all lines beginning with @samp{##} are completely ignored by +Automake. + +It is customary to make the first line of @file{Makefile.am} read: + +@cindex Makefile.am, first line +@cindex First line of Makefile.am + +@example +## Process this file with automake to produce Makefile.in +@end example + +@c FIXME discuss putting a copyright into Makefile.am here? I would but +@c I don't know quite what to say. + +@c FIXME document customary ordering of Makefile.am here! + + +@node Depth, Strictness, General Operation, Generalities +@section Depth + +@cindex Flat package +@cindex Package, Flat +@cindex Shallow package +@cindex Package, shallow +@cindex Deep package +@cindex Package, deep + +@code{automake} supports three kinds of directory hierarchy: +@samp{flat}, @samp{shallow}, and @samp{deep}. + +A @dfn{flat} package is one in which all the files are in a single +directory. The @file{Makefile.am} for such a package by definition +lacks a @code{SUBDIRS} macro. An example of such a package is +@code{termutils}. +@vindex SUBDIRS + +@cindex SUBDIRS, deep package + +A @dfn{deep} package is one in which all the source lies in +subdirectories; the top level directory contains mainly configuration +information. GNU @code{cpio} is a good example of such a package, as is +GNU @code{tar}. The top level @file{Makefile.am} for a deep package +will contain a @code{SUBDIRS} macro, but no other macros to define +objects which are built. + +A @dfn{shallow} package is one in which the primary source resides in +the top-level directory, while various parts (typically libraries) +reside in subdirectories. Automake is one such package (as is GNU +@code{make}, which does not currently use @code{automake}). + + +@node Strictness, Uniform, Depth, Generalities +@section Strictness + +@cindex Non-GNU packages + +While Automake is intended to be used by maintainers of GNU packages, it +does make some effort to accommodate those who wish to use it, but do +not want to use all the GNU conventions. + +@cindex Strictness, defined +@cindex Strictness, foreign +@cindex foreign strictness +@cindex Strictness, gnu +@cindex gnits strictness +@cindex Strictness, gnits +@cindex gnits strictness + +To this end, Automake supports three levels of @dfn{strictness}---the +strictness indicating how stringently Automake should check standards +conformance. + +The valid strictness levels are: + +@table @samp +@item foreign +Automake will check for only those things which are absolutely +required for proper operations. For instance, whereas GNU standards +dictate the existence of a @file{NEWS} file, it will not be required in +this mode. The name comes from the fact that Automake is intended to be +used for GNU programs; these relaxed rules are not the standard mode of +operation. + +@item gnu +Automake will check---as much as possible---for compliance to the GNU +standards for packages. This is the default. + +@item gnits +Automake will check for compliance to the as-yet-unwritten @dfn{Gnits +standards}. These are based on the GNU standards, but are even more +detailed. Unless you are a Gnits standards contributor, it is +recommended that you avoid this option until such time as the Gnits +standard is actually published. +@end table + +For more information on the precise implications of the strictness +level, see @ref{Gnits}. + + +@node Uniform, Canonicalization, Strictness, Generalities +@section The Uniform Naming Scheme + +@cindex Uniform naming scheme + +Automake macros (from here on referred to as @emph{variables}) generally +follow a @dfn{uniform naming scheme} that makes it easy to decide how +programs (and other derived objects) are built, and how they are +installed. This scheme also supports @code{configure} time +determination of what should be built. + +@cindex _PROGRAMS primary variable +@cindex PROGRAMS primary variable +@cindex Primary variable, PROGRAMS + +@cindex Primary variable, defined + +At @code{make} time, certain variables are used to determine which +objects are to be built. These variables are called @dfn{primary +variables}. For instance, the primary variable @code{PROGRAMS} holds a +list of programs which are to be compiled and linked. +@vindex PROGRAMS + +@cindex pkglibdir, defined +@cindex pkgincludedir, defined +@cindex pkgdatadir, defined + +@vindex pkglibdir +@vindex pkgincludedir +@vindex pkgdatadir + +A different set of variables is used to decide where the built objects +should be installed. These variables are named after the primary +variables, but have a prefix indicating which standard directory should +be used as the installation directory. The standard directory names are +given in the GNU standards (@pxref{Directory Variables, , , standards, +The GNU Coding Standards}). Automake extends this list with +@code{pkglibdir}, @code{pkgincludedir}, and @code{pkgdatadir}; these are +the same as the non-@samp{pkg} versions, but with @samp{@@PACKAGE@@} +appended. For instance, @code{pkglibdir} is defined as +@code{$(datadir)/@@PACKAGE@@}. +@cvindex PACKAGE + +@cindex EXTRA_, prepending + +For each primary, there is one additional variable named by prepending +@samp{EXTRA_} to the primary name. This variable is used to list +objects which may or may not be built, depending on what +@code{configure} decides. This variable is required because Automake +must statically know the entire list of objects that may be built in +order to generate a @file{Makefile.in} that will work in all cases. + +@cindex EXTRA_PROGRAMS, defined +@cindex Example, EXTRA_PROGRAMS +@cindex cpio example + +For instance, @code{cpio} decides at configure time which programs are +built. Some of the programs are installed in @code{bindir}, and some +are installed in @code{sbindir}: + +@example +EXTRA_PROGRAMS = mt rmt +bin_PROGRAMS = cpio pax +sbin_PROGRAMS = @@PROGRAMS@@ +@end example + +Defining a primary variable without a prefix (e.g. @code{PROGRAMS}) is +an error. + +Note that the common @samp{dir} suffix is left off when constructing the +variable names; thus one writes @samp{bin_PROGRAMS} and not +@samp{bindir_PROGRAMS}. + +Not every sort of object can be installed in every directory. Automake +will flag those attempts it finds in error. Automake will also diagnose +obvious misspellings in directory names. + +@cindex Extending list of installation directories +@cindex Installation directories, extending list + +Sometimes the standard directories---even as augmented by Automake--- +are not enough. In particular it is sometimes useful, for clarity, to +install objects in a subdirectory of some predefined directory. To this +end, Automake allows you to extend the list of possible installation +directories. A given prefix (e.g. @samp{zar}) is valid if a variable of +the same name with @samp{dir} appended is defined (e.g. @code{zardir}). + +@cindex HTML support, example + +For instance, until HTML support is part of Automake, you could use this +to install raw HTML documentation: + +@example +htmldir = $(prefix)/html +html_DATA = automake.html +@end example + +@cindex noinst primary prefix, definition + +The special prefix @samp{noinst} indicates that the objects in question +should not be installed at all. + +@cindex check primary prefix, definition + +The special prefix @samp{check} indicates that the objects in question +should not be built until the @code{make check} command is run. + +Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES}, +@samp{LISP}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, +and @samp{TEXINFOS}. +@vindex PROGRAMS +@vindex LIBRARIES +@vindex LISP +@vindex SCRIPTS +@vindex DATA +@vindex HEADERS +@vindex MANS +@vindex TEXINFOS + + +@node Canonicalization, , Uniform, Generalities +@section How derived variables are named + +@cindex canonicalizing Automake macros + +Sometimes a Makefile variable name is derived from some text the user +supplies. For instance, program names are rewritten into Makefile macro +names. Automake canonicalizes this text, so that it does not have to +follow Makefile macro naming rules. All characters in the name except +for letters, numbers, and the underscore are turned into underscores +when making macro references. For example, if your program is named +@code{sniff-glue}, the derived variable name would be +@code{sniff_glue_SOURCES}, not @code{sniff-glue_SOURCES}. + + +@node Examples, Invoking Automake, Generalities, Top +@chapter Some example packages + +@menu +* Complete:: A simple example, start to finish +* Hello:: A classic program +* etags:: Building etags and ctags +@end menu + + +@node Complete, Hello, Examples, Examples +@section A simple example, start to finish + +@cindex Complete example + +Let's suppose you just finished writing @code{zardoz}, a program to make +your head float from vortex to vortex. You've been using Autoconf to +provide a portability framework, but your @file{Makefile.in}s have been +ad-hoc. You want to make them bulletproof, so you turn to Automake. + +@cindex AM_INIT_AUTOMAKE, example use + +The first step is to update your @file{configure.in} to include the +commands that @code{automake} needs. The simplest way to do this is to +add an @code{AM_INIT_AUTOMAKE} call just after @code{AC_INIT}: + +@example +AM_INIT_AUTOMAKE(zardoz, 1.0) +@end example + +Since your program doesn't have any complicating factors (e.g., it +doesn't use @code{gettext}, it doesn't want to build a shared library), +you're done with this part. That was easy! + +@cindex aclocal program, introduction +@cindex aclocal.m4, preexisting +@cindex acinclude.m4, defined + +Now you must regenerate @file{configure}. But to do that, you'll need +to tell @code{autoconf} how to find the new macro you've used. The +easiest way to do this is to use the @code{aclocal} program to generate +your @file{aclocal.m4} for you. But wait... you already have an +@file{aclocal.m4}, because you had to write some hairy macros for your +program. The @code{aclocal} program lets you put your own macros into +@file{acinclude.m4}, so simply rename and then run: + +@example +mv aclocal.m4 acinclude.m4 +aclocal +autoconf +@end example + +@cindex zardoz example + +Now it is time to write your @file{Makefile.am} for @code{zardoz}. +Since @code{zardoz} is a user program, you want to install it where the +rest of the user programs go. Additionally, @code{zardoz} has some +Texinfo documentation. Your @file{configure.in} script uses +@code{AC_REPLACE_FUNCS}, so you need to link against @samp{@@LIBOBJS@@}. +So here's what you'd write: + +@example +bin_PROGRAMS = zardoz +zardoz_SOURCES = main.c head.c float.c vortex9.c gun.c +zardoz_LDADD = @@LIBOBJS@@ + +info_TEXINFOS = zardoz.texi +@end example + +Now you can run @code{automake --add-missing} to generate your +@file{Makefile.in} and grab any auxiliary files you might need, and +you're done! + + +@node Hello, etags, Complete, Examples +@section A classic program + +@cindex Example, GNU Hello +@cindex Hello example +@cindex GNU Hello, example + +@uref{ftp://prep.ai.mit.edu/pub/gnu/hello-1.3.tar.gz, GNU hello} is +renowned for its classic simplicity and versatility. This section shows +how Automake could be used with the GNU Hello package. The examples +below are from the latest beta version of GNU Hello, but with all of the +maintainer-only code stripped out, as well as all copyright comments. + +Of course, GNU Hello is somewhat more featureful than your traditional +two-liner. GNU Hello is internationalized, does option processing, and +has a manual and a test suite. GNU Hello is a deep package. + +@cindex configure.in, from GNU Hello +@cindex GNU Hello, configure.in +@cindex Hello, configure.in + +Here is the @file{configure.in} from GNU Hello: + +@example +dnl Process this file with autoconf to produce a configure script. +AC_INIT(src/hello.c) +AM_INIT_AUTOMAKE(hello, 1.3.11) +AM_CONFIG_HEADER(config.h) + +dnl Set of available languages. +ALL_LINGUAS="de fr es ko nl no pl pt sl sv" + +dnl Checks for programs. +AC_PROG_CC +AC_ISC_POSIX + +dnl Checks for libraries. + +dnl Checks for header files. +AC_STDC_HEADERS +AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h) + +dnl Checks for library functions. +AC_FUNC_ALLOCA + +dnl Check for st_blksize in struct stat +AC_ST_BLKSIZE + +dnl internationalization macros +AM_GNU_GETTEXT +AC_OUTPUT([Makefile doc/Makefile intl/Makefile po/Makefile.in \ + src/Makefile tests/Makefile tests/hello], + [chmod +x tests/hello]) +@end example + +The @samp{AM_} macros are provided by Automake (or the Gettext library); +the rest are standard Autoconf macros. + + +The top-level @file{Makefile.am}: + +@example +EXTRA_DIST = BUGS ChangeLog.O +SUBDIRS = doc intl po src tests +@end example + +As you can see, all the work here is really done in subdirectories. + +The @file{po} and @file{intl} directories are automatically generated +using @code{gettextize}; they will not be discussed here. + +@cindex Texinfo file handling example +@cindex Example, handling Texinfo files + +In @file{doc/Makefile.am} we see: + +@example +info_TEXINFOS = hello.texi +hello_TEXINFOS = gpl.texi +@end example + +This is sufficient to build, install, and distribute the GNU Hello +manual. + +@cindex Regression test example +@cindex Example, regression test + +Here is @file{tests/Makefile.am}: + +@example +TESTS = hello +EXTRA_DIST = hello.in testdata +@end example + +The script @file{hello} is generated by @code{configure}, and is the +only test case. @code{make check} will run this test. + +@cindex INCLUDES, example usage + +Last we have @file{src/Makefile.am}, where all the real work is done: + +@example +bin_PROGRAMS = hello +hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h +hello_LDADD = @@INTLLIBS@@ @@ALLOCA@@ +localedir = $(datadir)/locale +INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\" +@end example + + +@node etags, , Hello, Examples +@section Building etags and ctags + +@cindex Example, ctags and etags +@cindex ctags Example +@cindex etags Example + +Here is another, trickier example. It shows how to generate two +programs (@code{ctags} and @code{etags}) from the same source file +(@file{etags.c}). The difficult part is that each compilation of +@file{etags.c} requires different @code{cpp} flags. + +@example +bin_PROGRAMS = etags ctags +ctags_SOURCES = +ctags_LDADD = ctags.o + +etags.o: etags.c + $(COMPILE) -DETAGS_REGEXPS -c etags.c + +ctags.o: etags.c + $(COMPILE) -DCTAGS -o ctags.o -c etags.c +@end example + +Note that @code{ctags_SOURCES} is defined to be empty---that way no +implicit value is substituted. The implicit value, however, is used to +generate @code{etags} from @file{etags.o}. + +@code{ctags_LDADD} is used to get @file{ctags.o} into the link line. +@code{ctags_DEPENDENCIES} is generated by Automake. + +The above rules won't work if your compiler doesn't accept both +@samp{-c} and @samp{-o}. The simplest fix for this is to introduce a +bogus dependency (to avoid problems with a parallel @code{make}): + +@example +etags.o: etags.c ctags.o + $(COMPILE) -DETAGS_REGEXPS -c etags.c + +ctags.o: etags.c + $(COMPILE) -DCTAGS -c etags.c && mv etags.o ctags.o +@end example + +Also, these explicit rules do not work if the de-ANSI-fication feature +is used (@pxref{ANSI}). Supporting de-ANSI-fication requires a little +more work: + +@example +etags._o: etags._c ctags.o + $(COMPILE) -DETAGS_REGEXPS -c etags.c + +ctags._o: etags._c + $(COMPILE) -DCTAGS -c etags.c && mv etags._o ctags.o +@end example + + +@node Invoking Automake, configure, Examples, Top +@chapter Creating a @file{Makefile.in} + +@cindex Multiple configure.in files +@cindex Invoking Automake +@cindex Automake, invoking + +To create all the @file{Makefile.in}s for a package, run the +@code{automake} program in the top level directory, with no arguments. +@code{automake} will automatically find each appropriate +@file{Makefile.am} (by scanning @file{configure.in}; @pxref{configure}) +and generate the corresponding @file{Makefile.in}. Note that +@code{automake} has a rather simplistic view of what constitutes a +package; it assumes that a package has only one @file{configure.in}, at +the top. If your package has multiple @file{configure.in}s, then you +must run @code{automake} in each directory holding a +@file{configure.in}. + +You can optionally give @code{automake} an argument; @file{.am} is +appended to the argument and the result is used as the name of the input +file. This feature is generally only used to automatically rebuild an +out-of-date @file{Makefile.in}. Note that @code{automake} must always +be run from the topmost directory of a project, even if being used to +regenerate the @file{Makefile.in} in some subdirectory. This is +necessary because @code{automake} must scan @file{configure.in}, and +because @code{automake} uses the knowledge that a @file{Makefile.in} is +in a subdirectory to change its behavior in some cases. + +@cindex Automake options +@cindex Options, Automake + +@code{automake} accepts the following options: + +@cindex Extra files distributed with Automake +@cindex Files distributed with Automake +@cindex config.guess + +@table @samp +@item -a +@itemx --add-missing +@opindex -a +@opindex --add-missing +Automake requires certain common files to exist in certain situations; +for instance @file{config.guess} is required if @file{configure.in} runs +@code{AC_CANONICAL_HOST}. Automake is distributed with several of these +files; this option will cause the missing ones to be automatically added +to the package, whenever possible. In general if Automake tells you a +file is missing, try using this option. By default Automake tries to +make a symbolic link pointing to its own copy of the missing file; this +can be changed with @code{--copy}. + +@item --amdir=@var{dir} +@opindex --amdir +Look for Automake data files in directory @var{dir} instead of in the +installation directory. This is typically used for debugging. + +@item --build-dir=@var{dir} +@opindex --build-dir +Tell Automake where the build directory is. This option is used when +including dependencies into a @file{Makefile.in} generated by @code{make +dist}; it should not be used otherwise. + +@item -c +@item --copy +When used with @code{--add-missing}, causes installed files to be +copied. The default is to make a symbolic link. + +@item --cygnus +@opindex --cygnus +Causes the generated @file{Makefile.in}s to follow Cygnus rules, instead +of GNU or Gnits rules. For more information, see @ref{Cygnus}. + +@item --foreign +@opindex --foreign +Set the global strictness to @samp{foreign}. For more information, see +@ref{Strictness}. + +@item --gnits +@opindex --gnits +Set the global strictness to @samp{gnits}. For more information, see +@ref{Gnits}. + +@item --gnu +@opindex --gnu +Set the global strictness to @samp{gnu}. For more information, see +@ref{Gnits}. This is the default strictness. + +@item --help +@opindex --help +Print a summary of the command line options and exit. + +@item -i +@itemx --include-deps +@opindex -i +@opindex --include-deps +Include all automatically generated dependency information +(@pxref{Dependencies}) in the generated +@file{Makefile.in}. This is generally done when making a distribution; +see @ref{Dist}. + +@item --generate-deps +@opindex --generate-deps +Generate a file concatenating all automatically generated dependency +information (@pxref{Dependencies}) into one file, @file{.dep_segment}. +This is generally done when making a distribution; see @ref{Dist}. It +is useful when maintaining a @file{SMakefile} or makefiles for other +platforms (@file{Makefile.DOS}, etc.) It can only be used in +conjunction with @samp{--include-deps}, @samp{--srcdir-name}, and +@samp{--build-dir}. Note that if this option is given, no other +processing is done. + +@item --no-force +@opindex --no-force +Ordinarily @code{automake} creates all @file{Makefile.in}s mentioned in +@file{configure.in}. This option causes it to only update those +@file{Makefile.in}s which are out of date with respect to one of their +dependents. + +@item -o @var{dir} +@itemx --output-dir=@var{dir} +@opindex -o +@opindex --output-dir +Put the generated @file{Makefile.in} in the directory @var{dir}. +Ordinarily each @file{Makefile.in} is created in the directory of the +corresponding @file{Makefile.am}. This option is used when making +distributions. + +@item --srcdir-name=@var{dir} +@opindex --srcdir-name +Tell Automake the name of the source directory associated with the +current build. This option is used when including dependencies into a +@file{Makefile.in} generated by @code{make dist}; it should not be used +otherwise. + +@item -v +@itemx --verbose +@opindex -v +@opindex --verbose +Cause Automake to print information about which files are being read or +created. + +@item --version +@opindex --version +Print the version number of Automake and exit. +@end table + + +@node configure, Top level, Invoking Automake, Top +@chapter Scanning @file{configure.in} + +@cindex configure.in, scanning +@cindex Scanning configure.in + +Automake scans the package's @file{configure.in} to determine certain +information about the package. Some @code{autoconf} macros are required +and some variables must be defined in @file{configure.in}. Automake +will also use information from @file{configure.in} to further tailor its +output. + +Automake also supplies some Autoconf macros to make the maintenance +easier. These macros can automatically be put into your +@file{aclocal.m4} using the @code{aclocal} program. + +@menu +* Requirements:: Configuration requirements +* Optional:: Other things Automake recognizes +* Invoking aclocal:: Auto-generating aclocal.m4 +* Macros:: Autoconf macros supplied with Automake +* Extending aclocal:: Writing your own aclocal macros +@end menu + + +@node Requirements, Optional, configure, configure +@section Configuration requirements + +@cindex Automake requirements +@cindex Requirements of Automake + +The simplest way to meet the basic Automake requirements is to use the +macro @code{AM_INIT_AUTOMAKE} (@pxref{Macros}). But if you prefer, you +can do the required steps by hand: +@cvindex AM_INIT_AUTOMAKE + +@itemize @bullet +@item +Define the variables @code{PACKAGE} and @code{VERSION} with +@code{AC_SUBST}. +@cvindex PACKAGE +@cvindex VERSION +@code{PACKAGE} should be the name of the package as it appears when +bundled for distribution. For instance, Automake defines @code{PACKAGE} +to be @samp{automake}. @code{VERSION} should be the version number of +the release that is being developed. We recommend that you make +@file{configure.in} the only place in your package where the version +number is defined; this makes releases simpler. + +Automake doesn't do any interpretation of @code{PACKAGE} or +@code{VERSION}, except in @samp{Gnits} mode (@pxref{Gnits}). + +@item +Use the macro @code{AC_ARG_PROGRAM} if a program or script is installed. +@xref{Transforming Names, , Transforming Program Names When Installing, +autoconf, The Autoconf}. +@cvindex AC_ARG_PROGRAM + +@item +Use @code{AC_PROG_MAKE_SET} if the package is not flat. @xref{Output, , +Creating Output Files, autoconf, The Autoconf Manual}. +@cvindex AC_PROG_MAKE_SET + +@item +Use @code{AM_SANITY_CHECK} to make sure the build environment is sane. + +@item +Call @code{AC_PROG_INSTALL} +(@pxref{Particular Programs, , Particular Program Checks, autoconf, The +Autoconf Manual}). +@cvindex AC_PROG_INSTALL + +@item +Use @code{AM_MISSING_PROG} to see whether the programs @code{aclocal}, +@code{autoconf}, @code{automake}, @code{autoheader}, and @code{makeinfo} +are in the build environment. Here is how this is done: +@example +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +@end example +@end itemize + + +Here are the other macros which Automake requires but which are not run +by @code{AM_INIT_AUTOMAKE}: + +@cindex AC_OUTPUT, scanning + +@table @code +@item AC_OUTPUT +Automake uses this to determine which files to create (@pxref{Output, , +Creating Output Files, autoconf, The Autoconf Manual}). Listed files +named @code{Makefile} are treated as @file{Makefile}s. Other listed +files are treated differently. Currently the only difference is that a +@file{Makefile} is removed by @code{make distclean}, while other files +are removed by @code{make clean}. +@c FIXME: this is in violation of standards! +@cvindex AC_OUTPUT +@end table + + +@node Optional, Invoking aclocal, Requirements, configure +@section Other things Automake recognizes + +@cindex Macros Automake recognizes +@cindex Recognized macros by Automake + +Automake will also recognize the use of certain macros and tailor the +generated @file{Makefile.in} appropriately. Currently recognized macros +and their effects are: + +@table @code +@item AC_CONFIG_HEADER +Automake requires the use of @code{AM_CONFIG_HEADER}, which is similar +to @code{AC_CONFIG_HEADER} (@pxref{Configuration Headers, , +Configuration Header Files, autoconf, The Autoconf Manual}), but does +some useful Automake-specific work. +@cvindex AC_CONFIG_HEADER + +@item AC_CONFIG_AUX_DIR +Automake will look for various helper scripts, such as +@file{mkinstalldirs}, in the directory named in this macro invocation. +If not seen, the scripts are looked for in their @samp{standard} +locations (either the top source directory, or in the source directory +corresponding to the current @file{Makefile.am}, whichever is +appropriate). @xref{Input, , Finding `configure' Input, autoconf, The +Autoconf Manual}. +@cvindex AC_CONFIG_AUX_DIR +FIXME: give complete list of things looked for in this directory + +@item AC_PATH_XTRA +Automake will insert definitions for the variables defined by +@code{AC_PATH_XTRA} into each @file{Makefile.in} that builds a C program +or library. @xref{System Services, , System Services, autoconf, The +Autoconf Manual}. +@cvindex AC_PATH_XTRA + +@item AC_CANONICAL_HOST +@itemx AC_CHECK_TOOL +Automake will ensure that @file{config.guess} and @file{config.sub} +exist. Also, the @file{Makefile} variables @samp{host_alias} and +@samp{host_triplet} are introduced. See both @ref{Canonicalizing, , +Getting the Canonical System Type, autoconf, The Autoconf Manual}, and +@ref{Generic Programs, , Generic Program Checks, autoconf, The Autoconf +Manual}. +@c fixme xref autoconf docs. +@cvindex AC_CANONICAL_HOST +@cvindex AC_CHECK_TOOL +@vindex host_alias +@vindex host_triplet + +@item AC_CANONICAL_SYSTEM +This is similar to @code{AC_CANONICAL_HOST}, but also defines the +@file{Makefile} variables @samp{build_alias} and @samp{target_alias}. +@xref{Canonicalizing, , Getting the Canonical System Type, autoconf, The +Autoconf Manual}. +@cvindex AC_CANONICAL_SYSTEM +@vindex build_alias +@vindex target_alias + +@item AC_FUNC_ALLOCA +@itemx AC_FUNC_GETLOADAVG +@itemx AC_FUNC_MEMCMP +@itemx AC_STRUCT_ST_BLOCKS +@itemx AC_FUNC_FNMATCH +@itemx AM_FUNC_STRTOD +@itemx AC_REPLACE_FUNCS +@itemx AC_REPLACE_GNU_GETOPT +@itemx AM_WITH_REGEX +Automake will ensure that the appropriate dependencies are generated for +the objects corresponding to these macros. Also, Automake will verify +that the appropriate source files are part of the distribution. Note +that Automake does not come with any of the C sources required to use +these macros, so @code{automake -a} will not install the sources. +@xref{A Library}, for more information. Also, see @ref{Particular +Functions, , Particular Function Checks, autoconf, The Autoconf Manual}. +@cvindex AC_FUNC_ALLOCA +@cvindex AC_FUNC_GETLOADAVG +@cvindex AC_FUNC_MEMCMP +@cvindex AC_STRUCT_ST_BLOCKS +@cvindex AC_FUNC_FNMATCH +@cvindex AC_FUNC_FNMATCH +@cvindex AC_REPLACE_FUNCS +@cvindex AC_REPLACE_GNU_GETOPT +@cvindex AM_FUNC_STRTOD +@cvindex AM_WITH_REGEX + +@item LIBOBJS +Automake will detect statements which put @file{.o} files into +@code{LIBOBJS}, and will treat these additional files as if they were +discovered via @code{AC_REPLACE_FUNCS}. @xref{Generic Functions, , +Generic Function Checks, autoconf, The Autoconf Manual}. +@cvindex LIBOBJS + +@item AC_PROG_RANLIB +This is required if any libraries are built in the package. +@xref{Particular Programs, , Particular Program Checks, autoconf, The +Autoconf Manual}. +@cvindex AC_PROG_RANLIB + +@item AC_PROG_CXX +This is required if any C++ source is included. @xref{Particular +Programs, , Particular Program Checks, autoconf, The Autoconf Manual}. +@cvindex AC_PROG_CXX + +@item AC_PROG_F77 +This is required if any Fortran 77 source is included. This macro is +distributed with Autoconf version 2.13 and later. @xref{Particular +Programs, , Particular Program Checks, autoconf, The Autoconf Manual}. +@cvindex AC_PROG_F77 + +@item AC_F77_LIBRARY_LDFLAGS +This is required for programs and shared libraries that are a mixture of +languages that include Fortran 77 (@pxref{Mixing Fortran 77 With C and +C++}). @xref{Macros, , Autoconf macros supplied with Automake}. +@cvindex AC_F77_LIBRARY_LDFLAGS + +@item AM_PROG_LIBTOOL +Automake will turn on processing for @code{libtool} (@pxref{Top, , +Introduction, libtool, The Libtool Manual}). +@cvindex AM_PROG_LIBTOOL + +@item AC_PROG_YACC +If a Yacc source file is seen, then you must either use this macro or +define the variable @samp{YACC} in @file{configure.in}. The former is +preferred (@pxref{Particular Programs, , Particular Program Checks, +autoconf, The Autoconf Manual}). +@cvindex AC_PROG_YACC +@cvindex YACC + +@item AC_DECL_YYTEXT +This macro is required if there is Lex source in the package. +@xref{Particular Programs, , Particular Program Checks, autoconf, The +Autoconf Manual}. +@cvindex AC_DECL_YYTEXT + +@item AC_PROG_LEX +If a Lex source file is seen, then this macro must be used. +@xref{Particular Programs, , Particular Program Checks, autoconf, The +Autoconf Manual}. +@cvindex AC_PROG_LEX + +@item ALL_LINGUAS +If Automake sees that this variable is set in @file{configure.in}, it +will check the @file{po} directory to ensure that all the named +@samp{.po} files exist, and that all the @samp{.po} files that exist are +named. +@cvindex ALL_LINGUAS + +@item AM_C_PROTOTYPES +This is required when using automatic de-ANSI-fication; see @ref{ANSI}. +@cvindex AM_C_PROTOTYPES + +@item AM_GNU_GETTEXT +This macro is required for packages which use GNU gettext +(@pxref{gettext}). It is distributed with gettext. If Automake sees +this macro it ensures that the package meets some of gettext's +requirements. +@cvindex AM_GNU_GETTEXT + +@item AM_MAINTAINER_MODE +@opindex --enable-maintainer-mode +This macro adds a @samp{--enable-maintainer-mode} option to +@code{configure}. If this is used, @code{automake} will cause +@samp{maintainer-only} rules to be turned off by default in the +generated @file{Makefile.in}s. This macro is disallowed in @samp{Gnits} +mode (@pxref{Gnits}). This macro defines the @samp{MAINTAINER_MODE} +conditional, which you can use in your own @file{Makefile.am}. +@cvindex AM_MAINTAINER_MODE + +@item AC_SUBST +@itemx AC_CHECK_TOOL +@itemx AC_CHECK_PROG +@itemx AC_CHECK_PROGS +@itemx AC_PATH_PROG +@itemx AC_PATH_PROGS +For each of these macros, the first argument is automatically defined as +a variable in each generated @file{Makefile.in}. @xref{Setting Output +Variables, , Setting Output Variables, autoconf, The Autoconf Manual}, +and @ref{Generic Programs, , Generic Program Checks, autoconf, The +Autoconf Manual}. +@cvindex AC_SUBST +@cvindex AC_CHECK_TOOL +@cvindex AC_CHECK_PROG +@cvindex AC_CHECK_PROGS +@cvindex AC_PATH_PROG +@cvindex AC_PATH_PROGS + +@end table + + +@node Invoking aclocal, Macros, Optional, configure +@section Auto-generating aclocal.m4 + +@cindex Invoking aclocal +@cindex aclocal, Invoking + +Automake includes a number of Autoconf macros which can be used in your +package; some of them are actually required by Automake in certain +situations. These macros must be defined in your @file{aclocal.m4}; +otherwise they will not be seen by @code{autoconf}. + +The @code{aclocal} program will automatically generate @file{aclocal.m4} +files based on the contents of @file{configure.in}. This provides a +convenient way to get Automake-provided macros, without having to +search around. Also, the @code{aclocal} mechanism is extensible for use +by other packages. + +At startup, @code{aclocal} scans all the @file{.m4} files it can find, +looking for macro definitions. Then it scans @file{configure.in}. Any +mention of one of the macros found in the first step causes that macro, +and any macros it in turn requires, to be put into @file{aclocal.m4}. + +The contents of @file{acinclude.m4}, if it exists, are also +automatically included in @file{aclocal.m4}. This is useful for +incorporating local macros into @file{configure}. + +@code{aclocal} accepts the following options: + +@table @code +@item --acdir=@var{dir} +@opindex --acdir +Look for the macro files in @var{dir} instead of the installation +directory. This is typically used for debugging. + +@item --help +@opindex --help +Print a summary of the command line options and exit. + +@item -I @var{dir} +@opindex -I +Add the directory @var{dir} to the list of directories searched for +@file{.m4} files. + +@item --output=@var{file} +@opindex --output +Cause the output to be put into @var{file} instead of @file{aclocal.m4}. + +@item --print-ac-dir +@opindex --print-ac-dir +Prints the name of the directory which @code{aclocal} will search to +find the @file{.m4} files. When this option is given, normal processing +is suppressed. This option can be used by a package to determine where +to install a macro file. + +@item --verbose +@opindex --verbose +Print the names of the files it examines. + +@item --version +@opindex --version +Print the version number of Automake and exit. +@end table + + +@node Macros, Extending aclocal, Invoking aclocal, configure +@section Autoconf macros supplied with Automake + +@c consider generating this node automatically from m4 files. + +@table @code +@item AM_CONFIG_HEADER +Automake will generate rules to automatically regenerate the config +header. If you do use this macro, you must create the file +@file{stamp-h.in} in your source directory. It can be empty. +@cvindex AM_CONFIG_HEADER + +@item AM_ENABLE_MULTILIB +This is used when a ``multilib'' library is being built. A +@dfn{multilib} library is one that is built multiple times, once per +target flag combination. This is only useful when the library is +intended to be cross-compiled. The first optional argument is the name +of the @file{Makefile} being generated; it defaults to @samp{Makefile}. +The second option argument is used to find the top source directory; it +defaults to the empty string (generally this should not be used unless +you are familiar with the internals). + +@item AM_FUNC_STRTOD +If the @code{strtod} function is not available, or does not work +correctly (like the one on SunOS 5.4), add @file{strtod.o} to output +variable @code{LIBOBJS}. +@cvindex AM_FUNC_STRTOD + +@item AM_FUNC_ERROR_AT_LINE +If the function @code{error_at_line} is not found, then add +@file{error.o} to @code{LIBOBJS}. +@cvindex AM_FUNC_ERROR_AT_LINE + +@item AM_FUNC_MKTIME +Check for a working @code{mktime} function. If not found, add +@file{mktime.o} to @samp{LIBOBJS}. +@cvindex AM_FUNC_MKTIME + +@item AM_FUNC_OBSTACK +Check for the GNU obstacks code; if not found, add @file{obstack.o} to +@samp{LIBOBJS}. +@cvindex AM_FUNC_OBSTACK + +@item AM_C_PROTOTYPES +Check to see if function prototypes are understood by the compiler. If +so, define @samp{PROTOTYPES} and set the output variables @samp{U} and +@samp{ANSI2KNR} to the empty string. Otherwise, set @samp{U} to +@samp{_} and @samp{ANSI2KNR} to @samp{./ansi2knr}. Automake uses these +values to implement automatic de-ANSI-fication. +@cvindex AM_C_PROTOTYPES + +@item AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL +If the use of @code{TIOCGWINSZ} requires @file{}, then +define @code{GWINSZ_IN_SYS_IOCTL}. Otherwise @code{TIOCGWINSZ} can be +found in @file{}. +@cvindex AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL + +@item AM_INIT_AUTOMAKE +Runs many macros that most @file{configure.in}'s need. This macro has +two required arguments, the package and the version number. By default +this macro @code{AC_DEFINE}'s @samp{PACKAGE} and @samp{VERSION}. This +can be avoided by passing in a non-empty third argument. + +@item AM_PATH_LISPDIR +Searches for the program @code{emacs}, and, if found, sets the output +variable @code{lispdir} to the full path to Emacs' site-lisp directory. +@cvindex AM_PATH_LISPDIR + +@item AM_PROG_CC_STDC +If the C compiler in not in ANSI C mode by default, try to add an option +to output variable @code{CC} to make it so. This macro tries various +options that select ANSI C on some system or another. It considers the +compiler to be in ANSI C mode if it handles function prototypes correctly. + +If you use this macro, you should check after calling it whether the C +compiler has been set to accept ANSI C; if not, the shell variable +@code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +code in ANSI C, you can make an un-ANSIfied copy of it by using the +@code{ansi2knr} option (@pxref{ANSI}). + +@item AM_PROG_LEX +@cindex HP-UX 10, lex problems +@cindex lex problems with HP-UX 10 +Like @code{AC_PROG_LEX} with @code{AC_DECL_YYTEXT} (@pxref{Particular +Programs, , Particular Program Checks, autoconf, The Autoconf Manual}), +but uses the @code{missing} script on systems that do not have +@code{lex}. @samp{HP-UX 10} is one such system. + +@item AM_SANITY_CHECK +This checks to make sure that a file created in the build directory is +newer than a file in the source directory. This can fail on systems +where the clock is set incorrectly. This macro is automatically run +from @code{AM_INIT_AUTOMAKE}. + +@item AM_SYS_POSIX_TERMIOS +@cvindex am_cv_sys_posix_termios +@cindex POSIX termios headers +@cindex termios POSIX headers +Check to see if POSIX termios headers and functions are available on the +system. If so, set the shell variable @code{am_cv_sys_posix_termios} to +@samp{yes}. If not, set the variable to @samp{no}. + +@item AM_TYPE_PTRDIFF_T +@cvindex HAVE_PTRDIFF_T +@vindex ptrdiff_t +Define @samp{HAVE_PTRDIFF_T} if the type @samp{ptrdiff_t} is defined in +@file{}. + +@item AM_WITH_DMALLOC +@cvindex WITH_DMALLOC +@cindex dmalloc, support for +@opindex --with-dmalloc +Add support for the +@uref{ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz, dmalloc} +package. If the user configures with @samp{--with-dmalloc}, then define +@code{WITH_DMALLOC} and add @samp{-ldmalloc} to @code{LIBS}. + +@item AM_WITH_REGEX +@cvindex WITH_REGEX +@opindex --with-regex +@cindex regex package +@cindex rx package +Adds @samp{--with-regex} to the @code{configure} command line. If +specified (the default), then the @samp{regex} regular expression +library is used, @file{regex.o} is put into @samp{LIBOBJS}, and +@samp{WITH_REGEX} is defined.. If @samp{--without-regex} is given, then +the @samp{rx} regular expression library is used, and @file{rx.o} is put +into @samp{LIBOBJS}. + +@end table + + +@node Extending aclocal, , Macros, configure +@section Writing your own aclocal macros + +@cindex aclocal, extending +@cindex Extending aclocal + +The @code{aclocal} program doesn't have any built-in knowledge of any +macros, so it is easy to extend it with your own macros. + +This is mostly used for libraries which want to supply their own +Autoconf macros for use by other programs. For instance the +@code{gettext} library supplies a macro @code{AM_GNU_GETTEXT} which +should be used by any package using @code{gettext}. When the library is +installed, it installs this macro so that @code{aclocal} will find it. + +A file of macros should be a series of @code{AC_DEFUN}'s. The +@code{aclocal} programs also understands @code{AC_REQUIRE}, so it is +safe to put each macro in a separate file. @xref{Prerequisite Macros, , +, autoconf, The Autoconf Manual}, and @ref{Macro Definitions, , , +autoconf, The Autoconf Manual}. + +A macro file's name should end in @file{.m4}. Such files should be +installed in @file{$(datadir)/aclocal}. + + +@node Top level, Programs, configure, Top +@chapter The top-level @file{Makefile.am} + +@cindex SUBDIRS, explained + +In non-flat packages, the top level @file{Makefile.am} must tell +Automake which subdirectories are to be built. This is done via the +@code{SUBDIRS} variable. +@vindex SUBDIRS + +The @code{SUBDIRS} macro holds a list of subdirectories in which +building of various sorts can occur. Many targets (e.g. @code{all}) in +the generated @file{Makefile} will run both locally and in all specified +subdirectories. Note that the directories listed in @code{SUBDIRS} are +not required to contain @file{Makefile.am}s; only @file{Makefile}s +(after configuration). This allows inclusion of libraries from packages +which do not use Automake (such as @code{gettext}). The directories +mentioned in @code{SUBDIRS} must be direct children of the current +directory. For instance, you cannot put @samp{src/subdir} into +@code{SUBDIRS}. + +In a deep package, the top-level @file{Makefile.am} is often very short. +For instance, here is the @file{Makefile.am} from the GNU Hello +distribution: + +@example +EXTRA_DIST = BUGS ChangeLog.O README-alpha +SUBDIRS = doc intl po src tests +@end example + +@cindex SUBDIRS, overriding +@cindex Overriding SUBDIRS + +It is possible to override the @code{SUBDIRS} variable if, like in the +case of GNU @code{Inetutils}, you want to only build a subset of the +entire package. In your @file{Makefile.am} include: + +@example +SUBDIRS = @@SUBDIRS@@ +@end example + +Then in your @file{configure.in} you can specify: + +@example +SUBDIRS = "src doc lib po" +AC_SUBST(SUBDIRS) +@end example + +The upshot of this is that Automake is tricked into building the package +to take the subdirs, but doesn't actually bind that list until +@code{configure} is run. + +Although the @code{SUBDIRS} macro can contain configure substitutions +(e.g. @samp{@@DIRS@@}); Automake itself does not actually examine the +contents of this variable. + +If @code{SUBDIRS} is defined, then your @file{configure.in} must include +@code{AC_PROG_MAKE_SET}. + +The use of @code{SUBDIRS} is not restricted to just the top-level +@file{Makefile.am}. Automake can be used to construct packages of +arbitrary depth. + +By default, Automake generates @file{Makefiles} which work depth-first +(@samp{postfix}). However, it is possible to change this ordering. You +can do this by putting @samp{.} into @code{SUBDIRS}. For instance, +putting @samp{.} first will cause a @samp{prefix} ordering of +directories. + + +@node Programs, Other objects, Top level, Top +@chapter Building Programs and Libraries + +A large part of Automake's functionality is dedicated to making it easy +to build programs and libraries. + +@menu +* A Program:: Building a program +* A Library:: Building a library +* LIBOBJS:: Special handling for LIBOBJS and ALLOCA +* A Shared Library:: Building a Libtool library +* Program variables:: Variables used when building a program +* Yacc and Lex:: Yacc and Lex support +* C++ Support:: +* Fortran 77 Support:: +* Support for Other Languages:: +* ANSI:: Automatic de-ANSI-fication +* Dependencies:: Automatic dependency tracking +@end menu + + +@node A Program, A Library, Programs, Programs +@section Building a program + +@cindex PROGRAMS, bindir +@vindex bin_PROGRAMS +@vindex sbin_PROGRAMS +@vindex libexec_PROGRAMS +@vindex pkglib_PROGRAMS +@vindex noinst_PROGRAMS + +In a directory containing source that gets built into a program (as +opposed to a library), the @samp{PROGRAMS} primary is used. Programs +can be installed in @code{bindir}, @code{sbindir}, @code{libexecdir}, +@code{pkglibdir}, or not at all (@samp{noinst}). + +For instance: + +@example +bin_PROGRAMS = hello +@end example + +In this simple case, the resulting @file{Makefile.in} will contain code +to generate a program named @code{hello}. The variable +@code{hello_SOURCES} is used to specify which source files get built +into an executable: + +@example +hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h +@end example + +This causes each mentioned @samp{.c} file to be compiled into the +corresponding @samp{.o}. Then all are linked to produce @file{hello}. + +@cindex _SOURCES primary, defined +@cindex SOURCES primary, defined +@cindex Primary variable, SOURCES + +If @samp{@var{prog}_SOURCES} is needed, but not specified, then it +defaults to the single file @file{prog.c}. +@vindex _SOURCES +@vindex SOURCES + +Multiple programs can be built in a single directory. Multiple programs +can share a single source file, which must be listed in each +@samp{_SOURCES} definition. + +@cindex Header files in _SOURCES +@cindex _SOURCES and header files + +Header files listed in a @samp{_SOURCES} definition will be included in +the distribution but otherwise ignored. In case it isn't obvious, you +should not include the header file generated by @file{configure} in an +@samp{_SOURCES} variable; this file should not be distributed. Lex +(@samp{.l}) and Yacc (@samp{.y}) files can also be listed; see @ref{Yacc +and Lex}. + +@cindex EXTRA_prog_SOURCES, defined + +Automake must know all the source files that could possibly go into a +program, even if not all the files are built in every circumstance. +Any files which are only conditionally built should be listed in the +appropriate @samp{EXTRA_} variable. For instance, if +@file{hello-linux.c} were conditionally included in @code{hello}, the +@file{Makefile.am} would contain: + +@example +EXTRA_hello_SOURCES = hello-linux.c +@end example + +Similarly, sometimes it is useful to determine the programs that are to +be built at configure time. For instance, GNU @code{cpio} only builds +@code{mt} and @code{rmt} under special circumstances. + +@cindex EXTRA_PROGRAMS, defined + +In this case, you must notify Automake of all the programs that can +possibly be built, but at the same time cause the generated +@file{Makefile.in} to use the programs specified by @code{configure}. +This is done by having @code{configure} substitute values into each +@samp{_PROGRAMS} definition, while listing all optionally built programs +in @code{EXTRA_PROGRAMS}. +@vindex EXTRA_PROGRAMS + +If you need to link against libraries that are not found by +@code{configure}, you can use @code{LDADD} to do so. This variable +actually can be used to add any options to the linker command line. +@vindex LDADD + +@cindex prog_LDADD, defined + +Sometimes, multiple programs are built in one directory but do not share +the same link-time requirements. In this case, you can use the +@samp{@var{prog}_LDADD} variable (where @var{prog} is the name of the +program as it appears in some @samp{_PROGRAMS} variable, and usually +written in lowercase) to override the global @code{LDADD}. If this +variable exists for a given program, then that program is not linked +using @code{LDADD}. +@vindex _LDADD + +For instance, in GNU cpio, @code{pax}, @code{cpio} and @code{mt} are +linked against the library @file{libcpio.a}. However, @code{rmt} is +built in the same directory, and has no such link requirement. Also, +@code{mt} and @code{rmt} are only built on certain architectures. Here +is what cpio's @file{src/Makefile.am} looks like (abridged): + +@example +bin_PROGRAMS = cpio pax @@MT@@ +libexec_PROGRAMS = @@RMT@@ +EXTRA_PROGRAMS = mt rmt + +LDADD = ../lib/libcpio.a @@INTLLIBS@@ +rmt_LDADD = + +cpio_SOURCES = @dots{} +pax_SOURCES = @dots{} +mt_SOURCES = @dots{} +rmt_SOURCES = @dots{} +@end example + +@cindex _LDFLAGS, defined + +@samp{@var{prog}_LDADD} is inappropriate for passing program-specific +linker flags (except for @samp{-l} and @samp{-L}). So, use the +@samp{@var{prog}_LDFLAGS} variable for this purpose. +@vindex _LDFLAGS + +@cindex _DEPENDENCIES, defined + +It is also occasionally useful to have a program depend on some other +target which is not actually part of that program. This can be done +using the @samp{@var{prog}_DEPENDENCIES} variable. Each program depends +on the contents of such a variable, but no further interpretation is +done. + +If @samp{@var{prog}_DEPENDENCIES} is not supplied, it is computed by +Automake. The automatically-assigned value is the contents of +@samp{@var{prog}_LDADD}, with most configure substitutions, @samp{-l}, +and @samp{-L} options removed. The configure substitutions that are +left in are only @samp{@@LIBOBJS@@} and @samp{@@ALLOCA@@}; these are +left because it is known that they will not cause an invalid value for +@samp{@var{prog}_DEPENDENCIES} to be generated. + + +@node A Library, LIBOBJS, A Program, Programs +@section Building a library + +@cindex _LIBRARIES primary, defined +@cindex LIBRARIES primary, defined +@cindex Primary variable, LIBRARIES + +@vindex lib_LIBRARIES +@vindex pkglib_LIBRARIES +@vindex noinst_LIBRARIES + +Building a library is much like building a program. In this case, the +name of the primary is @samp{LIBRARIES}. Libraries can be installed in +@code{libdir} or @code{pkglibdir}. + +@xref{A Shared Library}, for information on how to build shared +libraries using Libtool and the @samp{LTLIBRARIES} primary. + +Each @samp{_LIBRARIES} variable is a list of the libraries to be built. +For instance to create a library named @file{libcpio.a}, but not install +it, you would write: + +@example +noinst_LIBRARIES = libcpio.a +@end example + +The sources that go into a library are determined exactly as they are +for programs, via the @samp{_SOURCES} variables. Note that the library +name is canonicalized (@pxref{Canonicalization}), so the @samp{_SOURCES} +variable corresponding to @file{liblob.a} is @samp{liblob_a_SOURCES}, +not @samp{liblob.a_SOURCES}. + +@cindex _LIBADD primary, defined +@cindex LIBADD primary, defined +@cindex Primary variable, LIBADD + +Extra objects can be added to a library using the +@samp{@var{library}_LIBADD} variable. This should be used for objects +determined by @code{configure}. Again from @code{cpio}: +@vindex _LIBADD +@vindex LIBADD + +@example +libcpio_a_LIBADD = @@LIBOBJS@@ @@ALLOCA@@ +@end example + + +@node LIBOBJS, A Shared Library, A Library, Programs +@section Special handling for LIBOBJS and ALLOCA + +@cindex @@LIBOBJS@@, special handling +@cindex @@ALLOCA@@, special handling + +Automake explicitly recognizes the use of @code{@@LIBOBJS@@} and +@code{@@ALLOCA@@}, and uses this information, plus the list of +@code{LIBOBJS} files derived from @file{configure.in} to automatically +include the appropriate source files in the distribution (@pxref{Dist}). +These source files are also automatically handled in the +dependency-tracking scheme; see @xref{Dependencies}. + +@code{@@LIBOBJS@@} and @code{@@ALLOCA@@} are specially recognized in any +@samp{_LDADD} or @samp{_LIBADD} variable. + + +@node A Shared Library, Program variables, LIBOBJS, Programs +@section Building a Shared Library + +@cindex Shared libraries, support for + +Building shared libraries is a relatively complex matter. For this +reason, GNU Libtool (@pxref{Top, , Introduction, libtool, The +Libtool Manual}) was created to help build shared libraries in a +platform-independent way. + +@cindex _LTLIBRARIES primary, defined +@cindex LTLIBRARIES primary, defined +@cindex Primary variable, LTLIBRARIES +@cindex Example of shared libraries + +@cindex suffix .la, defined + +Automake uses Libtool to build libraries declared with the +@samp{LTLIBRARIES} primary. Each @samp{_LTLIBRARIES} variable is a list +of shared libraries to build. For instance, to create a library named +@file{libgettext.a} and its corresponding shared libraries, and install +them in @samp{libdir}, write: + +@example +lib_LTLIBRARIES = libgettext.la +@end example + +@vindex lib_LTLIBRARIES +@vindex pkglib_LTLIBRARIES +@vindex noinst_LTLIBRARIES +@vindex check_LTLIBRARIES + +@cindex check_LTLIBRARIES, not allowed + +Note that shared libraries @emph{must} be installed, so +@code{check_LTLIBRARIES} is not allowed. However, +@code{noinst_LTLIBRARIES} is allowed. This feature should be used for +libtool ``convenience libraries''. + +@cindex suffix .lo, defined + +For each library, the @samp{@var{library}_LIBADD} variable contains the +names of extra libtool objects (@file{.lo} files) to add to the shared +library. The @samp{@var{library}_LDFLAGS} variable contains any +additional libtool flags, such as @samp{-version-info} or +@samp{-static}. + +@cindex @@LTLIBOBJS@@, special handling + +Where an ordinary library might include @code{@@LIBOBJS@@}, a libtool +library must use @code{@@LTLIBOBJS@@}. This is required because the +object files that libtool operates on do not necessarily end in +@file{.o}. The libtool manual contains more details on this topic. + +For libraries installed in some directory, Automake will automatically +supply the appropriate @samp{-rpath} option. However, for libraries +determined at configure time (and thus mentioned in +@code{EXTRA_LTLIBRARIES}), Automake does not know the eventual +installation directory; for such libraries you must add the +@samp{-rpath} option to the appropriate @samp{_LDFLAGS} variable by +hand. + +@xref{Using Automake, Using Automake with Libtool, The Libtool Manual, +libtool, The Libtool Manual}, for more information. + + +@node Program variables, Yacc and Lex, A Shared Library, Programs +@section Variables used when building a program + +Occasionally it is useful to know which @file{Makefile} variables +Automake uses for compilations; for instance you might need to do your +own compilation in some special cases. + +Some variables are inherited from Autoconf; these are @code{CC}, +@code{CFLAGS}, @code{CPPFLAGS}, @code{DEFS}, @code{LDFLAGS}, and +@code{LIBS}. +@vindex LDFLAGS + +There are some additional variables which Automake itself defines: + +@vtable @code +@item INCLUDES +A list of @samp{-I} options. This can be set in your @file{Makefile.am} +if you have special directories you want to look in. Automake already +provides some @samp{-I} options automatically. In particular it +generates @samp{-I$(srcdir)} and a @samp{-I} pointing to the directory +holding @file{config.h} (if you've used @code{AC_CONFIG_HEADER} or +@code{AM_CONFIG_HEADER}). + +@code{INCLUDES} can actually be used for other @code{cpp} options +besides @samp{-I}. For instance, it is sometimes used to pass arbitrary +@samp{-D} options to the compiler. + +@item COMPILE +This is the command used to actually compile a C source file. The +filename is appended to form the complete command line. + +@item LINK +This is the command used to actually link a C program. +@end vtable + + +@node Yacc and Lex, C++ Support, Program variables, Programs +@section Yacc and Lex support + +Automake has somewhat idiosyncratic support for Yacc and Lex. + +Automake assumes that the @file{.c} file generated by @code{yacc} (or +@code{lex}) should be named using the basename of the input file. That +is, for a yacc source file @file{foo.y}, Automake will cause the +intermediate file to be named @file{foo.c} (as opposed to +@file{y.tab.c}, which is more traditional). + +The extension of a yacc source file is used to determine the extension +of the resulting @samp{C} or @samp{C++} file. Files with the extension +@samp{.y} will be turned into @samp{.c} files; likewise, @samp{.yy} will +become @samp{.cc}; @samp{.y++}, @samp{c++}; and @samp{.yxx}, +@samp{.cxx}. + +Likewise, lex source files can be used to generate @samp{C} or +@samp{C++}; the extensions @samp{.l}, @samp{.ll}, @samp{.l++}, and +@samp{.lxx} are recognized. + +You should never explicitly mention the intermediate (@samp{C} or +@samp{C++}) file in any @samp{SOURCES} variable; only list the source +file. + +The intermediate files generated by @code{yacc} (or @code{lex}) will be +included in any distribution that is made. That way the user doesn't +need to have @code{yacc} or @code{lex}. + +If a @code{yacc} source file is seen, then your @file{configure.in} must +define the variable @samp{YACC}. This is most easily done by invoking +the macro @samp{AC_PROG_YACC} (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}). + +Similarly, if a @code{lex} source file is seen, then your +@file{configure.in} must define the variable @samp{LEX}. You can use +@samp{AC_PROG_LEX} to do this (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}). Automake's @code{lex} +support also requires that you use the @samp{AC_DECL_YYTEXT} +macro---automake needs to know the value of @samp{LEX_OUTPUT_ROOT}. +This is all handled for you if you use the @code{AM_PROG_LEX} macro +(@pxref{Macros}). + +@cindex ylwrap +@cindex yacc, multiple parsers +@cindex Multiple yacc parsers +@cindex Multiple lex lexers +@cindex lex, multiple lexers + + +Automake makes it possible to include multiple @code{yacc} (or +@code{lex}) source files in a single program. Automake uses a small +program called @code{ylwrap} to run @code{yacc} (or @code{lex}) in a +subdirectory. This is necessary because yacc's output filename is +fixed, and a parallel make could conceivably invoke more than one +instance of @code{yacc} simultaneously. The @code{ylwrap} program is +distributed with Automake. It should appear in the directory specified +by @samp{AC_CONFIG_AUX_DIR} (@pxref{Input, , Finding `configure' Input, +autoconf, The Autoconf Manual}), or the current directory if that macro +is not used in @file{configure.in}. + +For @code{yacc}, simply managing locking is insufficient. The output of +@code{yacc} always uses the same symbol names internally, so it isn't +possible to link two @code{yacc} parsers into the same executable. + +We recommend using the following renaming hack used in @code{gdb}: +@example +#define yymaxdepth c_maxdepth +#define yyparse c_parse +#define yylex c_lex +#define yyerror c_error +#define yylval c_lval +#define yychar c_char +#define yydebug c_debug +#define yypact c_pact +#define yyr1 c_r1 +#define yyr2 c_r2 +#define yydef c_def +#define yychk c_chk +#define yypgo c_pgo +#define yyact c_act +#define yyexca c_exca +#define yyerrflag c_errflag +#define yynerrs c_nerrs +#define yyps c_ps +#define yypv c_pv +#define yys c_s +#define yy_yys c_yys +#define yystate c_state +#define yytmp c_tmp +#define yyv c_v +#define yy_yyv c_yyv +#define yyval c_val +#define yylloc c_lloc +#define yyreds c_reds +#define yytoks c_toks +#define yylhs c_yylhs +#define yylen c_yylen +#define yydefred c_yydefred +#define yydgoto c_yydgoto +#define yysindex c_yysindex +#define yyrindex c_yyrindex +#define yygindex c_yygindex +#define yytable c_yytable +#define yycheck c_yycheck +#define yyname c_yyname +#define yyrule c_yyrule +@end example + +For each define, replace the @samp{c_} prefix with whatever you like. +These defines work for @code{bison}, @code{byacc}, and traditional +@code{yacc}s. If you find a parser generator that uses a symbol not +covered here, please report the new name so it can be added to the list. + + +@node C++ Support, Fortran 77 Support, Yacc and Lex, Programs +@section C++ Support + +@cindex C++ support +@cindex Support for C++ + +Automake includes full support for C++. + +Any package including C++ code must define the output variable +@samp{CXX} in @file{configure.in}; the simplest way to do this is to use +the @code{AC_PROG_CXX} macro (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}). + +A few additional variables are defined when a C++ source file is seen: + +@vtable @code +@item CXX +The name of the C++ compiler. + +@item CXXFLAGS +Any flags to pass to the C++ compiler. + +@item CXXCOMPILE +The command used to actually compile a C++ source file. The file name +is appended to form the complete command line. + +@item CXXLINK +The command used to actually link a C++ program. +@end vtable + + +@node Fortran 77 Support, Support for Other Languages, C++ Support, Programs +@comment node-name, next, previous, up +@section Fortran 77 Support + +@cindex Fortran 77 support +@cindex Support for Fortran 77 + +Automake includes full support for Fortran 77. + +Any package including Fortran 77 code must define the output variable +@samp{F77} in @file{configure.in}; the simplest way to do this is to use +the @code{AC_PROG_F77} macro (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}). @xref{Fortran 77 and +Autoconf}. + +A few additional variables are defined when a Fortran 77 source file is +seen: + +@vtable @code + +@item F77 +The name of the Fortran 77 compiler. + +@item FFLAGS +Any flags to pass to the Fortran 77 compiler. + +@item RFLAGS +Any flags to pass to the Ratfor compiler. + +@item F77COMPILE +The command used to actually compile a Fortran 77 source file. The file +name is appended to form the complete command line. + +@item FLINK +The command used to actually link a pure Fortran 77 program or shared +library. + +@end vtable + +Automake can handle preprocessing Fortran 77 and Ratfor source files in +addition to compiling them@footnote{Much, if not most, of the +information in the following sections pertaining to preprocessing +Fortran 77 programs was taken almost verbatim from @ref{Catalogue of +Rules, , Catalogue of Rules, make, The GNU Make Manual}.}. Automake +also contains some support for creating programs and shared libraries +that are a mixture of Fortran 77 and other languages (@pxref{Mixing +Fortran 77 With C and C++}). + +These issues are covered in the following sections. + +@menu +* Preprocessing Fortran 77:: +* Compiling Fortran 77 Files:: +* Mixing Fortran 77 With C and C++:: +* Fortran 77 and Autoconf:: +@end menu + + +@node Preprocessing Fortran 77, Compiling Fortran 77 Files, Fortran 77 Support, Fortran 77 Support +@comment node-name, next, previous, up +@subsection Preprocessing Fortran 77 + +@cindex Preprocessing Fortran 77 +@cindex Fortran 77, Preprocessing +@cindex Ratfor programs + +@file{N.f} is made automatically from @file{N.F} or @file{N.r}. This +rule runs just the preprocessor to convert a preprocessable Fortran 77 +or Ratfor source file into a strict Fortran 77 source file. The precise +command used is as follows: + +@table @file + +@item .F +@code{$(F77) -F $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)} + +@item .r +@code{$(F77) -F $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)} + +@end table + + +@node Compiling Fortran 77 Files, Mixing Fortran 77 With C and C++, Preprocessing Fortran 77, Fortran 77 Support +@comment node-name, next, previous, up +@subsection Compiling Fortran 77 Files + +@file{N.o} is made automatically from @file{N.f}, @file{N.F} or +@file{N.r} by running the Fortran 77 compiler. The precise command used +is as follows: + +@table @file + +@item .f +@code{$(F77) -c $(AM_FFLAGS) $(FFLAGS)} + +@item .F +@code{$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)} + +@item .r +@code{$(F77) -c $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)} + +@end table + + +@node Mixing Fortran 77 With C and C++, Fortran 77 and Autoconf, Compiling Fortran 77 Files, Fortran 77 Support +@comment node-name, next, previous, up +@subsection Mixing Fortran 77 With C and C++ + +@cindex Fortran 77, mixing with C and C++ +@cindex Mixing Fortran 77 with C and C++ +@cindex Linking Fortran 77 with C and C++ +@cindex cfortran +@cindex Mixing Fortran 77 with C and/or C++ + +Automake currently provides @emph{limited} support for creating programs +and shared libraries that are a mixture of Fortran 77 and C and/or C++. +However, there are many other issues related to mixing Fortran 77 with +other languages that are @emph{not} (currently) handled by Automake, but +that are handled by other packages@footnote{For example, +@uref{http://www-zeus.desy.de/~burow/cfortran/, the cfortran package} +addresses all of these inter-language issues, and runs under nearly all +Fortran 77, C and C++ compilers on nearly all platforms. However, +@code{cfortran} is not yet Free Software, but it will be in the next +major release.}. + +@page +Automake can help in two ways: + +@enumerate +@item +Automatic selection of the linker depending on which combinations of +source code. + +@item +Automatic selection of the appropriate linker flags (e.g. @samp{-L} and +@samp{-l}) to pass to the automatically selected linker in order to link +in the appropriate Fortran 77 intrinsic and run-time libraries. + +@cindex FLIBS, defined +These extra Fortran 77 linker flags are supplied in the output variable +@code{FLIBS} by the @code{AC_F77_LIBRARY_LDFLAGS} Autoconf macro +supplied with newer versions of Autoconf (Autoconf version 2.13 and +later). @xref{Fortran 77 Compiler Characteristics, , , autoconf, The +Autoconf}. +@end enumerate + +If Automake detects that a program or shared library (as mentioned in +some @code{_PROGRAMS} or @code{_LTLIBRARIES} primary) contains source +code that is a mixture of Fortran 77 and C and/or C++, then it requires +that the macro @code{AC_F77_LIBRARY_LDFLAGS} be called in +@file{configure.in}, and that either @code{$(FLIBS)} or @code{@@FLIBS@@} +appear in the appropriate @code{_LDADD} (for programs) or @code{_LIBADD} +(for shared libraries) variables. It is the responsibility of the +person writing the @file{Makefile.am} to make sure that @code{$(FLIBS)} +or @code{@@FLIBS@@} appears in the appropriate @code{_LDADD} or +@code{_LIBADD} variable. + +@cindex Mixed language example +@cindex Example, mixed language + +For example, consider the following @file{Makefile.am}: + +@example +bin_PROGRAMS = foo +foo_SOURCES = main.cc foo.f +foo_LDADD = libfoo.la @@FLIBS@@ + +pkglib_LTLIBRARIES = libfoo.la +libfoo_la_SOURCES = bar.f baz.c zardoz.cc +libfoo_la_LIBADD = $(FLIBS) +@end example + +In this case, Automake will insist that @code{AC_F77_LIBRARY_LDFLAGS} +is mentioned in @file{configure.in}. Also, if @code{@@FLIBS@@} hadn't +been mentioned in @code{foo_LDADD} and @code{libfoo_la_LIBADD}, then +Automake would have issued a warning. + + +@page +@menu +* How the Linker is Chosen:: +@end menu + +@node How the Linker is Chosen, , Mixing Fortran 77 With C and C++, Mixing Fortran 77 With C and C++ +@comment node-name, next, previous, up +@subsubsection How the Linker is Chosen + +@cindex Automatic linker selection +@cindex Selecting the linker automatically + +The following diagram demonstrates under what conditions a particular +linker is chosen by Automake. + +For example, if Fortran 77, C and C++ source code were to be compiled +into a program, then the C++ linker will be used. In this case, if the +C or Fortran 77 linkers required any special libraries that weren't +included by the C++ linker, then they must be manually added to an +@code{_LDADD} or @code{_LIBADD} variable by the user writing the +@file{Makefile.am}. + +@example + \ Linker + source \ + code \ C C++ Fortran + ----------------- +---------+---------+---------+ + | | | | + C | x | | | + | | | | + +---------+---------+---------+ + | | | | + C++ | | x | | + | | | | + +---------+---------+---------+ + | | | | + Fortran | | | x | + | | | | + +---------+---------+---------+ + | | | | + C + C++ | | x | | + | | | | + +---------+---------+---------+ + | | | | + C + Fortran | | | x | + | | | | + +---------+---------+---------+ + | | | | + C++ + Fortran | | x | | + | | | | + +---------+---------+---------+ + | | | | + C + C++ + Fortran | | x | | + | | | | + +---------+---------+---------+ +@end example + + +@node Fortran 77 and Autoconf, , Mixing Fortran 77 With C and C++, Fortran 77 Support +@comment node-name, next, previous, up +@subsection Fortran 77 and Autoconf + +The current Automake support for Fortran 77 requires a recent enough +version Autoconf that also includes support for Fortran 77. Full +Fortran 77 support was added to Autoconf 2.13, so you will want to use +that version of Autoconf or later. + + +@node Support for Other Languages, ANSI, Fortran 77 Support, Programs +@comment node-name, next, previous, up +@section Support for Other Languages + +Automake currently only includes full support for C, C++ (@pxref{C++ +Support})and Fortran 77 (@pxref{Fortran 77 Support}). There is only +rudimentary support for other languages, support for which will be +improved based on user demand. + + +@node ANSI, Dependencies, Support for Other Languages, Programs +@section Automatic de-ANSI-fication + +@cindex de-ANSI-fication, defined + +Although the GNU standards allow the use of ANSI C, this can have the +effect of limiting portability of a package to some older compilers +(notably SunOS). + +Automake allows you to work around this problem on such machines by +@dfn{de-ANSI-fying} each source file before the actual compilation takes +place. + +@vindex AUTOMAKE_OPTIONS +@opindex ansi2knr + +If the @file{Makefile.am} variable @code{AUTOMAKE_OPTIONS} +(@pxref{Options}) contains the option @code{ansi2knr} then code to +handle de-ANSI-fication is inserted into the generated +@file{Makefile.in}. + +This causes each C source file in the directory to be treated as ANSI C. +If an ANSI C compiler is available, it is used. If no ANSI C compiler +is available, the @code{ansi2knr} program is used to convert the source +files into K&R C, which is then compiled. + +The @code{ansi2knr} program is simple-minded. It assumes the source +code will be formatted in a particular way; see the @code{ansi2knr} man +page for details. + +Support for de-ANSI-fication requires the source files @file{ansi2knr.c} +and @file{ansi2knr.1} to be in the same package as the ANSI C source; +these files are distributed with Automake. Also, the package +@file{configure.in} must call the macro @code{AM_C_PROTOTYPES} +(@pxref{Macros}). +@cvindex AM_C_PROTOTYPES + +Automake also handles finding the @code{ansi2knr} support files in some +other directory in the current package. This is done by prepending the +relative path to the appropriate directory to the @code{ansi2knr} +option. For instance, suppose the package has ANSI C code in the +@file{src} and @file{lib} subdirs. The files @file{ansi2knr.c} and +@file{ansi2knr.1} appear in @file{lib}. Then this could appear in +@file{src/Makefile.am}: + +@example +AUTOMAKE_OPTIONS = ../lib/ansi2knr +@end example + +If no directory prefix is given, the files are assumed to be in the +current directory. + +Files mentioned in @code{LIBOBJS} which need de-ANSI-fication will not +be automatically handled. That's because @code{configure} will generate +an object name like @file{regex.o}, while @code{make} will be looking +for @file{regex_.o} (when de-ANSI-fying). Eventually this problem will +be fixed via @code{autoconf} magic, but for now you must put this code +into your @file{configure.in}, just before the @code{AC_OUTPUT} call: + +@example +# This is necessary so that .o files in LIBOBJS are also built via +# the ANSI2KNR-filtering rules. +LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` +@end example + + +@node Dependencies, , ANSI, Programs +@section Automatic dependency tracking + +As a developer it is often painful to continually update the +@file{Makefile.in} whenever the include-file dependencies change in a +project. Automake supplies a way to automatically track dependency +changes, and distribute the dependencies in the generated +@file{Makefile.in}. + +Currently this support requires the use of GNU @code{make} and +@code{gcc}. It might become possible in the future to supply a +different dependency generating program, if there is enough demand. In +the meantime, this mode is enabled by default if any C program or +library is defined in the current directory, so you may get a @samp{Must +be a separator} error from non-GNU make. + +@trindex dist + +When you decide to make a distribution, the @code{dist} target will +re-run @code{automake} with @samp{--include-deps} and other options. +@xref{Invoking Automake}, and @ref{Options}. This will cause the +previously generated dependencies to be inserted into the generated +@file{Makefile.in}, and thus into the distribution. This step also +turns off inclusion of the dependency generation code, so that those who +download your distribution but don't use GNU @code{make} and @code{gcc} +will not get errors. + +@vindex OMIT_DEPENDENCIES + +When added to the @file{Makefile.in}, the dependencies have all +system-specific dependencies automatically removed. This can be done by +listing the files in @samp{OMIT_DEPENDENCIES}. For instance all +references to system header files are removed by Automake. Sometimes it +is useful to specify that a certain header file should be removed. For +instance if your @file{configure.in} uses @samp{AM_WITH_REGEX}, then any +dependency on @file{rx.h} or @file{regex.h} should be removed, because +the correct one cannot be known until the user configures the package. + +As it turns out, Automake is actually smart enough to handle the +particular case of the regular expression header. It will also +automatically omit @file{libintl.h} if @samp{AM_GNU_GETTEXT} is used. + +@vindex AUTOMAKE_OPTIONS +@opindex no-dependencies + +Automatic dependency tracking can be suppressed by putting +@code{no-dependencies} in the variable @code{AUTOMAKE_OPTIONS}. + +If you unpack a distribution made by @code{make dist}, and you want to +turn on the dependency-tracking code again, simply re-run +@code{automake}. + +The actual dependency files are put under the build directory, in a +subdirectory named @file{.deps}. These dependencies are machine +specific. It is safe to delete them if you like; they will be +automatically recreated during the next build. + + +@node Other objects, Other GNU Tools, Programs, Top +@chapter Other Derived Objects + +Automake can handle derived objects which are not C programs. Sometimes +the support for actually building such objects must be explicitly +supplied, but Automake will still automatically handle installation and +distribution. + +@menu +* Scripts:: Executable scripts +* Headers:: Header files +* Data:: Architecture-independent data files +* Sources:: Derived sources +@end menu + + +@node Scripts, Headers, Other objects, Other objects +@section Executable Scripts + +@cindex _SCRIPTS primary, defined +@cindex SCRIPTS primary, defined +@cindex Primary variable, SCRIPTS + +It is possible to define and install programs which are scripts. Such +programs are listed using the @samp{SCRIPTS} primary name. Automake +doesn't define any dependencies for scripts; the @file{Makefile.am} +should include the appropriate rules. +@vindex SCRIPTS + +Automake does not assume that scripts are derived objects; such objects +must be deleted by hand (@pxref{Clean}). + +The @code{automake} program itself is a Perl script that is generated at +configure time from @file{automake.in}. Here is how this is handled: + +@example +bin_SCRIPTS = automake +@end example + +Since @code{automake} appears in the @code{AC_OUTPUT} macro, a target +for it is automatically generated. + +@cindex SCRIPTS, installation directories +@cindex Installing scripts + +@vindex bin_SCRIPTS +@vindex sbin_SCRIPTS +@vindex libexec_SCRIPTS +@vindex pkgdata_SCRIPTS +@vindex noinst_SCRIPTS + +Script objects can be installed in @code{bindir}, @code{sbindir}, +@code{libexecdir}, or @code{pkgdatadir}. + + +@node Headers, Data, Scripts, Other objects +@section Header files + +@cindex _HEADERS primary, defined +@cindex HEADERS primary, defined +@cindex Primary variable, HEADERS + +@vindex noinst_HEADERS + +Header files are specified by the @samp{HEADERS} family of variables. +Generally header files are not installed, so the @code{noinst_HEADERS} +variable will be the most used. +@vindex HEADERS + +All header files must be listed somewhere; missing ones will not appear +in the distribution. Often it is clearest to list uninstalled headers +with the rest of the sources for a program. @xref{A Program}. Headers +listed in a @samp{_SOURCES} variable need not be listed in any +@samp{_HEADERS} variable. + +@cindex HEADERS, installation directories +@cindex Installing headers + +@vindex include_HEADERS +@vindex oldinclude_HEADERS +@vindex pkginclude_HEADERS + +Headers can be installed in @code{includedir}, @code{oldincludedir}, or +@code{pkgincludedir}. + + +@node Data, Sources, Headers, Other objects +@section Architecture-independent data files + +@cindex _DATA primary, defined +@cindex DATA primary, defined +@cindex Primary variable, DATA + +Automake supports the installation of miscellaneous data files using the +@samp{DATA} family of variables. +@vindex DATA + +@vindex data_DATA +@vindex sysconf_DATA +@vindex sharedstate_DATA +@vindex localstate_DATA +@vindex pkgdata_DATA + +Such data can be installed in the directories @code{datadir}, +@code{sysconfdir}, @code{sharedstatedir}, @code{localstatedir}, or +@code{pkgdatadir}. + +By default, data files are @emph{not} included in a distribution. + +Here is how Automake installs its auxiliary data files: + +@example +pkgdata_DATA = clean-kr.am clean.am @dots{} +@end example + + +@node Sources, , Data, Other objects +@section Built sources + +@cindex BUILT_SOURCES, defined + +Occasionally a file which would otherwise be called @samp{source} +(e.g. a C @samp{.h} file) is actually derived from some other file. +Such files should be listed in the @code{BUILT_SOURCES} variable. +@vindex BUILT_SOURCES + +Built sources are also not compiled by default. You must explicitly +mention them in some other @samp{_SOURCES} variable for this to happen. + +Note that, in some cases, @code{BUILT_SOURCES} will work in somewhat +surprising ways. In order to get the built sources to work with +automatic dependency tracking, the @file{Makefile} must depend on +@code{$(BUILT_SOURCES)}. This can cause these sources to be rebuilt at +what might seem like funny times. + + +@node Other GNU Tools, Documentation, Other objects, Top +@chapter Other GNU Tools + +Since Automake is primarily intended to generate @file{Makefile.in}s for +use in GNU programs, it tries hard to interoperate with other GNU tools. + +@menu +* Emacs Lisp:: Emacs Lisp +* gettext:: Gettext +* Guile:: Guile +* Libtool:: Libtool +* Java:: Java +@end menu + + +@node Emacs Lisp, gettext, Other GNU Tools, Other GNU Tools +@section Emacs Lisp + +@cindex _LISP primary, defined +@cindex LISP primary, defined +@cindex Primary variable, LISP + +@vindex LISP +@vindex lisp_LISP +@vindex noinst_LISP + +Automake provides some support for Emacs Lisp. The @samp{LISP} primary +is used to hold a list of @file{.el} files. Possible prefixes for this +primary are @samp{lisp_} and @samp{noinst_}. Note that if +@code{lisp_LISP} is defined, then @file{configure.in} must run +@code{AM_PATH_LISPDIR} (@pxref{Macros}). + +@vindex ELCFILES + +By default Automake will byte-compile all Emacs Lisp source files using +the Emacs found by @code{AM_PATH_LISPDIR}. If you wish to avoid +byte-compiling, simply define the variable @code{ELCFILES} to be empty. +Byte-compiled Emacs Lisp files are not portable among all versions of +Emacs, so it makes sense to turn this off if you expect sites to have +more than one version of Emacs installed. Furthermore, many packages +don't actually benefit from byte-compilation. Still, we recommend that +you leave it enabled by default. It is probably better for sites with +strange setups to cope for themselves than to make the installation less +nice for everybody else. + + +@node gettext, Guile, Emacs Lisp, Other GNU Tools +@section Gettext + +@cindex GNU Gettext support +@cindex Gettext support +@cindex Support for GNU Gettext + +If @code{AM_GNU_GETTEXT} is seen in @file{configure.in}, then Automake +turns on support for GNU gettext, a message catalog system for +internationalization +(@pxref{GNU Gettext, , , gettext, GNU gettext utilities}). + +The @code{gettext} support in Automake requires the addition of two +subdirectories to the package, @file{intl} and @file{po}. Automake +insures that these directories exist and are mentioned in +@code{SUBDIRS}. + +Furthermore, Automake checks that the definition of @code{ALL_LINGUAS} +in @file{configure.in} corresponds to all the valid @file{.po} files, +and nothing more. + + +@node Guile, Libtool, gettext, Other GNU Tools +@section Guile + +Automake provides some automatic support for writing Guile modules. +Automake will turn on Guile support if the @code{AM_INIT_GUILE_MODULE} +macro is used in @file{configure.in}. + +Right now Guile support just means that the @code{AM_INIT_GUILE_MODULE} +macro is understood to mean: +@itemize @bullet +@item +@code{AM_INIT_AUTOMAKE} is run. + +@item +@code{AC_CONFIG_AUX_DIR} is run, with a path of @file{..}. +@end itemize + +As the Guile module code matures, no doubt the Automake support will +grow as well. + + +@node Libtool, Java, Guile, Other GNU Tools +@section Libtool + +Automake provides support for GNU Libtool (@pxref{Top, , Introduction, +libtool, The Libtool Manual}) with the @samp{LTLIBRARIES} primary. +@xref{A Shared Library}. + + +@node Java, , Libtool, Other GNU Tools +@section Java + +@cindex _JAVA primary, defined +@cindex JAVA primary, defined +@cindex Primary variable, JAVA + +Automake provides some minimal support for Java compilation with the +@samp{JAVA} primary. + +Any @file{.java} files listed in a @samp{_JAVA} variable will be +compiled with @code{JAVAC} at build time. By default, @file{.class} +files are not included in the distribution. + +@cindex JAVA restrictions +@cindex Restrictions for JAVA + +Currently Automake enforces the restriction that only one @samp{_JAVA} +primary can be used in a given @file{Makefile.am}. The reason for this +restriction is that, in general, it isn't possible to know which +@file{.class} files were generated from which @file{.java} files -- so +it would be impossible to know which files to install where. + + +@node Documentation, Install, Other GNU Tools, Top +@chapter Building documentation + +Currently Automake provides support for Texinfo and man pages. + +@menu +* Texinfo:: Texinfo +* Man pages:: Man pages +@end menu + + +@node Texinfo, Man pages, Documentation, Documentation +@section Texinfo + +@cindex _TEXINFOS primary, defined +@cindex TEXINFOS primary, defined +@cindex Primary variable, TEXINFOS + +If the current directory contains Texinfo source, you must declare it +with the @samp{TEXINFOS} primary. Generally Texinfo files are converted +into info, and thus the @code{info_TEXINFOS} macro is most commonly used +here. Note that any Texinfo source file must end in the @file{.texi} or +@file{.texinfo} extension. +@vindex TEXINFOS +@vindex info_TEXINFOS + +@cindex Texinfo macro, VERSION +@cindex Texinfo macro, UPDATED +@cindex Texinfo macro, EDITION + +@cindex VERSION Texinfo macro +@cindex UPDATED Texinfo macro +@cindex EDITION Texinfo macro + +@cindex mdate-sh + +If the @file{.texi} file @code{@@include}s @file{version.texi}, then +that file will be automatically generated. The file @file{version.texi} +defines three Texinfo macros you can reference: @code{EDITION}, +@code{VERSION}, and @code{UPDATED}. The first two hold the version +number of your package (but are kept separate for clarity); the last is +the date the primary file was last modified. The @file{version.texi} +support requires the @code{mdate-sh} program; this program is supplied +with Automake and automatically included when @code{automake} is invoked +with the @code{--add-missing} option. + +Sometimes an info file actually depends on more than one @file{.texi} +file. For instance, in GNU Hello, @file{hello.texi} includes the file +@file{gpl.texi}. You can tell Automake about these dependencies using +the @code{@var{texi}_TEXINFOS} variable. Here is how GNU Hello does it: +@vindex TEXINFOS +@vindex _TEXINFOS + +@example +info_TEXINFOS = hello.texi +hello_TEXINFOS = gpl.texi +@end example + +@cindex texinfo.tex + +By default, Automake requires the file @file{texinfo.tex} to appear in +the same directory as the Texinfo source. However, if you used +@code{AC_CONFIG_AUX_DIR} in @file{configure.in} (@pxref{Input, , Finding +`configure' Input, autoconf, The Autoconf Manual}), then +@file{texinfo.tex} is looked for there. Automake supplies +@file{texinfo.tex} if @samp{--add-missing} is given. + +@vindex TEXINFO_TEX + +If your package has Texinfo files in many directories, you can use the +variable @code{TEXINFO_TEX} to tell Automake where to find the canonical +@file{texinfo.tex} for your package. The value of this variable should +be the relative path from the current @file{Makefile.am} to +@file{texinfo.tex}: + +@example +TEXINFO_TEX = ../doc/texinfo.tex +@end example + +@opindex no-texinfo.tex + +The option @samp{no-texinfo.tex} can be used to eliminate the +requirement for @file{texinfo.tex}. Use of the variable +@code{TEXINFO_TEX} is preferable, however, because that allows the +@code{dvi} target to still work. + +@cindex Target, install-info +@cindex Target, noinstall-info +@cindex install-info target +@cindex noinstall-info target + +@opindex no-installinfo +@trindex install-info + +Automake generates an @code{install-info} target; some people apparently +use this. By default, info pages are installed by @samp{make install}. +This can be prevented via the @code{no-installinfo} option. + + +@node Man pages, , Texinfo, Documentation +@section Man pages + +@cindex _MANS primary, defined +@cindex MANS primary, defined +@cindex Primary variable, MANS + +A package can also include man pages (but see the GNU standards on this +matter, @ref{Man Pages, , , standards, The GNU Coding Standards}.) Man +pages are declared using the @samp{MANS} primary. Generally the +@code{man_MANS} macro is used. Man pages are automatically installed in +the correct subdirectory of @code{mandir}, based on the file extension. +They are not automatically included in the distribution. +@vindex MANS +@vindex man_MANS + +@cindex Target, install-man +@cindex Target, noinstall-man +@cindex install-man target +@cindex noinstall-man target + +@c Use @samp{make install} per documentation: (texi)code. +By default, man pages are installed by @samp{make install}. However, +since the GNU project does not require man pages, many maintainers do +not expend effort to keep the man pages up to date. In these cases, the +@code{no-installman} option will prevent the man pages from being +installed by default. The user can still explicitly install them via +@samp{make install-man}. +@opindex no-installman +@trindex install-man + +Here is how the documentation is handled in GNU @code{cpio} (which +includes both Texinfo documentation and man pages): + +@example +info_TEXINFOS = cpio.texi +man_MANS = cpio.1 mt.1 +EXTRA_DIST = $(man_MANS) +@end example + +Texinfo source and info pages are all considered to be source for the +purposes of making a distribution. + +Man pages are not currently considered to be source, because it is not +uncommon for man pages to be automatically generated. For the same +reason, they are not automatically included in the distribution. + + +@node Install, Clean, Documentation, Top +@chapter What Gets Installed + +@cindex Installation support +@cindex make install support + +Naturally, Automake handles the details of actually installing your +program once it has been built. All @code{PROGRAMS}, @code{SCRIPTS}, +@code{LIBRARIES}, @code{LISP}, @code{DATA} and @code{HEADERS} are +automatically installed in the appropriate places. + +Automake also handles installing any specified info and man pages. + +Automake generates separate @code{install-data} and @code{install-exec} +targets, in case the installer is installing on multiple machines which +share directory structure---these targets allow the machine-independent +parts to be installed only once. The @code{install} target depends on +both of these targets. +@trindex install-data +@trindex install-exec +@trindex install + +Automake also generates an @code{uninstall} target, an +@code{installdirs} target, and an @code{install-strip} target. +@trindex uninstall +@trindex installdirs +@trindex install-strip + +It is possible to extend this mechanism by defining an +@code{install-exec-local} or @code{install-data-local} target. If these +targets exist, they will be run at @samp{make install} time. +@trindex install-exec-local +@trindex install-data-local + +Variables using the standard directory prefixes @samp{data}, +@samp{info}, @samp{man}, @samp{include}, @samp{oldinclude}, +@samp{pkgdata}, or @samp{pkginclude} (e.g. @samp{data_DATA}) are +installed by @samp{install-data}. + +Variables using the standard directory prefixes @samp{bin}, @samp{sbin}, +@samp{libexec}, @samp{sysconf}, @samp{localstate}, @samp{lib}, or +@samp{pkglib} (e.g. @samp{bin_PROGRAMS}) are installed by +@samp{install-exec}. + +Any variable using a user-defined directory prefix with @samp{exec} in +the name (e.g. @samp{myexecbin_PROGRAMS} is installed by +@samp{install-exec}. All other user-defined prefixes are installed by +@samp{install-data}. + +@vindex DESTDIR +Automake generates support for the @samp{DESTDIR} variable in all +install rules. @samp{DESTDIR} is used during the @samp{make install} +step to relocate install objects into a staging area. Each object and +path is prefixed with the value of @samp{DESTDIR} before being copied +into the install area. Here is an example of typical DESTDIR usage: + +@example +make DESTDIR=/tmp/staging install +@end example + +This places install objects in a directory tree built under +@file{/tmp/staging}. If @file{/gnu/bin/foo} and +@file{/gnu/share/aclocal/foo.m4} are to be installed, the above command +would install @file{/tmp/staging/gnu/bin/foo} and +@file{/tmp/staging/gnu/share/aclocal/foo.m4}. + +This feature is commonly used to build install images and packages. For +more information, see @ref{Makefile Conventions, , , standards, The GNU +Coding Standards}. + + +@node Clean, Dist, Install, Top +@chapter What Gets Cleaned + +@cindex make clean support + +The GNU Makefile Standards specify a number of different clean rules. +@c FIXME xref +Generally the files that can be cleaned are determined automatically by +Automake. Of course, Automake also recognizes some variables that can +be defined to specify additional files to clean. These variables are +@code{MOSTLYCLEANFILES}, @code{CLEANFILES}, @code{DISTCLEANFILES}, and +@code{MAINTAINERCLEANFILES}. +@vindex MOSTLYCLEANFILES +@vindex CLEANFILES +@vindex DISTCLEANFILES +@vindex MAINTAINERCLEANFILES + + +@node Dist, Tests, Clean, Top +@chapter What Goes in a Distribution + +@cindex make dist +@cindex make distcheck + +The @code{dist} target in the generated @file{Makefile.in} can be used +to generate a gzip'd @code{tar} file for distribution. The tar file is +named based on the @samp{PACKAGE} and @samp{VERSION} variables; more +precisely it is named @samp{@var{package}-@var{version}.tar.gz}. +@cvindex PACKAGE +@cvindex VERSION +@trindex dist +You can use the @code{make} variable @samp{GZIP_ENV} to control how gzip +is run. The default setting is @samp{--best}. + +For the most part, the files to distribute are automatically found by +Automake: all source files are automatically included in a distribution, +as are all @file{Makefile.am}s and @file{Makefile.in}s. Automake also +has a built-in list of commonly used files which, if present in the +current directory, are automatically included. This list is printed by +@samp{automake --help}. Also, files which are read by @code{configure} +(i.e. the source files corresponding to the files specified in the +@code{AC_OUTPUT} invocation) are automatically distributed. + +Still, sometimes there are files which must be distributed, but which +are not covered in the automatic rules. These files should be listed in +the @code{EXTRA_DIST} variable. You can mention files from +subdirectories in @code{EXTRA_DIST}. You can also mention a directory +there; in this case the entire directory will be recursively copied into +the distribution. +@vindex EXTRA_DIST + +If you define @code{SUBDIRS}, Automake will recursively include the +subdirectories in the distribution. If @code{SUBDIRS} is defined +conditionally (@pxref{Conditionals}), Automake will normally include all +directories that could possibly appear in @code{SUBDIRS} in the +distribution. If you need to specify the set of directories +conditionally, you can set the variable @code{DIST_SUBDIRS} to the exact +list of subdirectories to include in the distribution. +@vindex DIST_SUBDIRS + +@trindex dist-hook + +Occasionally it is useful to be able to change the distribution before +it is packaged up. If the @code{dist-hook} target exists, it is run +after the distribution directory is filled, but before the actual tar +(or shar) file is created. One way to use this is for distributing +files in subdirectories for which a new @file{Makefile.am} is overkill: + +@example +dist-hook: + mkdir $(distdir)/random + cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random +@end example + +Automake also generates a @code{distcheck} target which can be help to +ensure that a given distribution will actually work. @code{distcheck} +makes a distribution, and then tries to do a @code{VPATH} build. +@trindex distcheck +@c FIXME: document distcheck-hook here + + +@node Tests, Options, Dist, Top +@chapter Support for test suites + +@cindex Test suites +@cindex make check + +Automake supports two forms of test suites. + +If the variable @code{TESTS} is defined, its value is taken to be a list +of programs to run in order to do the testing. The programs can either +be derived objects or source objects; the generated rule will look both +in @code{srcdir} and @file{.}. Programs needing data files should look +for them in @code{srcdir} (which is both an environment variable and a +make variable) so they work when building in a separate directory +(@pxref{Build Directories, , Build Directories , autoconf, The Autoconf +Manual}), and in particular for the @code{distcheck} target +(@pxref{Dist}). + +@cindex Exit status 77, special interpretation + +The number of failures will be printed at the end of the run. If a +given test program exits with a status of 77, then its result is ignored +in the final count. This feature allows non-portable tests to be +ignored in environments where they don't make sense. + +The variable @code{TESTS_ENVIRONMENT} can be used to set environment +variables for the test run; the environment variable @code{srcdir} is +set in the rule. If all your test programs are scripts, you can also +set @code{TESTS_ENVIRONMENT} to an invocation of the shell (e.g. +@samp{$(SHELL) -x}); this can be useful for debugging the tests. +@vindex TESTS +@vindex TESTS_ENVIRONMENT + +If @uref{ftp://prep.ai.mit.edu/pub/gnu/dejagnu-1.3.tar.gz, +@samp{dejagnu}} appears in @code{AUTOMAKE_OPTIONS}, then a +@code{dejagnu}-based test suite is assumed. The value of the variable +@code{DEJATOOL} is passed as the @code{--tool} argument to +@code{runtest}; it defaults to the name of the package. + +The variable @code{RUNTESTDEFAULTFLAGS} holds the @code{--tool} and +@code{--srcdir} flags that are passed to dejagnu by default; this can be +overridden if necessary. +@vindex RUNTESTDEFAULTFLAGS + +The variables @code{EXPECT}, @code{RUNTEST} and @code{RUNTESTFLAGS} can +also be overridden to provide project-specific values. For instance, +you will need to do this if you are testing a compiler toolchain, +because the default values do not take into account host and target +names. +@opindex dejagnu +@vindex DEJATOOL +@vindex EXPECT +@vindex RUNTEST +@vindex RUNTESTFLAGS +@c FIXME xref dejagnu + +In either case, the testing is done via @samp{make check}. + + +@node Options, Miscellaneous, Tests, Top +@chapter Changing Automake's Behavior + +Various features of Automake can be controlled by options in the +@file{Makefile.am}. Such options are listed in a special variable named +@code{AUTOMAKE_OPTIONS}. Currently understood options are: +@vindex AUTOMAKE_OPTIONS + +@table @asis +@item @code{gnits} +@itemx @code{gnu} +@itemx @code{foreign} +@item @code{cygnus} +@cindex Option, gnits +@cindex Option, gnu +@cindex Option, foreign +@cindex Option, cygnus + +Set the strictness as appropriate. The @code{gnits} option also implies +@code{readme-alpha} and @code{check-news}. + +@item @code{ansi2knr} +@itemx @code{path/ansi2knr} +@cindex Option, ansi2knr +Turn on automatic de-ANSI-fication. @xref{ANSI}. If preceded by a +path, the generated @file{Makefile.in} will look in the specified +directory to find the @file{ansi2knr} program. Generally the path +should be a relative path to another directory in the same distribution +(though Automake currently does not check this). + +@item @code{check-news} +@cindex Option, check-news +Cause @code{make dist} to fail unless the current version number appears +in the first few lines of the @file{NEWS} file. + +@item @code{dejagnu} +@cindex Option, dejagnu +Cause @code{dejagnu}-specific rules to be generated. @xref{Tests}. + +@item @code{dist-shar} +@cindex Option, dist-shar +Generate a @code{dist-shar} target as well as the ordinary @code{dist} +target. This new target will create a shar archive of the +distribution. +@trindex dist-shar + +@item @code{dist-zip} +@cindex Option, dist-zip +Generate a @code{dist-zip} target as well as the ordinary @code{dist} +target. This new target will create a zip archive of the distribution. +@trindex dist-zip + +@item @code{dist-tarZ} +@cindex Option, dist-tarZ +Generate a @code{dist-tarZ} target as well as the ordinary @code{dist} +target. This new target will create a compressed tar archive of the +distribution; a traditional @code{tar} and @code{compress} will be +assumed. Warning: if you are actually using @code{GNU tar}, then the +generated archive might contain nonportable constructs. +@trindex dist-tarZ + +@item @code{no-dependencies} +@cindex Option, no-dependencies +This is similar to using @samp{--include-deps} on the command line, but +is useful for those situations where you don't have the necessary bits +to make automatic dependency tracking work @xref{Dependencies}. In this +case the effect is to effectively disable automatic dependency tracking. + +@item @code{no-installinfo} +@cindex Option, no-installinfo +The generated @file{Makefile.in} will not cause info pages to be built +or installed by default. However, @code{info} and @code{install-info} +targets will still be available. This option is disallowed at +@samp{GNU} strictness and above. +@trindex info +@trindex install-info + +@item @code{no-installman} +@cindex Option, no-installman +The generated @file{Makefile.in} will not cause man pages to be +installed by default. However, an @code{install-man} target will still +be available for optional installation. This option is disallowed at +@samp{GNU} strictness and above. +@trindex install-man + +@item @code{no-texinfo.tex} +@cindex Option, no-texinfo +Don't require @file{texinfo.tex}, even if there are texinfo files in +this directory. + +@item @code{readme-alpha} +@cindex Option, readme-alpha +If this release is an alpha release, and the file @file{README-alpha} +exists, then it will be added to the distribution. If this option is +given, version numbers are expected to follow one of two forms. The +first form is @samp{@var{MAJOR}.@var{MINOR}.@var{ALPHA}}, where each +element is a number; the final period and number should be left off for +non-alpha releases. The second form is +@samp{@var{MAJOR}.@var{MINOR}@var{ALPHA}}, where @var{ALPHA} is a +letter; it should be omitted for non-alpha releases. + +@item @var{version} +@cindex Option, version +A version number (e.g. @samp{0.30}) can be specified. If Automake is not +newer than the version specified, creation of the @file{Makefile.in} +will be suppressed. +@end table + +Unrecognized options are diagnosed by @code{automake}. + + +@node Miscellaneous, Include, Options, Top +@chapter Miscellaneous Rules + +There are a few rules and variables that didn't fit anywhere else. + +@menu +* Tags:: Interfacing to etags and mkid +* Suffixes:: Handling new file extensions +@end menu + + +@node Tags, Suffixes, Miscellaneous, Miscellaneous +@section Interfacing to @code{etags} + +@cindex TAGS support + +Automake will generate rules to generate @file{TAGS} files for use with +GNU Emacs under some circumstances. + +If any C, C++ or Fortran 77 source code or headers are present, then +@code{tags} and @code{TAGS} targets will be generated for the directory. +@trindex tags + +At the topmost directory of a multi-directory package, a @code{tags} +target file will be generated which, when run, will generate a +@file{TAGS} file that includes by reference all @file{TAGS} files from +subdirectories. + +Also, if the variable @code{ETAGS_ARGS} is defined, a @code{tags} target +will be generated. This variable is intended for use in directories +which contain taggable source that @code{etags} does not understand. +@vindex ETAGS_ARGS + +Here is how Automake generates tags for its source, and for nodes in its +Texinfo file: + +@example +ETAGS_ARGS = automake.in --lang=none \ + --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi +@end example + +If you add filenames to @samp{ETAGS_ARGS}, you will probably also +want to set @samp{TAGS_DEPENDENCIES}. The contents of this variable +are added directly to the dependencies for the @code{tags} target. +@vindex TAGS_DEPENDENCIES + +Automake will also generate an @code{ID} target which will run +@code{mkid} on the source. This is only supported on a +directory-by-directory basis. +@trindex id + + +@node Suffixes, , Tags, Miscellaneous +@section Handling new file extensions + +@cindex Adding new SUFFIXES +@cindex SUFFIXES, adding + +It is sometimes useful to introduce a new implicit rule to handle a file +type that Automake does not know about. If this is done, you must +notify GNU Make of the new suffixes. This can be done by putting a list +of new suffixes in the @code{SUFFIXES} variable. +@vindex SUFFIXES + +For instance, currently Automake does not provide any Java support. If +you wrote a macro to generate @samp{.class} files from @samp{.java} +source files, you would also need to add these suffixes to the list: + +@example +SUFFIXES = .java .class +@end example + + +@node Include, Conditionals, Miscellaneous, Top +@chapter Include + +@cmindex include +To include another file (perhaps for common rules), +the following syntax is supported: + +include ($(srcdir)|$(top_srcdir))/filename + +Using files in the current directory: +@example +include $(srcdir)/Makefile.extra +@end example + +@example +include Makefile.generated +@end example + +Using a file in the top level directory: +@example +include $(top_srcdir)/filename +@end example + + +@node Conditionals, Gnits, Include, Top +@chapter Conditionals + +@cindex Conditionals + +Automake supports a simple type of conditionals. + +@cvindex AM_CONDITIONAL +Before using a conditional, you must define it by using +@code{AM_CONDITIONAL} in the @code{configure.in} file (@pxref{Macros}). +The @code{AM_CONDITIONAL} macro takes two arguments. + +The first argument to @code{AM_CONDITIONAL} is the name of the +conditional. This should be a simple string starting with a letter and +containing only letters, digits, and underscores. + +The second argument to @code{AM_CONDITIONAL} is a shell condition, +suitable for use in a shell @code{if} statement. The condition is +evaluated when @code{configure} is run. + +@cindex --enable-debug, example +@cindex Example conditional --enable-debug +@cindex Conditional example, --enable-debug + +Conditionals typically depend upon options which the user provides to +the @code{configure} script. Here is an example of how to write a +conditional which is true if the user uses the @samp{--enable-debug} +option. + +@example +AC_ARG_ENABLE(debug, +[ --enable-debug Turn on debugging], +[case "$@{enableval@}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR(bad value $@{enableval@} for --enable-debug) ;; +esac],[debug=false]) +AM_CONDITIONAL(DEBUG, test x$debug = xtrue) +@end example + +Here is an example of how to use that conditional in @file{Makefile.am}: + +@cmindex if +@cmindex endif +@cmindex else + +@example +if DEBUG +DBG = debug +else +DBG = +endif +noinst_PROGRAMS = $(DBG) +@end example + +This trivial example could also be handled using EXTRA_PROGRAMS +(@pxref{A Program}). + +You may only test a single variable in an @code{if} statement. The +@code{else} statement may be omitted. Conditionals may be nested to any +depth. + +Note that conditionals in Automake are not the same as conditionals in +GNU Make. Automake conditionals are checked at configure time by the +@file{configure} script, and affect the translation from +@file{Makefile.in} to @file{Makefile}. They are based on options passed +to @file{configure} and on results that @file{configure} has discovered +about the host system. GNU Make conditionals are checked at @code{make} +time, and are based on variables passed to the make program or defined +in the @file{Makefile}. + +Automake conditionals will work with any make program. + + +@node Gnits, Cygnus, Conditionals, Top +@chapter The effect of @code{--gnu} and @code{--gnits} + +@cindex --gnu, required files +@cindex --gnu, complete description + +The @samp{--gnu} option (or @samp{gnu} in the @samp{AUTOMAKE_OPTIONS} +variable) causes @code{automake} to check the following: + +@itemize @bullet +@item +The files @file{INSTALL}, @file{NEWS}, @file{README}, @file{COPYING}, +@file{AUTHORS}, and @file{ChangeLog} are required at the topmost +directory of the package. + +@item +The options @samp{no-installman} and @samp{no-installinfo} are +prohibited. +@end itemize + +Note that this option will be extended in the future to do even more +checking; it is advisable to be familiar with the precise requirements +of the GNU standards. Also, @samp{--gnu} can require certain +non-standard GNU programs to exist for use by various maintainer-only +targets; for instance in the future @code{pathchk} might be required for +@samp{make dist}. + +@cindex --gnits, complete description + +The @samp{--gnits} option does everything that @samp{--gnu} does, and +checks the following as well: + +@itemize @bullet +@item +@samp{make dist} will check to make sure the @file{NEWS} file has been +updated to the current version. + +@item +The file @file{COPYING.LIB} is prohibited. The LGPL is apparently +considered a failed experiment. + +@item +@samp{VERSION} is checked to make sure its format complies with Gnits +standards. +@c FIXME xref when standards are finished + +@item +@cindex README-alpha +If @samp{VERSION} indicates that this is an alpha release, and the file +@file{README-alpha} appears in the topmost directory of a package, then +it is included in the distribution. This is done in @samp{--gnits} +mode, and no other, because this mode is the only one where version +number formats are constrained, and hence the only mode where Automake +can automatically determine whether @file{README-alpha} should be +included. + +@item +The file @file{THANKS} is required. +@end itemize + + +@node Cygnus, Extending, Gnits, Top +@chapter The effect of @code{--cygnus} + +@cindex Cygnus strictness + +Cygnus Solutions has slightly different rules for how a +@file{Makefile.in} is to be constructed. Passing @samp{--cygnus} to +@code{automake} will cause any generated @file{Makefile.in} to comply +with Cygnus rules. + +Here are the precise effects of @samp{--cygnus}: + +@itemize @bullet +@item +Info files are always created in the build directory, and not in the +source directory. + +@item +@file{texinfo.tex} is not required if a Texinfo source file is +specified. The assumption is that the file will be supplied, but in a +place that Automake cannot find. This assumption is an artifact of how +Cygnus packages are typically bundled. + +@item +@samp{make dist} will look for files in the build directory as well as +the source directory. This is required to support putting info files +into the build directory. + +@item +Certain tools will be searched for in the build tree as well as in the +user's @samp{PATH}. These tools are @code{runtest}, @code{expect}, +@code{makeinfo} and @code{texi2dvi}. + +@item +@code{--foreign} is implied. + +@item +The options @samp{no-installinfo} and @samp{no-dependencies} are +implied. + +@item +The macros @samp{AM_MAINTAINER_MODE} and @samp{AM_CYGWIN32} are +required. + +@item +The @code{check} target doesn't depend on @code{all}. +@end itemize + +GNU maintainers are advised to use @samp{gnu} strictness in preference +to the special Cygnus mode. + + +@node Extending, Distributing, Cygnus, Top +@chapter When Automake Isn't Enough + +Automake's implicit copying semantics means that many problems can be +worked around by simply adding some @code{make} targets and rules to +@file{Makefile.in}. Automake will ignore these additions. + +@cindex -local targets +@cindex local targets + +There are some caveats to doing this. Although you can overload a +target already used by Automake, it is often inadvisable, particularly +in the topmost directory of a non-flat package. However, various useful +targets have a @samp{-local} version you can specify in your +@file{Makefile.in}. Automake will supplement the standard target with +these user-supplied targets. + +@trindex all-local +@trindex info-local +@trindex dvi-local +@trindex check-local +@trindex install-data-local +@trindex install-exec-local +@trindex uninstall-local +@trindex mostlyclean-local +@trindex clean-local +@trindex distclean-local + +The targets that support a local version are @code{all}, @code{info}, +@code{dvi}, @code{check}, @code{install-data}, @code{install-exec}, +@code{uninstall}, and the various @code{clean} targets +(@code{mostlyclean}, @code{clean}, @code{distclean}, and +@code{maintainer-clean}). Note that there are no +@code{uninstall-exec-local} or @code{uninstall-data-local} targets; just +use @code{uninstall-local}. It doesn't make sense to uninstall just +data or just executables. +@trindex all +@trindex info +@trindex dvi +@trindex check +@trindex install-data +@trindex install-exec +@trindex uninstall + +For instance, here is one way to install a file in @file{/etc}: + +@example +install-data-local: + $(INSTALL_DATA) $(srcdir)/afile /etc/afile +@end example + +@cindex -hook targets +@cindex hook targets + +Some targets also have a way to run another target, called a @dfn{hook}, +after their work is done. The hook is named after the principal target, +with @samp{-hook} appended. The targets allowing hooks are +@code{install-data}, @code{install-exec}, @code{dist}, and +@code{distcheck}. +@trindex install-data-hook +@trindex install-exec-hook +@trindex dist-hook + +For instance, here is how to create a hard link to an installed program: + +@example +install-exec-hook: + ln $(bindir)/program $(bindir)/proglink +@end example + +@c FIXME should include discussion of variables you can use in these +@c rules + + +@node Distributing, Future, Extending, Top +@chapter Distributing @file{Makefile.in}s + +Automake places no restrictions on the distribution of the resulting +@file{Makefile.in}s. We still encourage software authors to distribute +their work under terms like those of the GPL, but doing so is not +required to use Automake. + +Some of the files that can be automatically installed via the +@code{--add-missing} switch do fall under the GPL; examine each file +to see. + + +@node Future, Macro and Variable Index, Distributing, Top +@chapter Some ideas for the future + +@cindex Future directions + +Here are some things that might happen in the future: + +@itemize @bullet +@item +HTML support. + +@item +The output will be cleaned up. For instance, only variables which are +actually used will appear in the generated @file{Makefile.in}. + +@item +There will be support for automatically recoding a distribution. The +intent is to allow a maintainer to use whatever character set is most +convenient locally, but for all distributions to be Unicode or +@w{ISO 10646} with the UTF-8 encoding. + +@cindex Guile rewrite + +@item +Rewrite in Guile. This won't happen in the near future, but it will +eventually happen. +@end itemize + + +@page +@node Macro and Variable Index, General Index, Future, Top +@unnumbered Macro and Variable Index + +@printindex vr + + +@page +@node General Index, , Macro and Variable Index, Top +@unnumbered General Index + +@printindex cp + + +@page +@contents +@bye diff --git a/clean-hdr.am b/clean-hdr.am new file mode 100644 index 0000000..e0d1170 --- /dev/null +++ b/clean-hdr.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-hdr: + +clean-hdr: + +distclean-hdr: + -rm -f @FILES@ + +maintainer-clean-hdr: diff --git a/clean-kr.am b/clean-kr.am new file mode 100644 index 0000000..f7f3f36 --- /dev/null +++ b/clean-kr.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-kr: + -rm -f *_.c + +clean-kr: + +distclean-kr: + +maintainer-clean-kr: diff --git a/clean.am b/clean.am new file mode 100644 index 0000000..67ec807 --- /dev/null +++ b/clean.am @@ -0,0 +1,34 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## 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-generic: +MOSTLYCLEAN -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: +CLEAN -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* +DISTCLEAN -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: +MAINTAINERCLEAN -test -z "@MCFILES@" || rm -f @MFILES@ diff --git a/comp-vars.am b/comp-vars.am new file mode 100644 index 0000000..c7d773b --- /dev/null +++ b/comp-vars.am @@ -0,0 +1,22 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +DEFS = @DEFS@ -I. -I$(srcdir) @CONFIG_INCLUDE_SPEC@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ diff --git a/compile.am b/compile.am new file mode 100644 index 0000000..6e9f92a --- /dev/null +++ b/compile.am @@ -0,0 +1,43 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +NOTDEPEND.c.o: +NOTDEPEND $(COMPILE) -c $< + +OBJEXT# FIXME: We should only use cygpath when building on Windows, +OBJEXT# and only if it is available. +OBJEXT.c.obj: +OBJEXT $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: +## Don't remove 'core.*' because some distributions have eg "core.c". +## 4.4BSD systems use `PROG.core'. + -rm -f *.o core *.core +OBJEXT -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..fd30ab0 --- /dev/null +++ b/config.guess @@ -0,0 +1,1354 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-23' + +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# 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. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +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.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100644 index 0000000..9ff085e --- /dev/null +++ b/config.sub @@ -0,0 +1,1460 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-07-03' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# 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. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# 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. + +# 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # 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 0;; + + * ) + 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* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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) + os= + basic_machine=$1 + ;; + -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 + ;; + -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/'` + ;; + -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*) + 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 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # 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-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # 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 + ;; + 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 + ;; + 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 + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + 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 + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + 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 + ;; + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + 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 + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + 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 + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + 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 + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + 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 + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-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-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) 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 + ;; + 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 + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + 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 + ;; + 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 + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + 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 + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-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 + ;; + 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 + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + 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 + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *-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. + -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* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -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*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -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 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -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 + ;; + -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 + ;; + -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 + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + 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 + ;; + *-ibm) + os=-aix + ;; + *-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 + ;; + -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 + ;; + -ptx*) + vendor=sequent + ;; + -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 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..d56fc40 --- /dev/null +++ b/configure @@ -0,0 +1,1166 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=automake.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +am__api_version="1.4" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:558: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:611: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:668: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=automake + +VERSION=1.4-p6 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:714: checking for working aclocal-${am__api_version}" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal-${am__api_version} + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:727: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 +echo "configure:740: checking for working automake-${am__api_version}" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake-${am__api_version} + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake-${am__api_version}" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:753: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:766: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +# Find an appropriate tar for use in "dist" targets. A "best guess" +# is good enough -- if we can't find GNU tar, we don't really care. +for ac_prog in gnutar gtar tar +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:787: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_TAR="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +TAR="$ac_cv_prog_TAR" +if test -n "$TAR"; then + echo "$ac_t""$TAR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$TAR" && break +done + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:819: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$PERL"; then + { echo "configure: error: perl not found" 1>&2; exit 1; } +fi +if test -n "`$PERL -v | fgrep 'version 5.001' 2> /dev/null`"; then + { echo "configure: error: perl 5.001 has bug which causes automake to fail" 1>&2; exit 1; } +fi + +# The API version is the base version. We must guarantee +# compatibility for all releases with the same API version. +# Our current rule is that: +# * All releases, including the prereleases, in an X.Y series +# are compatible. So 1.5.1c is compatible with 1.5. +# * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c +# aren't the same. +APIVERSION=`echo "$VERSION" | sed -e 's/^\([0-9]*\.[0-9]*[a-z]*\).*$/\1/'` + + +# A versioned directory, defined here for convenience. +pkgvdatadir="\${datadir}/automake-${APIVERSION}" + + +# Test for ln. We need use it to install the versioned binaries. +echo $ac_n "checking whether ln works""... $ac_c" 1>&6 +echo "configure:874: checking whether ln works" >&5 +if eval "test \"`echo '$''{'am_cv_prog_ln'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +rm -f conftest conftest.file +: >conftest.file +if ln conftest.file conftest 2>/dev/null; then + am_cv_prog_ln=ln +else + am_cv_prog_ln='cp -p' +fi +rm -f conftest conftest.file +fi + +LN="$am_cv_prog_ln" + +result=no +test "x$am_cv_prog_ln" = xln && result=yes +echo "$ac_t""$result" 1>&6 + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile automake aclocal m4/amversion.m4:m4/amversion.in m4/Makefile tests/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@TAR@%$TAR%g +s%@PERL@%$PERL%g +s%@APIVERSION@%$APIVERSION%g +s%@pkgvdatadir@%$pkgvdatadir%g +s%@LN@%$LN%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +chmod +x automake aclocal +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..dd39d5f --- /dev/null +++ b/configure.in @@ -0,0 +1,49 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(automake.in) + +AM_INIT_AUTOMAKE(automake, 1.4-p6) + +# Find an appropriate tar for use in "dist" targets. A "best guess" +# is good enough -- if we can't find GNU tar, we don't really care. +AC_CHECK_PROGS(TAR, gnutar gtar tar) +AC_PATH_PROG(PERL, perl) +if test -z "$PERL"; then + AC_MSG_ERROR([perl not found]) +fi +if test -n "`$PERL -v | fgrep 'version 5.001' 2> /dev/null`"; then + AC_MSG_ERROR([perl 5.001 has bug which causes automake to fail]) +fi + +# The API version is the base version. We must guarantee +# compatibility for all releases with the same API version. +# Our current rule is that: +# * All releases, including the prereleases, in an X.Y series +# are compatible. So 1.5.1c is compatible with 1.5. +# * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c +# aren't the same. +APIVERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'` +AC_SUBST(APIVERSION) + +# A versioned directory, defined here for convenience. +pkgvdatadir="\${datadir}/automake-${APIVERSION}" +AC_SUBST(pkgvdatadir) + +# Test for ln. We need use it to install the versioned binaries. +AC_MSG_CHECKING([whether ln works]) +AC_CACHE_VAL([am_cv_prog_ln], [ +rm -f conftest conftest.file +: >conftest.file +if ln conftest.file conftest 2>/dev/null; then + am_cv_prog_ln=ln +else + am_cv_prog_ln='cp -p' +fi +rm -f conftest conftest.file]) +LN="$am_cv_prog_ln" +AC_SUBST([LN]) +result=no +test "x$am_cv_prog_ln" = xln && result=yes +AC_MSG_RESULT([$result]) + +AC_OUTPUT([Makefile automake aclocal m4/amversion.m4:m4/amversion.in m4/Makefile tests/Makefile], +[chmod +x automake aclocal]) diff --git a/data-clean.am b/data-clean.am new file mode 100644 index 0000000..63ac8d1 --- /dev/null +++ b/data-clean.am @@ -0,0 +1,18 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +## FIXME: This file must exist, even though it is empty. diff --git a/data.am b/data.am new file mode 100644 index 0000000..82883d6 --- /dev/null +++ b/data.am @@ -0,0 +1,37 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@DATA: $(@DIR@_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p; \ + fi; fi; \ + done + +uninstall-@DIR@DATA: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/$$p; \ + done diff --git a/dejagnu.am b/dejagnu.am new file mode 100644 index 0000000..fbe0943 --- /dev/null +++ b/dejagnu.am @@ -0,0 +1,44 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## Flags for DejaGNU. +RUNTESTFLAGS = + +## 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 $(DEJATOOL) --srcdir $$srcdir + +check-DEJAGNU: site.exp +## Life is easiest with an absolute srcdir, so do that. + srcdir=`cd $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ +## Allow this to work when expect and DejaGNU are in tree. +## Only required when --cygnus in force. +CYGNUS if [ -f $(top_builddir)/../expect/expect ]; then \ +CYGNUS TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \ +CYGNUS export TCL_LIBRARY; \ +CYGNUS fi; \ + runtest=$(RUNTEST); \ +## 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 \ + $$runtest $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi diff --git a/depend.am b/depend.am new file mode 100644 index 0000000..9717458 --- /dev/null +++ b/depend.am @@ -0,0 +1,37 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## This fragment is probably only useful for maintainers. It relies +## on GNU make and gcc. It is only included in the generated +## Makefile.in if `automake' is not passed the `--include-deps' flag. + +## We must create the .deps directory if it doesn't exist. We do it +## in this strange way to make sure the .deps directory exists, +## without trying to run mkdir for each compilation. +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: diff --git a/depend2.am b/depend2.am new file mode 100644 index 0000000..dec3e82 --- /dev/null +++ b/depend2.am @@ -0,0 +1,59 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994-1998, 1999 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +%.o: %@EXT@ + @echo '$(@PFX@COMPILE) -c $<'; \ +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + $(@PFX@COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %@EXT@ + @echo '$(LT@PFX@COMPILE) -c $<'; \ +## See above to understand implementation weirdness. + $(LT@PFX@COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< +## Account for versions of gcc that put a space before the `:'. + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ +## See above to understand deleted header file trick. + tr ' ' '\012' < .deps/$(*F).pp \ +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp diff --git a/dist-vars.am b/dist-vars.am new file mode 100644 index 0000000..4b1c2ec --- /dev/null +++ b/dist-vars.am @@ -0,0 +1,22 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +## DIST_COMMON comes first so that README can be the very first file. +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) diff --git a/elisp-comp b/elisp-comp new file mode 100755 index 0000000..96e4aa5 --- /dev/null +++ b/elisp-comp @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (C) 1995 Free Software Foundation, Inc. +# François Pinard , 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# This script byte-compiles all `.el' files which are part of its +# arguments, using GNU Emacs, and put the resulting `.elc' files into +# the current directory, so disregarding the original directories used +# in `.el' arguments. +# +# This script manages in such a way that all Emacs LISP files to +# be compiled are made visible between themselves, in the event +# they require or load-library one another. + +if test $# = 0; then + echo 1>&2 "No files given to $0" + exit 1 +else + if test -z "$EMACS" || test "$EMACS" = "t"; then + # Value of "t" means we are running in a shell under Emacs. + # Just assume Emacs is called "emacs". + EMACS=emacs + fi + + tempdir=elc.$$ + mkdir $tempdir + cp $* $tempdir + cd $tempdir + + echo "(setq load-path (cons nil load-path))" > script + $EMACS -q -batch -l script -f batch-byte-compile *.el + mv *.elc .. + + cd .. + rm -fr $tempdir +fi diff --git a/footer.am b/footer.am new file mode 100644 index 0000000..6fee90d --- /dev/null +++ b/footer.am @@ -0,0 +1,20 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/header-vars.am b/header-vars.am new file mode 100644 index 0000000..1dd0813 --- /dev/null +++ b/header-vars.am @@ -0,0 +1,70 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +## Some derived variables that have been found to be useful. +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +## Location of top build directory relative to this one. +top_builddir = @top_builddir@ + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +## We use AM_INSTALL_PROGRAM_FLAGS so that install-strip can pass -s +## easily. We can't just set INSTALL_PROGRAM because that might have +## a relative path. +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +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 = : diff --git a/header.am b/header.am new file mode 100644 index 0000000..d0ae6ba --- /dev/null +++ b/header.am @@ -0,0 +1,34 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@HEADERS: $(@DIR@_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_HEADERS)'; for p in $$list; do \ +## A header file can be in the source directory or the build directory. + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(@DIR@dir)/$$p; \ + done + +uninstall-@DIR@HEADERS: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/$$p; \ + done diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# 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. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# 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 $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/java-clean.am b/java-clean.am new file mode 100644 index 0000000..af20493 --- /dev/null +++ b/java-clean.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-@DIR@JAVA: + +clean-@DIR@JAVA: + -rm *.class class@DIR@.stamp + +distclean-@DIR@JAVA: + +maintainer-clean-@DIR@JAVA: diff --git a/java.am b/java.am new file mode 100644 index 0000000..b72cdc2 --- /dev/null +++ b/java.am @@ -0,0 +1,33 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@JAVA: class@DIR@.stamp + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## 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. + for p in *.class; do \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p; \ + done + +uninstall-@DIR@JAVA: + @$(NORMAL_UNINSTALL) + for p in *.class; do \ + rm -f $(DESTDIR)$(@DIR@dir)/$$p; \ + done diff --git a/kr-extra.am b/kr-extra.am new file mode 100644 index 0000000..6577988 --- /dev/null +++ b/kr-extra.am @@ -0,0 +1,31 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-krextra: + +clean-krextra: +## Why `clean' and not somewhere else? Not `mostlyclean' because +## people usually don't want to recompile this file. And not +## `distclean' because of our informal rule: if `make' built it, then +## `clean' should delete it; if `configure' built it, then `distclean' +## should remove it (and if the maintainer built it, then +## maintainer-clean should remove it). + -rm -f ansi2knr + +distclean-krextra: + +maintainer-clean-krextra: diff --git a/library.am b/library.am new file mode 100644 index 0000000..9132ae6 --- /dev/null +++ b/library.am @@ -0,0 +1,21 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +@LIBRARY@: $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_DEPENDENCIES) + -rm -f @LIBRARY@ + $(AR) cru @LIBRARY@ $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_LIBADD) + $(RANLIB) @LIBRARY@ diff --git a/libs-clean.am b/libs-clean.am new file mode 100644 index 0000000..262163a --- /dev/null +++ b/libs-clean.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-@DIR@LIBRARIES: + +clean-@DIR@LIBRARIES: + -test -z "$(@DIR@_LIBRARIES)" || rm -f $(@DIR@_LIBRARIES) + +distclean-@DIR@LIBRARIES: + +maintainer-clean-@DIR@LIBRARIES: diff --git a/libs.am b/libs.am new file mode 100644 index 0000000..324df39 --- /dev/null +++ b/libs.am @@ -0,0 +1,47 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@LIBRARIES: $(@DIR@_LIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(@DIR@dir)/$$p; \ + else :; fi; \ + done +## 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)'; for p in $$list; do \ + if test -f $$p; then \ +## Must ranlib after installing because mod time changes. + echo " $(RANLIB) $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(@DIR@dir)/$$p; \ + else :; fi; \ + done + +uninstall-@DIR@LIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_LIBRARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/$$p; \ + done diff --git a/libtool.am b/libtool.am new file mode 100644 index 0000000..e748cc7 --- /dev/null +++ b/libtool.am @@ -0,0 +1,39 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +NOTDEPEND.c.lo: +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. +NOTDEPEND $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +## These are just copies of the above rule. +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: +## .libs is for Unix, _libs for DOS. + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: diff --git a/lisp-clean.am b/lisp-clean.am new file mode 100644 index 0000000..f9904ef --- /dev/null +++ b/lisp-clean.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-lisp: + +clean-lisp: + -test -z "$(ELCFILES)" || rm -f $(ELCFILES) + +distclean-lisp: + +maintainer-clean-lisp: diff --git a/lisp.am b/lisp.am new file mode 100644 index 0000000..74a9ad2 --- /dev/null +++ b/lisp.am @@ -0,0 +1,43 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1996, 1998, 2001 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@LISP: $(@DIR@_LISP) $(ELCFILES) + @$(NORMAL_INSTALL) + @if test -n "$(lispdir)"; then \ + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir); \ +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + list='$(@DIR@_LISP)'; for p in $$list; do \ +## A header file can be in the source directory or the build directory. + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(@DIR@dir)/$$p; \ +## Only install .elc file if it exists. + if test -f $${p}c; then \ + echo " $(INSTALL_DATA) $${p}c $(DESTDIR)$(@DIR@dir)/$${p}c"; \ + $(INSTALL_DATA) $${p}c $(DESTDIR)$(@DIR@dir)/$${p}c; \ + else : ; fi; \ + done; \ + else : ; fi + +uninstall-@DIR@LISP: + @$(NORMAL_UNINSTALL) + @if test -n "$(lispdir)"; then \ + list='$(@DIR@_LISP)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/$$p $(DESTDIR)$(@DIR@dir)/$${p}c; \ + done; \ + else : ; fi diff --git a/ltlib-clean.am b/ltlib-clean.am new file mode 100644 index 0000000..c7cdcfb --- /dev/null +++ b/ltlib-clean.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-@DIR@LTLIBRARIES: + +clean-@DIR@LTLIBRARIES: + -test -z "$(@DIR@_LTLIBRARIES)" || rm -f $(@DIR@_LTLIBRARIES) + +distclean-@DIR@LTLIBRARIES: + +maintainer-clean-@DIR@LTLIBRARIES: diff --git a/ltlib.am b/ltlib.am new file mode 100644 index 0000000..50200fe --- /dev/null +++ b/ltlib.am @@ -0,0 +1,38 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@LTLIBRARIES: $(@DIR@_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ +## 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. + echo "@LIBTOOL --mode=install@ $(INSTALL) $$p $(DESTDIR)$(@DIR@dir)/$$p"; \ + @LIBTOOL --mode=install@ $(INSTALL) $$p $(DESTDIR)$(@DIR@dir)/$$p; \ + else :; fi; \ + done + +uninstall-@DIR@LTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_LTLIBRARIES)'; for p in $$list; do \ + @LIBTOOL --mode=uninstall@ rm -f $(DESTDIR)$(@DIR@dir)/$$p; \ + done diff --git a/ltlibrary.am b/ltlibrary.am new file mode 100644 index 0000000..886533a --- /dev/null +++ b/ltlibrary.am @@ -0,0 +1,19 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +@LTLIBRARY@: $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_DEPENDENCIES) + $(@XLINK@) @RPATH@ $(@XLTLIBRARY@_LDFLAGS) $(@XLTLIBRARY@_OBJECTS) $(@XLTLIBRARY@_LIBADD) $(LIBS) diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 0000000..d0cc6e1 --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to create Makefile.in + +MAINT_CHARSET = latin1 + +m4datadir = $(datadir)/aclocal-$(APIVERSION) +m4data_DATA = amversion.m4 ccstdc.m4 cond.m4 dmalloc.m4 error.m4 \ +header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 \ +multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \ +termios.m4 winsz.m4 + +DISTCLEANFILES = amversion.m4 + +EXTRA_DIST = $(m4data_DATA) diff --git a/m4/Makefile.in b/m4/Makefile.in new file mode 100644 index 0000000..1266cda --- /dev/null +++ b/m4/Makefile.in @@ -0,0 +1,202 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 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. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +APIVERSION = @APIVERSION@ +LN = @LN@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +TAR = @TAR@ +VERSION = @VERSION@ +pkgvdatadir = @pkgvdatadir@ + +MAINT_CHARSET = latin1 + +m4datadir = $(datadir)/aclocal-$(APIVERSION) +m4data_DATA = amversion.m4 ccstdc.m4 cond.m4 dmalloc.m4 error.m4 header.m4 init.m4 lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4 + + +DISTCLEANFILES = amversion.m4 + +EXTRA_DIST = $(m4data_DATA) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = amversion.m4 +DATA = $(m4data_DATA) + +DIST_COMMON = Makefile.am Makefile.in amversion.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps m4/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +amversion.m4: $(top_builddir)/config.status amversion.in + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@:m4/amversion.in CONFIG_HEADERS= $(SHELL) ./config.status + +install-m4dataDATA: $(m4data_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(m4datadir) + @list='$(m4data_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \ + fi; fi; \ + done + +uninstall-m4dataDATA: + @$(NORMAL_UNINSTALL) + list='$(m4data_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(m4datadir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = m4 + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-m4dataDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-m4dataDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(m4datadir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-m4dataDATA install-m4dataDATA tags distdir info-am \ +info dvi-am dvi check check-am installcheck-am installcheck \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/m4/amversion.in b/m4/amversion.in new file mode 100644 index 0000000..ef572f2 --- /dev/null +++ b/m4/amversion.in @@ -0,0 +1,28 @@ +# Copyright 2002 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="@APIVERSION@"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([@VERSION@])]) diff --git a/m4/ccstdc.m4 b/m4/ccstdc.m4 new file mode 100644 index 0000000..0b497e0 --- /dev/null +++ b/m4/ccstdc.m4 @@ -0,0 +1,91 @@ +## ----------------------------------------- ## +## ANSIfy the C compiler whenever possible. ## +## From Franc,ois Pinard ## +## ----------------------------------------- ## + +# serial 1 + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN([AM_PROG_CC_STDC], +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) diff --git a/m4/cond.m4 b/m4/cond.m4 new file mode 100644 index 0000000..4eb2e9d --- /dev/null +++ b/m4/cond.m4 @@ -0,0 +1,12 @@ +# Define a conditional. + +AC_DEFUN([AM_CONDITIONAL], +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4 new file mode 100644 index 0000000..552efd6 --- /dev/null +++ b/m4/dmalloc.m4 @@ -0,0 +1,22 @@ +## ----------------------------------- ## +## Check if --with-dmalloc was given. ## +## From Franc,ois Pinard ## +## ----------------------------------- ## + +# serial 1 + +AC_DEFUN([AM_WITH_DMALLOC], +[AC_MSG_CHECKING(if malloc debugging is wanted) +AC_ARG_WITH(dmalloc, +[ --with-dmalloc use dmalloc, as in + ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz], +[if test "$withval" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_DMALLOC,1, + [Define if using the dmalloc debugging malloc package]) + LIBS="$LIBS -ldmalloc" + LDFLAGS="$LDFLAGS -g" +else + AC_MSG_RESULT(no) +fi], [AC_MSG_RESULT(no)]) +]) diff --git a/m4/error.m4 b/m4/error.m4 new file mode 100644 index 0000000..5def909 --- /dev/null +++ b/m4/error.m4 @@ -0,0 +1,13 @@ +dnl From Jim Meyering. Use this if you use the GNU error.[ch]. +dnl FIXME: Migrate into libit + +AC_DEFUN([AM_FUNC_ERROR_AT_LINE], +[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, + [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], + am_cv_lib_error_at_line=yes, + am_cv_lib_error_at_line=no)]) + if test $am_cv_lib_error_at_line = no; then + LIBOBJS="$LIBOBJS error.o" + fi + AC_SUBST(LIBOBJS)dnl +]) diff --git a/m4/header.m4 b/m4/header.m4 new file mode 100644 index 0000000..59280be --- /dev/null +++ b/m4/header.m4 @@ -0,0 +1,22 @@ +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +AC_DEFUN([AM_CONFIG_HEADER], +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) diff --git a/m4/init.m4 b/m4/init.m4 new file mode 100644 index 0000000..a9d1d0b --- /dev/null +++ b/m4/init.m4 @@ -0,0 +1,33 @@ +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) diff --git a/m4/lex.m4 b/m4/lex.m4 new file mode 100644 index 0000000..0e472de --- /dev/null +++ b/m4/lex.m4 @@ -0,0 +1,10 @@ +## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT +## by Alexandre Oliva + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN([AM_PROG_LEX], +[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) +AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") +AC_PROG_LEX +AC_DECL_YYTEXT]) diff --git a/m4/lispdir.m4 b/m4/lispdir.m4 new file mode 100644 index 0000000..586f586 --- /dev/null +++ b/m4/lispdir.m4 @@ -0,0 +1,37 @@ +## ------------------------ +## Emacs LISP file handling +## From Ulrich Drepper +## ------------------------ + +# serial 1 + +AC_DEFUN([AM_PATH_LISPDIR], + [# If set to t, that means we are running in a shell under Emacs. + # If you have an Emacs named "t", then use the full path. + test "$EMACS" = t && EMACS= + AC_PATH_PROGS(EMACS, emacs xemacs, no) + if test $EMACS != "no"; then + AC_MSG_CHECKING([where .elc files should go]) + dnl Set default value + lispdir="\$(datadir)/emacs/site-lisp" + emacs_flavor=`echo "$EMACS" | sed -e 's,^.*/,,'` + if test "x$prefix" = "xNONE"; then + if test -d $ac_default_prefix/share/$emacs_flavor/site-lisp; then + lispdir="\$(prefix)/share/$emacs_flavor/site-lisp" + else + if test -d $ac_default_prefix/lib/$emacs_flavor/site-lisp; then + lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp" + fi + fi + else + if test -d $prefix/share/$emacs_flavor/site-lisp; then + lispdir="\$(prefix)/share/$emacs_flavor/site-lisp" + else + if test -d $prefix/lib/$emacs_flavor/site-lisp; then + lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp" + fi + fi + fi + AC_MSG_RESULT($lispdir) + fi + AC_SUBST(lispdir)]) diff --git a/m4/maintainer.m4 b/m4/maintainer.m4 new file mode 100644 index 0000000..4e8f348 --- /dev/null +++ b/m4/maintainer.m4 @@ -0,0 +1,19 @@ +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) diff --git a/m4/missing.m4 b/m4/missing.m4 new file mode 100644 index 0000000..4016337 --- /dev/null +++ b/m4/missing.m4 @@ -0,0 +1,18 @@ +## --------------------------------------------------------- ## +## Fake the existence of programs that GNU maintainers use. ## +## --------------------------------------------------------- ## +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN([AM_MISSING_PROG], +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) diff --git a/m4/mktime.m4 b/m4/mktime.m4 new file mode 100644 index 0000000..ab841b9 --- /dev/null +++ b/m4/mktime.m4 @@ -0,0 +1,167 @@ +#serial 4 + +dnl From Jim Meyering. +dnl FIXME: this should migrate into libit. + +AC_DEFUN([AM_FUNC_MKTIME], +[AC_REQUIRE([AC_HEADER_TIME])dnl + AC_CHECK_HEADERS(sys/time.h unistd.h) + AC_CHECK_FUNCS(alarm) + AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime, + [AC_TRY_RUN( +changequote(<<, >>)dnl +< +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#if !HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; + +/* Values we'll use to set the TZ environment variable. */ +static const char *const tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Fail if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static void +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test) */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + if (mktime (&tm) == (time_t)-1) + exit (1); +} + +static void +mktime_test (now) + time_t now; +{ + struct tm *lt; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); + now = time_t_max - now; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); +} + +static void +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + if (tm.tm_mon != 2 || tm.tm_mday != 31) + exit (1); +} + +static void +bigtime_test (j) + int j; +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + /* This test makes some buggy mktime implementations loop. + Give up after 10 seconds. */ + alarm (10); + now = mktime (&tm); + alarm (0); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + exit (1); + } +} + +int +main () +{ + time_t t, delta; + int i, j; + + for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) + continue; + time_t_max--; + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + mktime_test (t); + mktime_test ((time_t) 60 * 60); + mktime_test ((time_t) 60 * 60 * 24); + + for (j = 1; 0 < j; j *= 2) + bigtime_test (j); + bigtime_test (j - 1); + } + irix_6_4_bug (); + spring_forward_gap (); + exit (0); +} + >>, +changequote([, ])dnl + am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no, + dnl When crosscompiling, assume mktime is missing or broken. + am_cv_func_working_mktime=no) + ]) + if test $am_cv_func_working_mktime = no; then + LIBOBJS="$LIBOBJS mktime.o" + fi +]) diff --git a/m4/multi.m4 b/m4/multi.m4 new file mode 100644 index 0000000..284c915 --- /dev/null +++ b/m4/multi.m4 @@ -0,0 +1,41 @@ +dnl Add --enable-multilib to configure. +dnl Usage: AM_ENABLE_MULTILIB([makefile, [rel-to-top-srcdir]]) + +AC_DEFUN([AM_ENABLE_MULTILIB], [ +dnl Default to --enable-multilib +AC_ARG_ENABLE(multilib, +[ --enable-multilib build many library versions (default)], +[case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;; + esac], [multilib=yes] + +dnl We may get other options which we are undocumented: +dnl --with-target-subdir, --with-multisrctop, --with-multisubdir + +if test "[$]{srcdir}" = "."; then + if test "[$]{with_target_subdir}" != "."; then + multi_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])" + else + multi_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])" + fi +else + multi_basedir="[$]{srcdir}/ifelse([$2],,,[$2])" +fi +AC_SUBST(multi_basedir) + +AC_OUTPUT_COMMANDS([ +if test -n "$CONFIG_FILES"; then + ac_file=ifelse([$1],,Makefile,[$1]) . ..ifelse([$2],,,/[$2])/config-ml.in +fi], [ +srcdir="$srcdir" +host="$host" +target="$target" +with_multisubdir="$with_multisubdir" +with_multisrctop="$with_multisrctop" +with_target_subdir="$with_target_subdir" +ac_configure_args="${multilib_arg} ${ac_configure_args}" +multi_basedir="$multi_basedir" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +CC="$CC"]))dnl diff --git a/m4/obstack.m4 b/m4/obstack.m4 new file mode 100644 index 0000000..1a128db --- /dev/null +++ b/m4/obstack.m4 @@ -0,0 +1,15 @@ +dnl From Jim Meyering. +dnl FIXME: migrate into libit. + +AC_DEFUN([AM_FUNC_OBSTACK], +[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack, + [AC_TRY_LINK([#include "obstack.h"], + [struct obstack *mem;obstack_free(mem,(char *) 0)], + am_cv_func_obstack=yes, + am_cv_func_obstack=no)]) + if test $am_cv_func_obstack = yes; then + AC_DEFINE(HAVE_OBSTACK,1,[Define if libc includes obstacks]) + else + LIBOBJS="$LIBOBJS obstack.o" + fi +]) diff --git a/m4/protos.m4 b/m4/protos.m4 new file mode 100644 index 0000000..bbb5871 --- /dev/null +++ b/m4/protos.m4 @@ -0,0 +1,25 @@ +## ------------------------------- ## +## Check for function prototypes. ## +## From Franc,ois Pinard ## +## ------------------------------- ## + +# serial 1 + +AC_DEFUN([AM_C_PROTOTYPES], +[AC_REQUIRE([AM_PROG_CC_STDC]) +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for function prototypes]) +if test "$am_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT(yes) + AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) + U= ANSI2KNR= +else + AC_MSG_RESULT(no) + U=_ ANSI2KNR=./ansi2knr + # Ensure some checks needed by ansi2knr itself. + AC_HEADER_STDC + AC_CHECK_HEADERS(string.h) +fi +AC_SUBST(U)dnl +AC_SUBST(ANSI2KNR)dnl +]) diff --git a/m4/ptrdiff.m4 b/m4/ptrdiff.m4 new file mode 100644 index 0000000..687b655 --- /dev/null +++ b/m4/ptrdiff.m4 @@ -0,0 +1,12 @@ +# From Ulrich Drepper. + +# serial 1 + +AC_DEFUN([AM_TYPE_PTRDIFF_T], + [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t, + [AC_TRY_COMPILE([#include ], [ptrdiff_t p], + am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)]) + if test $am_cv_type_ptrdiff_t = yes; then + AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type]) + fi +]) diff --git a/m4/regex.m4 b/m4/regex.m4 new file mode 100644 index 0000000..6918fbc --- /dev/null +++ b/m4/regex.m4 @@ -0,0 +1,37 @@ +## --------------------------------- ## +## Check if --with-regex was given. ## +## --------------------------------- ## + +# serial 1 + +# The idea is to distribute rx.[hc] and regex.[hc] together, for a while. +# The WITH_REGEX symbol (which should also be documented in acconfig.h) +# is used to decide which of regex.h or rx.h should be included in the +# application. If `./configure --with-regex' is given (the default), the +# package will use gawk's regex. If `./configure --without-regex', a +# check is made to see if rx is already installed, as with newer Linux'es. +# If not found, the package will use the rx from the distribution. +# If found, the package will use the system's rx which, on Linux at least, +# will result in a smaller executable file. + +AC_DEFUN([AM_WITH_REGEX], +[AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted) +AC_ARG_WITH(regex, +[ --without-regex use GNU rx in lieu of gawk's regex for matching], +[test "$withval" = yes && am_with_regex=1], +[am_with_regex=1]) +if test -n "$am_with_regex"; then + AC_MSG_RESULT(regex) + AC_DEFINE(WITH_REGEX,1,[Define if using GNU regex]) + AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex, + AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1], + am_cv_gnu_regex=yes, am_cv_gnu_regex=no)) + if test $am_cv_gnu_regex = no; then + LIBOBJS="$LIBOBJS regex.o" + fi +else + AC_MSG_RESULT(rx) + AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"]) +fi +AC_SUBST(LIBOBJS)dnl +]) diff --git a/m4/sanity.m4 b/m4/sanity.m4 new file mode 100644 index 0000000..ec7b1ff --- /dev/null +++ b/m4/sanity.m4 @@ -0,0 +1,42 @@ +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) diff --git a/m4/strtod.m4 b/m4/strtod.m4 new file mode 100644 index 0000000..decefa9 --- /dev/null +++ b/m4/strtod.m4 @@ -0,0 +1,69 @@ +## Copyright (C) 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## From Jim Meyering. + +## serial 1 + +## @defmac AC_FUNC_STRTOD +## @maindex FUNC_STRTOD +## @ovindex LIBOBJS +## If the @code{strtod} function is not available, or does not work +## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output +## variable @code{LIBOBJS}. +## @end defmac + +AC_DEFUN([AM_FUNC_STRTOD], +[AC_CACHE_CHECK(for working strtod, am_cv_func_strtod, +[AC_TRY_RUN([ +double strtod (); +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + exit (1); + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + exit (1); + } + exit (0); +} +], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)]) +test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" +AC_SUBST(LIBOBJS)dnl +am_cv_func_strtod_needs_libm=no +if test $am_cv_func_strtod = no; then + AC_CHECK_FUNCS(pow) + if test $ac_cv_func_pow = no; then + AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes], + [AC_MSG_WARN(can't find library containing definition of pow)]) + fi +fi +]) diff --git a/m4/termios.m4 b/m4/termios.m4 new file mode 100644 index 0000000..a0a0953 --- /dev/null +++ b/m4/termios.m4 @@ -0,0 +1,14 @@ +dnl From Jim Meyering. + +# serial 1 + +AC_DEFUN([AM_SYS_POSIX_TERMIOS], +[AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios, + [AC_TRY_LINK([#include +#include +#include ], + [/* SunOS 4.0.3 has termios.h but not the library calls. */ + tcgetattr(0, 0);], + am_cv_sys_posix_termios=yes, + am_cv_sys_posix_termios=no)]) +]) diff --git a/m4/winsz.m4 b/m4/winsz.m4 new file mode 100644 index 0000000..9caa909 --- /dev/null +++ b/m4/winsz.m4 @@ -0,0 +1,36 @@ +dnl From Jim Meyering. + +# serial 1 + +AC_DEFUN([AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL], +[AC_REQUIRE([AM_SYS_POSIX_TERMIOS]) + AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h], + am_cv_sys_tiocgwinsz_needs_sys_ioctl_h, + [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no + + gwinsz_in_termios_h=no + if test $am_cv_sys_posix_termios = yes; then + AC_EGREP_CPP([yes], + [#include +# include +# ifdef TIOCGWINSZ + yes +# endif + ], gwinsz_in_termios_h=yes) + fi + + if test $gwinsz_in_termios_h = no; then + AC_EGREP_CPP([yes], + [#include +# include +# ifdef TIOCGWINSZ + yes +# endif + ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes) + fi + ]) + if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then + AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1, + [Define if TIOCGWINSZ requires sys/ioctl.h]) + fi +]) diff --git a/mans-vars.am b/mans-vars.am new file mode 100644 index 0000000..14089f2 --- /dev/null +++ b/mans-vars.am @@ -0,0 +1,18 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +NROFF = nroff diff --git a/mans.am b/mans.am new file mode 100644 index 0000000..6c2401b --- /dev/null +++ b/mans.am @@ -0,0 +1,61 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-man@SECTION@: + $(mkinstalldirs) $(DESTDIR)$(man@SECTION@dir) + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Find the file. + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man@SECTION@dir)/$$inst; \ + done + +## This is just completely gross. +uninstall-man@SECTION@: + @list='$(man@SECTION@_MANS)'; \ +## Extract all items from man_MANS that should go in this section. +## This must be done dynamically to support conditionals. + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ +## Have to accept files like `foo.1c'. + *.@SECTION@*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ +## Extract basename of man page and run it through the program rename +## transform. + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst"; \ + rm -f $(DESTDIR)$(man@SECTION@dir)/$$inst; \ + done diff --git a/mdate-sh b/mdate-sh new file mode 100755 index 0000000..37171f2 --- /dev/null +++ b/mdate-sh @@ -0,0 +1,92 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. +# Copyright (C) 1995, 1996, 1997 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, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# Get the extended ls output of the file or directory. +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +if ls -L /dev/null 1>/dev/null 2>&1; then + set - x`ls -L -l -d $1` +else + set - x`ls -l -d $1` +fi +# The month is at least the fourth argument +# (3 shifts here, the next inside the loop). +shift +shift +shift + +# Find the month. Next argument is day, followed by the year or time. +month= +until test $month +do + 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 + +day=$2 + +# 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 diff --git a/missing b/missing new file mode 100755 index 0000000..22e101a --- /dev/null +++ b/missing @@ -0,0 +1,198 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. +# Franc,ois Pinard , 1996. + +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.in; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`$configure_ac'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`$configure_ac'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`$configure_ac'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..4f58503 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + 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 + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/multilib.am b/multilib.am new file mode 100644 index 0000000..728a78d --- /dev/null +++ b/multilib.am @@ -0,0 +1,45 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +## Multilib support variables. +MULTISRCTOP = +MULTIBUILDTOP = +MULTIDIRS = +MULTISUBDIR = +MULTIDO = true +MULTICLEAN = true + +all-multi: + $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do +install-multi: + $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do +mostlyclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean +clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean +distclean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean +maintainer-clean-multi: + $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean + +## FIXME: this is probably broken. +all-recursive: all-multi +install-recursive: install-multi +mostlyclean-recursive: mostlyclean-multi +clean-recursive: clean-multi +distclean-recursive: distclean-multi +maintainer-clean-recursive: maintainer-clean-multi diff --git a/packaging/automake-1.4-backslash.patch b/packaging/automake-1.4-backslash.patch new file mode 100644 index 0000000..b77c160 --- /dev/null +++ b/packaging/automake-1.4-backslash.patch @@ -0,0 +1,102 @@ +2001-04-10 H.J. Lu + + * automake.in (AM_EXEEXT): Fix a typo. + (quote_cond_val): Fix backslashes. + (unquote_cond_val): Fix backslashes. + (value_to_list): Fix backslashes. + (read_am_file): Fix backslashes. + (read_main_am_file): Fix backslashes. + +--- automake-1.4/automake.in.backsplash Tue Apr 10 23:36:17 2001 ++++ automake-1.4/automake.in Tue Apr 10 23:36:19 2001 +@@ -279,7 +279,7 @@ $cygnus_mode = 0; + 'fp_FUNC_FNMATCH', "use \`AC_FUNC_FNMATCH'", + 'AM_SANITY_CHECK_CC', "automatically done by \`AC_PROG_CC'", + 'AM_PROG_INSTALL', "use \`AC_PROG_INSTALL'", +- 'AM_EXEEEXT', "use \`AC_EXEEXT'", ++ 'AM_EXEEXT', "use \`AC_EXEEXT'", + 'AM_CYGWIN32', "use \`AC_CYGWIN32'", + 'AM_MINGW32', "use \`AC_MINGW32'", + +@@ -5196,8 +5196,7 @@ sub examine_variable + sub quote_cond_val + { + local ($val) = @_; +- $val =~ s/ /\001/g; +- $val =~ s/\t/\003/g; ++ $val =~ tr/ \t\n/\001\003\004/; + $val = "\002" if $val eq ''; + return $val; + } +@@ -5206,8 +5205,7 @@ sub quote_cond_val + sub unquote_cond_val + { + local ($val) = @_; +- $val =~ s/\001/ /g; +- $val =~ s/\003/\t/g; ++ $val =~ tr/\001\003\004/ \t\n/; + $val =~ s/\002//g; + return $val; + } +@@ -5514,6 +5512,9 @@ sub value_to_list + local ($var, $val, $cond) = @_; + local (@result); + ++ # Strip backslashes ++ $val =~ s/\\(\n|$)/ /g; ++ + foreach (split (' ', $val)) + { + # If a comment seen, just leave. +@@ -5820,10 +5821,6 @@ sub read_am_file + else + { + $saw_bk = /\\$/; +- # Chop newline and backslash if this line is +- # continued. ensure trailing whitespace exists. +- chop if $saw_bk; +- chop if $saw_bk; + $contents{$last_var_name} .= ' ' + unless $contents{$last_var_name} =~ /\s$/; + $contents{$last_var_name} .= $_; +@@ -5934,7 +5931,7 @@ sub read_am_file + local ($value); + if ($3 ne '' && substr ($3, -1) eq "\\") + { +- $value = substr ($3, 0, length ($3) - 1); ++ $value = $3 . "\n"; + } + else + { +@@ -5948,6 +5945,12 @@ sub read_am_file + { + $contents{$last_var_name} = '@' . $last_var_name . '@'; + } ++ if (substr ($contents{$last_var_name}, -1) eq "\n") ++ { ++ # Insert a backslash before a trailing newline. ++ $contents{$last_var_name} ++ = substr ($contents{$last_var_name}, 0, -1) . "\\\n"; ++ } + $contents{$last_var_name} .= ' ' . $value; + } + else +@@ -6150,9 +6153,15 @@ sub read_main_am_file + { + local ($vcond) = shift (@cond_vals); + local ($val) = &unquote_cond_val (shift (@cond_vals)); +- $output_vars .= ($vcond . $curs +- . ' ' . $def_type{$curs} . '= ' +- . $val . "\n"); ++ $output_vars .= ($vcond . $curs . ' ' ++ . $def_type{$curs} . "= "); ++ local ($line); ++ foreach $line (split ("\n", $val)) ++ { ++ $output_vars .= $vcond . $line . "\n"; ++ } ++ $output_vars .= "\n" ++ if $val eq ''; + } + } + else diff --git a/packaging/automake-1.4-libtoolize.patch b/packaging/automake-1.4-libtoolize.patch new file mode 100644 index 0000000..ea4d18e --- /dev/null +++ b/packaging/automake-1.4-libtoolize.patch @@ -0,0 +1,15 @@ +--- automake.in Wed Jul 12 11:40:03 2000 ++++ automake.in Thu Nov 9 07:04:46 2000 +@@ -6882,9 +6882,11 @@ + $suppress = 1; + + # Maybe run libtoolize. ++ @libtoolize_args = ('--automake'); ++ push @libtoolize_args, '-c' if $copy_missing; + if ($seen_libtool + && grep ($_ eq $file, @libtoolize_files) +- && system ('libtoolize', '--automake')) ++ && system ('libtoolize', @libtoolize_args)) + { + $message = "installing \`$errfile'"; + $suppress = 0; diff --git a/packaging/automake-1.4-subdir.patch b/packaging/automake-1.4-subdir.patch new file mode 100644 index 0000000..13af160 --- /dev/null +++ b/packaging/automake-1.4-subdir.patch @@ -0,0 +1,22 @@ +2001-04-07 H.J. Lu + + * automake.in (handle_single_transform_list): Don't warn source + in subdirectory. + +--- automake-1.4/automake.in.ylwrap Sat Apr 7 23:04:45 2001 ++++ automake-1.4/automake.in Sat Apr 7 23:17:32 2001 +@@ -1072,9 +1072,11 @@ sub handle_single_transform_list + # the directory. Later. + if (/\//) + { +- &am_error +- ("not supported: source file `$_' is in subdirectory"); +- next; ++ # It breaks gas/Makefile.in in binutils. For now, we ++ # turn off this warning. ++ # &am_error ++ # ("not supported: source file `$_' is in subdirectory"); ++ # next; + } + + # Split file name into base and extension. diff --git a/packaging/automake-1.4-subdirs-89656.patch b/packaging/automake-1.4-subdirs-89656.patch new file mode 100644 index 0000000..bc6667d --- /dev/null +++ b/packaging/automake-1.4-subdirs-89656.patch @@ -0,0 +1,20 @@ +--- automake-1.4-p6/subdirs.am.subdirs 2001-07-16 22:47:36.000000000 -0700 ++++ automake-1.4-p6/subdirs.am 2003-04-25 08:24:35.000000000 -0700 +@@ -27,7 +27,7 @@ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ + check-recursive installcheck-recursive info-recursive dvi-recursive: +- @set fnord $(MAKEFLAGS); amf=$$2; \ ++ @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ +@@ -55,7 +55,7 @@ check-recursive installcheck-recursive i + ## bombs. + mostlyclean-recursive clean-recursive distclean-recursive \ + maintainer-clean-recursive: +- @set fnord $(MAKEFLAGS); amf=$$2; \ ++ @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ diff --git a/packaging/automake-1.4-tags.patch b/packaging/automake-1.4-tags.patch new file mode 100644 index 0000000..6c5ce1c --- /dev/null +++ b/packaging/automake-1.4-tags.patch @@ -0,0 +1,14 @@ +diff -u automake-1.4-p6/Makefile.am~ automake-1.4-p6/Makefile.am +--- automake-1.4-p6/Makefile.am~ 2002-07-29 21:10:39.000000000 +0900 ++++ automake-1.4-p6/Makefile.am 2002-07-29 21:10:39.000000000 +0900 +@@ -151,8 +151,8 @@ + + ## Just get the .am files into TAGS. We don't really care too much if + ## any interesting tags show up. +-ETAGS_ARGS = $(amfiles) +-TAGS_DEPENDENCIES = $(ETAGS_ARGS) ++#ETAGS_ARGS = $(amfiles) ++#TAGS_DEPENDENCIES = $(ETAGS_ARGS) + + ## A temporary hack for the release. + DISTCLEANFILES = automake.cm automake.ov diff --git a/packaging/automake14-info.patch b/packaging/automake14-info.patch new file mode 100644 index 0000000..b23f08b --- /dev/null +++ b/packaging/automake14-info.patch @@ -0,0 +1,103 @@ +--- automake-1.4-p6/automake.texi.rh1 1999-01-06 14:01:26.000000000 +0100 ++++ automake-1.4-p6/automake.texi 2007-02-15 17:15:34.000000000 +0100 +@@ -1,7 +1,7 @@ + \input texinfo @c -*-texinfo-*- + @c %**start of header +-@setfilename automake.info +-@settitle automake ++@setfilename automake14.info ++@settitle automake14 + @setchapternewpage off + @c %**end of header + +@@ -9,12 +9,12 @@ + + @dircategory GNU admin + @direntry +-* automake: (automake). Making Makefile.in's ++* automake14: (automake14). Making Makefile.in's + @end direntry + + @dircategory Individual utilities + @direntry +-* aclocal: (automake)Invoking aclocal. Generating aclocal.m4 ++* aclocal14: (automake14)Invoking aclocal. Generating aclocal.m4 + @end direntry + + @ifinfo +--- automake-1.4-p6/Makefile.in.rh1 2002-07-27 23:09:40.000000000 +0200 ++++ automake-1.4-p6/Makefile.in 2007-02-15 17:13:56.000000000 +0100 +@@ -72,21 +72,34 @@ + SUBDIRS = . m4 tests + + bin_SCRIPTS = automake aclocal +-info_TEXINFOS = automake.texi ++info_TEXINFOS = automake14.texi + +-amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am footer.am header-vars.am header.am java-clean.am java.am kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am ++amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \ ++data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \ ++footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \ ++library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \ ++ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \ ++program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \ ++subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am + + + pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles) + + scriptdir = $(pkgvdatadir) +-script_DATA = config.guess config.sub install-sh mdate-sh missing mkinstalldirs elisp-comp ylwrap acinstall ++script_DATA = config.guess config.sub install-sh mdate-sh missing \ ++mkinstalldirs elisp-comp ylwrap acinstall + + + EXTRA_DIST = acinstall $(pkgvdata_DATA) $(script_DATA) + +-ETAGS_ARGS = $(amfiles) +-TAGS_DEPENDENCIES = $(ETAGS_ARGS) ++# The following requires a fixed version of the Emacs 19.30 etags. ++ETAGS_ARGS = automake.in aclocal.in --lang=none \ ++ --regex='/^@node[ \t]+\([^,]+\)/\1/' automake14.texi ++ ++TAGS_DEPENDENCIES = automake.in aclocal.in automake14.texi ++ ++#ETAGS_ARGS = $(amfiles) ++#TAGS_DEPENDENCIES = $(ETAGS_ARGS) + + DISTCLEANFILES = automake.cm automake.ov + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +@@ -95,9 +108,9 @@ + SCRIPTS = $(bin_SCRIPTS) + + TEXI2DVI = texi2dvi +-INFO_DEPS = automake.info ++INFO_DEPS = automake14.info + DVIS = automake.dvi +-TEXINFOS = automake.texi ++TEXINFOS = automake14.texi + DATA = $(pkgvdata_DATA) $(script_DATA) + + DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +@@ -154,8 +167,8 @@ + $(srcdir)/version.texi: stamp-vti + @: + +-$(srcdir)/stamp-vti: automake.texi $(top_srcdir)/configure.in +- @echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/automake.texi`" > vti.tmp ++$(srcdir)/stamp-vti: automake14.texi $(top_srcdir)/configure.in ++ @echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/automake14.texi`" > vti.tmp + @echo "@set EDITION $(VERSION)" >> vti.tmp + @echo "@set VERSION $(VERSION)" >> vti.tmp + @cmp -s vti.tmp $(srcdir)/version.texi \ +@@ -174,8 +187,8 @@ + maintainer-clean-vti: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi + +-automake.info: automake.texi version.texi +-automake.dvi: automake.texi version.texi ++automake14.info: automake14.texi version.texi ++automake.dvi: automake14.texi version.texi + + + DVIPS = dvips diff --git a/packaging/automake14.changes b/packaging/automake14.changes new file mode 100644 index 0000000..b76af68 --- /dev/null +++ b/packaging/automake14.changes @@ -0,0 +1,3 @@ +* Fri Aug 31 18:03:34 UTC 2012 - tracy.graydon@intel.com +- TIVI-153: Initial import to Tizen to satisfy dependency for iputils +- Pillaged from MeeGo trunk diff --git a/packaging/automake14.spec b/packaging/automake14.spec new file mode 100644 index 0000000..b728bd1 --- /dev/null +++ b/packaging/automake14.spec @@ -0,0 +1,80 @@ +#specfile originally created for Fedora, modified for Moblin Linux +%define tarname automake-1.4-p6 + +Summary: A GNU tool for automatically creating Makefiles +Name: automake14 +Version: 1.4p6 +Release: 15 +License: GPL +Group: Development/Tools +URL: http://sources.redhat.com/automake +Source: ftp://ftp.gnu.org/gnu/automake/%{tarname}.tar.gz +Patch1: automake-1.4-libtoolize.patch +Patch2: automake-1.4-subdir.patch +Patch3: automake-1.4-backslash.patch +Patch6: automake-1.4-tags.patch +Patch7: automake-1.4-subdirs-89656.patch +Patch8: automake14-info.patch +Conflicts: automake < 1.5 +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +BuildArch: noarch +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +Automake is a tool for automatically generating +`Makefile.in' files compliant with the GNU Coding Standards. + +This package contains Automake 1.4, an older version of Automake. +You should install it if you need to run automake in a project that +has not yet been updated to work with newer versions of Automake. + +%prep +%setup -q -n %{tarname} +%patch1 -p0 +%patch2 -p1 +%patch3 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 -b .rh1 +mv automake.texi automake14.texi +rm automake.info + +%build +%configure +make %{?_smp_mflags} + +## 5 of 194 tests fail +## (cygwin32.test error.test pluseq2.test pluseq3.test xsource.test) +#make check + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +## create this dir empty so we can own it +mkdir -p $RPM_BUILD_ROOT%{_datadir}/aclocal + +rm $RPM_BUILD_ROOT%{_bindir}/automake $RPM_BUILD_ROOT%{_bindir}/aclocal +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + +%post +[ -e %{_infodir}/%{name}.info ] && /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || : + +%preun +if [ "$1" = 0 ]; then + [ -e %{_infodir}/%{name}.info ] && /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || : +fi + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_bindir}/*-1.4 +%{_datadir}/aclocal*/* +%{_datadir}/automake-1.4/* +%doc %{_infodir}/* + diff --git a/program.am b/program.am new file mode 100644 index 0000000..be5fb26 --- /dev/null +++ b/program.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +@PROGRAM@@EXEEXT@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES) +## 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@ + $(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS) diff --git a/progs-clean.am b/progs-clean.am new file mode 100644 index 0000000..2b101f0 --- /dev/null +++ b/progs-clean.am @@ -0,0 +1,25 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-@DIR@PROGRAMS: + +clean-@DIR@PROGRAMS: + -test -z "$(@DIR@_PROGRAMS)" || rm -f $(@DIR@_PROGRAMS) + +distclean-@DIR@PROGRAMS: + +maintainer-clean-@DIR@PROGRAMS: diff --git a/progs.am b/progs.am new file mode 100644 index 0000000..3a598c3 --- /dev/null +++ b/progs.am @@ -0,0 +1,37 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ +## Note that we explicitly set the libtool mode. This avoids any +## lossage if the install program doesn't have a name that libtool +## expects. + echo " @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-@DIR@PROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done diff --git a/remake-hdr.am b/remake-hdr.am new file mode 100644 index 0000000..00df8e0 --- /dev/null +++ b/remake-hdr.am @@ -0,0 +1,43 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +@CONFIG_HEADER@: @STAMP@ +## Recover from removal of CONFIG_HEADER + @if test ! -f $@; then \ + rm -f @STAMP@; \ + $(MAKE) @STAMP@; \ + else :; fi +## Explicitly look in srcdir for benefit of non-GNU makes. +@STAMP@: $(srcdir)/@CONFIG_HEADER_IN@ $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=@CONFIG_HEADER_FULL@ \ + $(SHELL) ./config.status +## We used to try to get a real timestamp here. But the fear is that +## that will cause unnecessary cvs conflicts + @echo timestamp > @STAMP@ 2> /dev/null +## Explicitly look in srcdir for benefit of non-GNU makes. +$(srcdir)/@CONFIG_HEADER_IN@: @MAINTAINER_MODE_TRUE@$(srcdir)/@STAMP@.in +## Recover from removal of CONFIG_HEADER_IN + @if test ! -f $@; then \ + rm -f $(srcdir)/@STAMP@.in; \ + $(MAKE) $(srcdir)/@STAMP@.in; \ + else :; fi +$(srcdir)/@STAMP@.in: $(top_srcdir)/@CONFIGURE_AC@ $(ACLOCAL_M4) @FILES@ + cd $(top_srcdir) && $(AUTOHEADER) +## We used to try to get a real timestamp here. But the fear is that +## that will cause unnecessary cvs conflicts + @echo timestamp > $(srcdir)/@STAMP@.in 2> /dev/null diff --git a/remake.am b/remake.am new file mode 100644 index 0000000..f87d3dc --- /dev/null +++ b/remake.am @@ -0,0 +1,24 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## Explicitly look in srcdir for benefit of non-GNU makes. +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +## Explicitly look in srcdir for benefit of non-GNU makes. +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/@CONFIGURE_AC@ $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) diff --git a/scripts.am b/scripts.am new file mode 100644 index 0000000..420abb4 --- /dev/null +++ b/scripts.am @@ -0,0 +1,52 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(@DIR@dir) +## Funny invocation because Makefile variable can be empty, leading to +## a syntax error in sh. + @list='$(@DIR@_SCRIPTS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ + else if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; fi; \ + done + +uninstall-@DIR@SCRIPTS: + @$(NORMAL_UNINSTALL) + list='$(@DIR@_SCRIPTS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ + done + +## Uncomment line in handle_scripts when this is uncommented. +## check-@DIR@SCRIPTS: +## pid=$$$$; list="$(@DIR@_SCRIPTS)"; for p in $$list; do \ +## for opt in --help --version; do \ +## if test -f $$p; then :; \ +## else if test -f $(srcdir)/$$p; then \ +## p=$(srcdir)/$$p; \ +## else exit 1; fi; fi; \ +## if $$p $$opt > .chkout$$pid 2> .chkerr$$pid \ +## && test -n "`cat .chkout$$pid`" \ +## && test -z "`cat .chkerr$$pid`"; then :; \ +## else echo "$$p failed $$opt test" 1>&2; exit 1; fi; \ +## done; \ +## done; rm -f .chk???$$pid diff --git a/stamp-vti b/stamp-vti new file mode 100644 index 0000000..25286ef --- /dev/null +++ b/stamp-vti @@ -0,0 +1,3 @@ +@set UPDATED 6 January 1999 +@set EDITION 1.4-p6 +@set VERSION 1.4-p6 diff --git a/subdirs.am b/subdirs.am new file mode 100644 index 0000000..8a43817 --- /dev/null +++ b/subdirs.am @@ -0,0 +1,78 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +# 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. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; 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; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ +## This trick allows "-k" to keep its natural meaning when running a +## recursive rule. + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +## We run all `clean' targets in reverse order. Why? It's an attempt +## to alleviate a problem that can happen when dependencies are +## enabled. In this case, the .P file in one directory can depend on +## some automatically generated header in an earlier directory. Since +## the dependencies are required before any target is examined, make +## bombs. +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" != "." || dot_seen=yes; \ + done; \ +## If we haven't seen `.', then add it at the beginning. + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ +## This trick allows "-k" to keep its natural meaning when running a +## recursive rule. + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" diff --git a/tags-clean.am b/tags-clean.am new file mode 100644 index 0000000..f169f35 --- /dev/null +++ b/tags-clean.am @@ -0,0 +1,31 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +mostlyclean-tags: + +clean-tags: + +## The GNU Standards mandates that tags files be removed by +## maintainer-clean. But I'm told (by François Pinard) that this is +## really because RMS usually includes TAGS files in his +## distributions. Since we do not, we instead have "distclean" remove +## them. The rule is: if the user built it, "distclean" removes it. +## If it is shipped, "maintainer-clean" removes it. +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: diff --git a/tags.am b/tags.am new file mode 100644 index 0000000..38041e7 --- /dev/null +++ b/tags.am @@ -0,0 +1,45 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) +## Make sure the list of sources is unique. + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: @DIRS@ $(HEADERS) $(SOURCES) @CONFIG@ $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ +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 && tags="$$tags -i $$here/$$subdir/TAGS"; \ +SUBDIRS fi; \ +SUBDIRS done; \ +## Make sure the list of sources is unique. + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ +## Make sure we have something to run etags on. + test -z "$(ETAGS_ARGS)@CONFIG@$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags @CONFIG@ $$unique $(LISP) -o $$here/TAGS) diff --git a/tests/ChangeLog b/tests/ChangeLog new file mode 100644 index 0000000..9d7f03e --- /dev/null +++ b/tests/ChangeLog @@ -0,0 +1,858 @@ +2002-07-25 Tom Tromey + + * Makefile.am (TESTS): Removed dup.test. + * dup.test: Removed. + +2002-07-14 Tom Tromey + + * defs (ACLOCAL): Also search build directory for m4 files. + +1999-01-14 Tom Tromey + + * confh3.test: New file. + * Makefile.am (TESTS): Added confh3.test. + + * confh2.test: New file. + * Makefile.am (TESTS): Added confh2.test. + + * confh.test: Run automake differently the second time. + + * mdate3.test: New file. + * Makefile.am (TESTS): Added mdate3.test. + +1999-01-11 Tom Tromey + + * confh.test: New file. + * Makefile.am (TESTS): Added confh.test. + +1999-01-10 Tom Tromey + + * objc.test: Updated to account for new ObjC support. + + * pluseq5.test: New file. + * Makefile.am (TESTS): Added pluseq5.test. + + * all.test: Test all *-local targets, not just all-local. + + * all.test: New file. + * Makefile.am (TESTS): Added all.test. + +1999-01-07 Tom Tromey + + * include.test: New file. + * Makefile.am (TESTS): Added include.test. + +1998-12-21 Tom Tromey + + * insthook.test: Updated to fail when it should. + +1998-12-11 Tom Tromey + + * insthook.test: New file. + * Makefile.am (TESTS): Added insthook.test. + +1998-11-27 Tom Tromey + + * cond7.test: New file. From Pavel Roskin. + * Makefile.am (TESTS): New file. + +1998-11-10 Tom Tromey + + * pluseq4.test: New file. + * Makefile.am (TESTS): Added pluseq4.test. + +1998-11-09 Tom Tromey + + * pluseq3.test: New file. + * Makefile.am (TESTS): Added pluseq3.test. + + * pluseq2.test: New file. + * Makefile.am (TESTS): Added pluseq2.test. + +1998-10-30 Tom Tromey + + * pluseq.test: New file. + * Makefile.am (TESTS): Added pluseq.test. + +1998-10-28 Tom Tromey + + * Makefile.am (distclean-local): Typo fix. + +1998-10-20 Tom Tromey + + * Makefile.am (TESTS): Sorted tests. From Jeff Garzik. + +1998-10-13 Tom Tromey + + * libobj7.test: Updated to reflect minor change in automake (test + wasn't resilient enough). + * instman.test: Updated to reflect fact that mkinstalldirs will be + in distribution. + + * cxxonly.test: Removed. + +Mon Aug 31 09:46:59 1998 Matthew D. Langston + + * Makefile.am (TESTS): Added compile_f_c_cxx.test. + * compile_f_c_cxx.test: New file. + +Sat Aug 29 18:17:58 1998 Matthew D. Langston + + * Makefile.am (TESTS): Added flink.test link_c_cxx.test + link_f_c.test link_f_c_cxx.test link_f_cxx.test link_f_only.test. + Removed flink.test. + * flibs.test: New File. + * link_c_cxx.test: New file. + * link_f_c.test: New file. + * link_f_c_cxx.test: New file. + * link_f_cxx.test: New file. + * link_f_only.test: New file. + +Tue Aug 11 10:46:36 1998 Matthew D. Langston + + * Makefile.am (TESTS): Add cxxonly.test, fonly.test, flink.test, + fnoc.test and fo.test. + * cxxonly.test: New file. + * fonly.test: New file. + * flink.test: New file. + * fnoc.test: New file. + * fo.test: New file. + +1998-10-08 Tom Tromey + + * confdist.test: New file. + * Makefile.am (TESTS): Added confdist.test. + +1998-10-07 Tom Tromey + + * extra4.test: New file. + * extra3.test: New file. + * Makefile.am (TESTS): Added extra3.test, extra4.test. + +Mon Oct 5 12:47:32 1998 Tom Tromey + + * badline.test: New file. + * Makefile.am (TESTS): Added badline.test. + +Thu Oct 1 00:03:39 1998 Tom Tromey + + * seenc.test: Updated test to account for removed line numbers. + + * xsource.test: Correctly fail if source in subdir. + +Wed Sep 30 12:17:34 1998 Tom Tromey + + * colon7.test: New file. + * Makefile.am (TESTS): Added colon7.test. + +Tue Sep 29 02:09:11 1998 Tom Tromey + + * config.test: New file. + * Makefile.am (TESTS): Added config.test. + + * Makefile.am (TESTS): Reference clean.test, not clean.am. + +Mon Sep 28 01:46:34 1998 Tom Tromey + + * recurs2.test: New file, from Jim Meyering. + * Makefile.am (TESTS): Added recurs2.test. + + * Makefile.am (TESTS): Added clean.am. + * clean.test: New file. + * ansi2.test: Updated test for new SUBDIRS change. + * noinst.test: Updated test for new SUBDIRS change. + * checkall.test: Added check to make sure check-local is handled. + Updated test for new SUBDIRS change. + * java.test: Updated test for new SUBDIRS change. + +Sun Sep 27 20:01:20 1998 Tom Tromey + + * Makefile.am (TESTS): Added else.test. + * else.test: New file. + + * Makefile.am (TESTS): Added parse.test. + * parse.test: New file. + +Sat Sep 26 19:17:43 1998 Tom Tromey + + * aclocal.test: Put AM_INIT_AUTOMAKE into configure.in. + * library.test: Use AC_EXEEXT. + * texinfo5.test: Use AC_EXEEXT. + * Many files: use AC_PROG_INSTALL, not AM_PROG_INSTALL. + + Test suite updates for the @SHELL@ change: + * exsource.test: Set SHELL on `make' command line. + * ansi.test: Set SHELL on `make' command line. + * texinfo.test: Set SHELL on `make' command line. + * insh2.test: Set SHELL on `make' command line. + * empty.test: Rewrite @SHELL@ to /bin/sh. + +Tue Sep 22 01:20:00 1998 Tom Tromey + + * ansi3.test: Use gcc and not gcc -traditional. + +Tue Sep 15 22:19:48 1998 Tom Tromey + + * texinfo7.test: New file. + +Sun Aug 16 23:17:38 1998 Tom Tromey + + * colon6.test: New file. + +Fri Aug 14 11:09:03 1998 Tom Tromey + + * cond6.test: New file. + +Mon Aug 10 21:05:15 1998 Tom Tromey + + * ansi3.test: New file. + +Sat Jul 18 00:27:26 1998 Tom Tromey + + * recurs.test: New file. + + * cond3.test: Changed to match recent fixes. + +Fri Jul 17 23:44:49 1998 Tom Tromey + + * cond4.test, cond5.test: New files. + +Tue May 26 01:44:37 1998 Tom Tromey + + * syntax.test: New file. + +Sun Apr 5 15:26:42 1998 Tom Tromey + + * version3.test: Increased version number to ensure failure for a + long time to come. + + * library.test: New file. + + * lex2.test: Updated since lex error changed to warning. + +Fri Apr 3 13:04:50 1998 Tom Tromey + + * colon5.test: New file. + + * exdir2.test: New file. + * instdata.test: New file. + +Wed Mar 25 15:30:39 1998 Tom Tromey + + * badopt.test: new file. + * version3.test: New file. + +Mon Mar 23 10:52:36 1998 Tom Tromey + + * libobj8.test: New file. + +Fri Mar 20 00:32:16 1998 Tom Tromey + + * lex2.test: New file. + + * aclocalii.test: New file. + + * javasubst.test: New file. + +Thu Mar 19 14:11:45 1998 Tom Tromey + + * javaprim.test: New file. + + * sinclude.test: New file. + +Wed Mar 18 17:15:22 1998 Tom Tromey + + * java.test: New file. + +Sun Mar 8 15:35:14 1998 Tom Tromey + + * colon4.test: New file. + +Fri Mar 6 21:17:10 1998 Tom Tromey + + * colon3.test: Refined tests. + +Tue Feb 24 12:29:05 1998 Tom Tromey + + * man.test: Removed. + + * condman2.test: New file. + +Mon Feb 23 16:20:49 1998 Tom Tromey + + * texinfo6.test: New file. + +Mon Feb 16 00:08:58 1998 Tom Tromey + + * aclocali.test: New file. + +Fri Feb 13 00:36:38 1998 Tom Tromey + + * texinfo5.test (info_TEXINFOS): New file. + + * condman.test: New file. + + * Makefile.am (distclean-local): Ignore rm return value. + +Thu Feb 12 21:00:34 1998 Tom Tromey + + * unused.test: New file. + + * whoami.test: New file. + + * alpha.test: New file. + +Wed Feb 11 17:28:30 1998 Tom Tromey + + * aclocal.test: New file. + +Thu Feb 5 13:22:17 1998 Tom Tromey + + * cxxcpp.test: New file. + +Mon Dec 1 15:48:16 1997 Tom Tromey + + * cond3.test: New file. + +Sat Nov 29 22:09:27 1997 Tom Tromey + + * objc.test: New file. + +Sat Oct 25 00:04:04 1997 Tom Tromey + + * libobj7.test: New file. + +Tue Oct 21 00:46:24 1997 Tom Tromey + + * lex2.test: Removed; @LEXLIB@ no longer required. + + * depacl2.test: Use -I, not --acdir. + + * install.test: New file. + * ammissing.test: New file. + +Sun Sep 28 17:19:52 1997 Tom Tromey + + * cxxnoc.test: Changed to reflect MKDEP change. + +Wed Sep 24 16:01:59 1997 Tom Tromey + + * output5.test: New file. + + * depend3.test: New file. + +Mon Aug 25 17:24:42 1997 Tom Tromey + + * cygwin32.test: Use AM_EXEEXT, not AM_CYGWIN32. + +Tue Aug 5 20:33:33 1997 Tom Tromey + + * libobj6.test: New file. + +Mon May 26 22:47:36 1997 Tom Tromey + + * depend.test: Fixed test. + +Sat May 10 18:28:14 1997 Tom Tromey + + * depend2.test: Fixed test; added another check. + +Sun May 4 15:47:24 1997 Tom Tromey + + * xsource.test: New file. + +Tue Apr 29 19:08:47 1997 Tom Tromey + + * cond.test, cond2.test: New files from Ian Taylor. + +Sun Apr 27 21:07:49 1997 Tom Tromey + + * confsub.test: Fixed bug. + +Fri Apr 25 12:30:22 1997 Tom Tromey + + * conf2.test: New file. + +Tue Apr 8 19:26:07 1997 Tom Tromey + + * ansi.test, empty.test, exsource.test, insh2.test, man.test, + mkinst2.test, texinfo.test, texinfo2.test: Use $MAKE. + + * defs (MAKE): Define. + +Mon Apr 7 17:35:49 1997 Tom Tromey + + * version2.test: New file. + +Wed Apr 2 00:12:26 1997 Tom Tromey + + * ldadd.test: New file. + +Fri Mar 28 23:36:04 1997 Tom Tromey + + * stamph.test: New file. + +Thu Mar 27 18:10:47 1997 Tom Tromey + + * lisp.test: New file. + +Sat Mar 22 01:14:03 1997 Tom Tromey + + * cygwin32.test: New file. + +Thu Mar 20 00:34:33 1997 Tom Tromey + + * exsource.test: Exit if not using GNU make. + +Tue Mar 18 22:36:34 1997 Tom Tromey + + * remake2.test: Changed for `missing' support. + +Sun Mar 16 14:29:45 1997 Tom Tromey + + * seenc.test: New file. + + * checkall.test, noinst.test: Don't use bogus construct when + checking. + + * libobj3.test, canon.test, target.test, spell2.test, + primary2.test, discover.test, lex2.test: Fixed to test what it + claims to test. + +Mon Mar 10 23:21:03 1997 Tom Tromey + + * libobj.test, libobj2.test: Use AC_PROG_CC. + + * confsub.test: Modified for definition of CONFIG_HEADER_FULL. + + * cxxlibobj.test: New file. + +Wed Feb 26 13:05:42 1997 Tom Tromey + + * tagsub.test: New file. + +Sun Feb 23 11:58:00 1997 Tom Tromey + + * texinfo.test, texinfo2.test, texinfo3.test, info.test, + mdate.test, vtexi.test, canon2.test, mdate2.test, vtexi2.test: + Updated for new texinfo handling. + + * texinfo4.test: New file. + * texinfo3.test: New file. + +Sat Feb 22 09:48:44 1997 Tom Tromey + + * yaccpp.test: New file. + +Tue Feb 11 09:51:47 1997 Tom Tromey + + * texinfo2.test: Fixed quoting bug. From Michael Brantley. + +Tue Feb 4 18:41:32 1997 Tom Tromey + + * confsub.test: Check subdir/Makefile.in to make sure dependency + is correct. + + * ansi2.test: ANSI2KNR dependency of all. + +Tue Dec 10 00:43:14 1996 Tom Tromey + + * defun2.test: New file. + * subst.test: New file. + +Sun Dec 8 12:25:22 1996 Tom Tromey + + * colneq2.test: New file. + +Sat Dec 7 12:52:45 1996 Tom Tromey + + * output4.test: New file. + * output3.test: New file. + * remake2.test: New file. + * output2.test: New file. + +Fri Dec 6 19:00:31 1996 Tom Tromey + + * output.test: New file. + +Thu Dec 5 18:23:17 1996 Tom Tromey + + * remake.test: New file. + * colon3.test: New file. + * colon2.test: New file. + * cxxo.test: New file. + +Wed Dec 4 00:41:44 1996 Tom Tromey + + * defs: Allow user to set interpreter via PERL environment + variable. + + * Makefile.am (distclean-local): New target. + +Tue Dec 3 11:55:18 1996 Gordon Matzigkeit + + * dup.test, dup2.test: Modified, now that aclocal allows + acinclude.m4 to override any installed macro file. + +Mon Dec 2 22:44:16 1996 Gordon Matzigkeit + + * alllib.test: Removed from distribution, since LIBFILES are no + longer computed. + +Sun Nov 24 14:36:00 1996 Tom Tromey + + * extra2.test: New file. + +Fri Nov 22 00:10:04 1996 Tom Tromey + + * stdlib.test: New file. + +Thu Nov 21 22:51:35 1996 Tom Tromey + + * confsub.test: Use AM_CONFIG_HEADER. + +Tue Nov 19 23:37:32 1996 Tom Tromey + + * confvar2.test: New file. + +Fri Nov 15 00:09:18 1996 Tom Tromey + + * ansi2.test: New file. + + * libfiles.test: Removed (obsolete). + + * libobj.test, canon4.test, libobj2.test, alllib.test, + ranlib.test: Fixed for Gord's changes to library handling. + + * Many files: Use AC_PROG_CC to avoid error. + +Thu Oct 24 15:22:53 1996 Tom Tromey + + * confvar.test: New file. + * ranlib.test: New file. + +Mon Oct 21 22:57:51 1996 Tom Tromey + + * version.test: New file. + +Fri Oct 11 00:51:04 1996 Tom Tromey + + * libobj5.test: New file. + * libobj4.test: New file. + * distdir.test: New file. + * lex2.test: New file. + +Sun Oct 6 11:00:44 1996 Tom Tromey + + * acsilent.test: New file. + * req.test: New file. + * acinclude.test: New file. + +Sat Oct 5 11:31:38 1996 Tom Tromey + + * discover.test: New file. + + * mkinst2.test: Renamed from mkinstall2.test. + + * symlink.test: New file. + +Thu Oct 3 19:55:23 1996 Tom Tromey + + * vpath.test: New file. + +Mon Sep 30 08:34:07 1996 Tom Tromey + + * comment2.test: New file. + +Mon Sep 23 00:23:34 1996 Tom Tromey + + * spell3.test: New file. + +Sun Sep 22 14:42:09 1996 Tom Tromey + + * depend2.test: New file. + +Sat Sep 21 14:01:10 1996 Tom Tromey + + * primary2.test: New file. + * primary.test: New file. + +Fri Sep 20 09:39:27 1996 Tom Tromey + + * confsub.test: New file. + +Mon Sep 16 00:05:52 1996 Tom Tromey + + * spell2.test: New file. + + * spell.test: New file. + +Thu Sep 12 14:57:49 1996 Tom Tromey + + * implicit.test: New file. + +Wed Sep 11 13:57:10 1996 Tom Tromey + + * colneq.test: New file. + + * interp2.test: New file. + +Sun Sep 8 10:47:07 1996 Tom Tromey + + * gnits.test: New file. + +Thu Sep 5 22:54:26 1996 Tom Tromey + + * libobj3.test: New file. + +Tue Sep 3 20:57:38 1996 Tom Tromey + + * block.test: New file. + +Mon Aug 26 23:04:01 1996 Tom Tromey + + * alllib.test: New file. + + * interp.test: New file. + +Mon Aug 12 13:58:55 1996 Tom Tromey + + * libobj2.test: New file. + + * order.test: New file. + +Sun Aug 11 00:10:42 1996 Tom Tromey + + * cxxnoc.test: New file. + + * cxxlink.test: Use AC_PROG_CXX. + + * lex.test: Use AC_PROG_LEX, AC_DECL_YYTEXT. + + * yacc.test: Use AC_PROG_YACC in configure.in. + + * cxxlink.test: New file. + + * yacc.test: Fixed test for new yacc code. + +Sat Aug 10 10:09:45 1996 Tom Tromey + + * defun.test: New file. + + * dup.test: New file. + +Fri Aug 9 09:18:07 1996 Tom Tromey + + * canon4.test: New file. + +Thu Aug 8 10:47:45 1996 Tom Tromey + + * exsource.test: New file. + + * subdir2.test: New file. + + * scripts.test: New file. + +Tue Aug 6 12:30:41 1996 Tom Tromey + + * lex.test: New file. + +Mon Aug 5 01:03:03 1996 Tom Tromey + + * obsolete.test: New file. + + * Many files: Use AM_ macros, not fp_ macros. + + * info.test: New file. + +Sun Aug 4 12:47:34 1996 Tom Tromey + + * man.test: New file. + + * acouttbs2.test: New file. + + * libfiles.test: New file. + + * comment.test: New file. + + * tags.test: New file. + + * vtexi2.test: New file. + + * colon.test: New file. + +Sun Jul 28 11:43:00 1996 Tom Tromey + + * defs (ACLOCAL): Added definition. + + * depacl.test, depacl2.test, error.test: New tests for aclocal. + +Fri Jul 19 10:09:56 1996 Tom Tromey + + * ansi.test: New file. + +Sun Jun 9 23:20:03 1996 Tom Tromey + + * texinfo2.test: New file. + +Sat Jun 8 10:00:42 1996 Tom Tromey + + * mkinstall2.test: New file. + +Fri Jun 7 18:17:11 1996 Tom Tromey + + * yacc.test: New file. + +Sun Jun 2 09:04:52 1996 Tom Tromey + + * dejagnu.test: New file. + + * texinfo.test: New file. + +Thu May 23 09:58:48 1996 Tom Tromey + + * fpinst2.test: New file. + + * fpinstall.test: New file. + +Wed May 22 09:45:52 1996 Tom Tromey + + * outdir.test: New file. + +Sat May 18 10:51:37 1996 Tom Tromey + + * insh2.test: New file. + +Fri May 17 17:32:35 1996 Tom Tromey + + * number.test: New file. + + * defs, many .test files: Define PACKAGE and VERSION in + configure.in. + + * package.test: New file. + + * backsl.test: New file. + +Thu May 16 09:15:57 1996 Tom Tromey + + * subdir.test: New file. + +Tue May 14 10:17:17 1996 Tom Tromey + + * mdate2.test: New file, from report by Jim Meyering. + + * canon3.test: New file. + + * auxdir.test: New file. + + * mkinstall.test: New file. + + * extra.test: Reversed sense of test. + +Fri Apr 26 15:15:01 1996 Tom Tromey + + * instman.test: New file. + +Thu Apr 25 17:12:30 1996 Tom Tromey + + * noinst.test: New file + + * exdir.test: Quoting change from Gord Matzigkeit. + + * extra.test (EXTRA_PROGRAMS): New file. + +Tue Apr 9 22:55:07 1996 Tom Tromey + + * target.test: New file. + +Wed Apr 3 15:10:54 1996 Tom Tromey + + * canon2.test: New file + + * insh.test: New file. + +Wed Mar 27 23:31:51 1996 Tom Tromey + + * rulepat.test: New file. + +Sat Mar 16 08:37:36 1996 Tom Tromey + + * empty.test: New file. + +Fri Mar 15 17:55:13 1996 Tom Tromey + + * installsh.test: New file. + +Tue Mar 5 16:22:46 1996 Tom Tromey + + * badprog.test: Rewrote. + + * canon.test: New file. + +Mon Mar 4 21:08:37 1996 Tom Tromey + + * exdir.test: New file. + +Fri Mar 1 17:23:53 1996 Tom Tromey + + * depend.test: New file. + + * badprog.test: New file. + + * defs (AUTOMAKE): Pass --foreign. + +Thu Feb 29 20:23:42 1996 Tom Tromey + + More tests: + * prefix.test: New file. + * spelling.test: New file + * confincl.test: New file. + * Makefile.am (TESTS): Updated. + +Wed Feb 28 11:57:02 1996 Tom Tromey + + * acoutqnl.test: New file. + * Makefile.am (TESTS): Include it. + +Tue Feb 27 10:52:58 1996 Tom Tromey + + * Makefile.am (DIST_OTHER): Include "defs". + + * defs (AUTOMAKE): Never relative to $srcdir. + +Mon Feb 26 23:14:08 1996 Tom Tromey + + * libobj.test: Put AC_PROG_RANLIB in configure.in + +Mon Feb 19 08:22:22 1996 Tom Tromey + + * proginst.test: New file. + +Tue Feb 13 18:54:39 1996 Tom Tromey + + * libobj.test: New file. + +Mon Feb 12 17:05:48 1996 Tom Tromey + + * acouttbs.test: New file. + + * Makefile.am (DIST_OTHER): New variable. + + * acoutnoq.test: New file. + +Sun Feb 11 16:39:14 1996 Tom Tromey + + * checkall.test: Delay a little. + + * Makefile.am (check-local): Print name of failing test. + +Sat Feb 10 17:08:39 1996 Tom Tromey + + * checkall.test: New file. + + * instexec.test: New file. + + * mdate.test, vtexi.test, acoutput.test: New files. + + * Started. diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..86d353c --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,45 @@ +## Process this file with automake to create Makefile.in + +TESTS = acinclude.test aclocal.test aclocali.test aclocalii.test \ +acoutnoq.test acoutput.test acoutqnl.test acouttbs.test acsilent.test \ +all.test alpha.test ammissing.test ansi.test ansi2.test ansi3.test \ +auxdir.test backsl.test badline.test badprog.test block.test \ +canon.test canon2.test canon3.test canon4.test checkall.test \ +clean.test colneq.test colneq2.test colon.test colon2.test colon3.test \ +colon4.test colon5.test colon6.test colon7.test comment.test \ +comment2.test compile_f_c_cxx.test cond.test cond2.test cond3.test \ +cond4.test cond5.test cond6.test cond7.test condman.test condman2.test \ +conf2.test confdist.test confh.test confh2.test confh3.test \ +config.test confincl.test confsub.test confvar.test confvar2.test \ +cxxcpp.test cxxlibobj.test cxxlink.test cxxnoc.test cxxo.test \ +cygwin32.test defun.test defun2.test dejagnu.test depacl.test \ +depacl2.test depend.test depend2.test depend3.test discover.test \ +distdir.test dup2.test else.test empty.test error.test \ +exdir.test exdir2.test exsource.test extra.test extra3.test \ +extra4.test flibs.test fnoc.test fo.test fonly.test fpinst2.test \ +fpinstall.test gnits.test implicit.test include.test info.test \ +insh.test insh2.test install.test installsh.test instdata.test \ +instexec.test insthook.test instman.test interp.test interp2.test \ +java.test javaprim.test javasubst.test ldadd.test lex.test lex2.test \ +libobj.test libobj2.test libobj3.test libobj4.test libobj5.test \ +libobj6.test libobj7.test libobj8.test library.test link_c_cxx.test \ +link_f_c.test link_f_c_cxx.test link_f_cxx.test link_f_only.test \ +lisp.test mdate.test mdate2.test mdate3.test mkinst2.test \ +mkinstall.test noinst.test number.test objc.test obsolete.test \ +order.test outdir.test output.test output2.test output3.test \ +output4.test output5.test package.test parse.test pluseq.test \ +pluseq2.test pluseq3.test pluseq4.test pluseq5.test prefix.test \ +primary.test primary2.test proginst.test ranlib.test recurs.test \ +recurs2.test remake.test remake2.test req.test rulepat.test \ +scripts.test seenc.test sinclude.test spell.test spell2.test \ +spell3.test spelling.test stamph.test stdlib.test subdir.test \ +subdir2.test subst.test symlink.test syntax.test tags.test tagsub.test \ +target.test texinfo.test texinfo2.test texinfo3.test texinfo4.test \ +texinfo5.test texinfo6.test texinfo7.test unused.test version.test \ +version2.test version3.test version4.test vpath.test vtexi.test \ +vtexi2.test whoami.test xsource.test yacc.test yaccpp.test + +EXTRA_DIST = defs $(TESTS) + +distclean-local: + -rm -rf testSubDir diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..d779ed6 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,201 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 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. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +APIVERSION = @APIVERSION@ +LN = @LN@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +TAR = @TAR@ +VERSION = @VERSION@ +pkgvdatadir = @pkgvdatadir@ + +TESTS = acinclude.test aclocal.test aclocali.test aclocalii.test acoutnoq.test acoutput.test acoutqnl.test acouttbs.test acsilent.test all.test alpha.test ammissing.test ansi.test ansi2.test ansi3.test auxdir.test backsl.test badline.test badprog.test block.test canon.test canon2.test canon3.test canon4.test checkall.test clean.test colneq.test colneq2.test colon.test colon2.test colon3.test colon4.test colon5.test colon6.test colon7.test comment.test comment2.test compile_f_c_cxx.test cond.test cond2.test cond3.test cond4.test cond5.test cond6.test cond7.test condman.test condman2.test conf2.test confdist.test confh.test confh2.test confh3.test config.test confincl.test confsub.test confvar.test confvar2.test cxxcpp.test cxxlibobj.test cxxlink.test cxxnoc.test cxxo.test cygwin32.test defun.test defun2.test dejagnu.test depacl.test depacl2.test depend.test depend2.test depend3.test discover.test distdir.test dup2.test else.test empty.test error.test exdir.test exdir2.test exsource.test extra.test extra3.test extra4.test flibs.test fnoc.test fo.test fonly.test fpinst2.test fpinstall.test gnits.test implicit.test include.test info.test insh.test insh2.test install.test installsh.test instdata.test instexec.test insthook.test instman.test interp.test interp2.test java.test javaprim.test javasubst.test ldadd.test lex.test lex2.test libobj.test libobj2.test libobj3.test libobj4.test libobj5.test libobj6.test libobj7.test libobj8.test library.test link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test link_f_only.test lisp.test mdate.test mdate2.test mdate3.test mkinst2.test mkinstall.test noinst.test number.test objc.test obsolete.test order.test outdir.test output.test output2.test output3.test output4.test output5.test package.test parse.test pluseq.test pluseq2.test pluseq3.test pluseq4.test pluseq5.test prefix.test primary.test primary2.test proginst.test ranlib.test recurs.test recurs2.test remake.test remake2.test req.test rulepat.test scripts.test seenc.test sinclude.test spell.test spell2.test spell3.test spelling.test stamph.test stdlib.test subdir.test subdir2.test subst.test symlink.test syntax.test tags.test tagsub.test target.test texinfo.test texinfo2.test texinfo3.test texinfo4.test texinfo5.test texinfo6.test texinfo7.test unused.test version.test version2.test version3.test version4.test vpath.test vtexi.test vtexi2.test whoami.test xsource.test yacc.test yaccpp.test + + +EXTRA_DIST = defs $(TESTS) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = ChangeLog Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps tests/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = tests + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +check-TESTS: $(TESTS) + @failed=0; all=0; \ + srcdir=$(srcdir); export srcdir; \ + for tst in $(TESTS); do \ + if test -f $$tst; then dir=.; \ + else dir="$(srcdir)"; fi; \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ + echo "PASS: $$tst"; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir check-TESTS info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +distclean-local: + -rm -rf testSubDir + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/acinclude.test b/tests/acinclude.test new file mode 100755 index 0000000..59133a2 --- /dev/null +++ b/tests/acinclude.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure acinclude is actually included. +# Report from Jim Meyering. + +. $srcdir/defs || exit 1 + +echo moo > acinclude.m4 + +$ACLOCAL || exit 1 + +grep moo aclocal.m4 diff --git a/tests/aclocal.test b/tests/aclocal.test new file mode 100755 index 0000000..7192fda --- /dev/null +++ b/tests/aclocal.test @@ -0,0 +1,11 @@ +#! /bin/sh + +# Test to make sure that aclocal --output works. Report from +# Alexandre Oliva. +. $srcdir/defs || exit 1 + +# configure.in has to have some macro that aclocal can find. +echo 'AM_INIT_AUTOMAKE' >> configure.in + +$ACLOCAL --output=fred || exit 1 +test -f fred diff --git a/tests/aclocali.test b/tests/aclocali.test new file mode 100755 index 0000000..dfd3d33 --- /dev/null +++ b/tests/aclocali.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Make sure that ACLOCAL_AMFLAGS actually gets the right dependencies. +. $srcdir/defs || exit 1 + +echo AM_QUUX >> configure.in + +mkdir macros + +cat > macros/quux.m4 << 'END' +AC_DEFUN([AM_QUUX], [ +]) +END + +cat > Makefile.am << 'END' +ACLOCAL_AMFLAGS = -I macros +END + +# We have to run aclocal first to make sure that aclocal.m4 exists. +# Otherwise automake won't guess that we want to auto-generate it. +$ACLOCAL -I macros || exit 1 + +$AUTOMAKE || exit 1 + +fgrep quux.m4 Makefile.in diff --git a/tests/aclocalii.test b/tests/aclocalii.test new file mode 100755 index 0000000..5dcae3d --- /dev/null +++ b/tests/aclocalii.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure include of include detects missing macros +. $srcdir/defs || exit 1 + +echo GNOME_X_CHECKS >> configure.in + +mkdir macros + +cat > macros/gnome.m4 << 'END' +AC_DEFUN([GNOME_X_CHECKS], [ + AM_PATH_GTK(0.99.5,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path)) +]) +END + +$ACLOCAL -I macros && exit 1 +exit 0 diff --git a/tests/acoutnoq.test b/tests/acoutnoq.test new file mode 100755 index 0000000..f753800 --- /dev/null +++ b/tests/acoutnoq.test @@ -0,0 +1,21 @@ +#!/bin/sh + +# Test for bug reported by Jerome Santini. +# If I put this line in my configure.in: +# AC_OUTPUT(Makefile src/Makefile tests/Makefile, echo timestamp > stamp-h)dnl +# automake is not happy: +# [ ... ] + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile, [true]) +END + +: > Makefile.am + +$AUTOMAKE diff --git a/tests/acoutput.test b/tests/acoutput.test new file mode 100755 index 0000000..53c59d0 --- /dev/null +++ b/tests/acoutput.test @@ -0,0 +1,18 @@ +#!/bin/sh + +# Test for bug when AC_OUTPUT has 2 args on the same line, eg: +# AC_OUTPUT([Makefile automake tests/Makefile],[chmod +x automake]) + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT([Makefile], [true]) +END + +: > Makefile.am + +$AUTOMAKE diff --git a/tests/acoutqnl.test b/tests/acoutqnl.test new file mode 100755 index 0000000..94c909d --- /dev/null +++ b/tests/acoutqnl.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for bug reported by François Pinard. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT([Makefile], +[echo zardoz has spoken]) +END + +: > Makefile.am + +$AUTOMAKE + diff --git a/tests/acouttbs.test b/tests/acouttbs.test new file mode 100755 index 0000000..88be5d2 --- /dev/null +++ b/tests/acouttbs.test @@ -0,0 +1,20 @@ +#!/bin/sh + +# Test for bug reported by François Pinard. +# If \ is in AC_OUTPUT, automake barfs. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile \ +zot) +END + +: > Makefile.am +: > zot.in + +$AUTOMAKE diff --git a/tests/acsilent.test b/tests/acsilent.test new file mode 100755 index 0000000..a3ae6ee --- /dev/null +++ b/tests/acsilent.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure there are no spurious acinclude warnings. + +. $srcdir/defs || exit 1 + +echo AM_INIT_GUILE_MODULE > configure.in + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_INIT_GUILE_MODULE],[ +. $srcdir/../GUILE-VERSION +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AC_CONFIG_AUX_DIR(..) +module=[$1] +AC_SUBST(module)]) +END + +$ACLOCAL > output 2>&1 || exit 1 +test -z "`cat output`" diff --git a/tests/all.test b/tests/all.test new file mode 100755 index 0000000..61e1292 --- /dev/null +++ b/tests/all.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure all-local and other -local targets work correctly. + +. $srcdir/defs || exit 1 + +for target in all install-exec install-data uninstall; do + echo "Doing $target" + echo "${target}-local:" > Makefile.am + + $AUTOMAKE || exit 1 + + fgrep "${target}-local ${target}-local" Makefile.in && exit 1 +done +exit 0 diff --git a/tests/alpha.test b/tests/alpha.test new file mode 100755 index 0000000..a3122a4 --- /dev/null +++ b/tests/alpha.test @@ -0,0 +1,28 @@ +#! /bin/sh + +# Make sure README-alpha is distributed when appropriate. Report from +# Jim Meyering. +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AM_INIT_AUTOMAKE(zardoz, 1.5e) +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = gnits +END + +: > README-alpha + +# Gnits stuff. +: > INSTALL +: > NEWS +: > README +: > COPYING +: > AUTHORS +: > ChangeLog +: > THANKS + +$AUTOMAKE || exit 1 + +grep README-alpha Makefile.in diff --git a/tests/ammissing.test b/tests/ammissing.test new file mode 100755 index 0000000..054204a --- /dev/null +++ b/tests/ammissing.test @@ -0,0 +1,10 @@ +#! /bin/sh + +# Test to see if aclocal correctly reports missing AM_ macro. + +. $srcdir/defs || exit 1 + +echo AM_ZARDOZ >> configure.in + +$ACLOCAL && exit 1 +exit 0 diff --git a/tests/ansi.test b/tests/ansi.test new file mode 100755 index 0000000..1140cad --- /dev/null +++ b/tests/ansi.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Test for bug where ansi2knr.c is not included in distribution. +# From François Pinard. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = ansi2knr +magic: + @echo $(DISTFILES) +END + +cat >> configure.in << 'END' +AM_C_PROTOTYPES +END + +: > ansi2knr.c +: > ansi2knr.1 + +$AUTOMAKE || exit 1 + +$MAKE -s -f Makefile.in SHELL=/bin/sh magic | grep 'ansi2knr\.c' diff --git a/tests/ansi2.test b/tests/ansi2.test new file mode 100755 index 0000000..9f51f8e --- /dev/null +++ b/tests/ansi2.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure ansi2knr built at the right time. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = ansi2knr +bin_PROGRAMS = joe +END + +cat >> configure.in << 'END' +AC_PROG_CC +AM_C_PROTOTYPES +END + +: > ansi2knr.c +: > ansi2knr.1 + +$AUTOMAKE || exit 1 + +grep '^all[-a-z]*:.*ANSI2KNR' Makefile.in diff --git a/tests/ansi3.test b/tests/ansi3.test new file mode 100755 index 0000000..d225054 --- /dev/null +++ b/tests/ansi3.test @@ -0,0 +1,44 @@ +#! /bin/sh + +# Actual test of ansi2knr functionality. Relies on existence +# of working gcc. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT(hello.c) +AM_INIT_AUTOMAKE(hello,0.23) +AC_PROG_CC +AM_C_PROTOTYPES +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = ansi2knr +bin_PROGRAMS = hello +END + +cat > hello.c << 'END' +#include +int +main (int argc, char *argv[]) +{ + printf ("yeah, yeah\n"); + return 0; +} +END + +# Fail gracefully if no autoconf. +(autoconf --version) > /dev/null 2>&1 || exit 0 + +# Likewise for gcc. +(gcc -v) > /dev/null 2>&1 || exit 0 + +# We use gcc and not gcc -traditional as the latter fails on some +# Linux boxes (Red Hat 5.1 in particular). +$ACLOCAL \ + && autoconf \ + && $AUTOMAKE -a \ + && CC='gcc' ./configure \ + && $MAKE ANSI2KNR=./ansi2knr U=_ \ + && ./hello diff --git a/tests/auxdir.test b/tests/auxdir.test new file mode 100755 index 0000000..cf6872d --- /dev/null +++ b/tests/auxdir.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure AC_CONFIG_AUX_DIR works correctly. + +. $srcdir/defs || exit 1 + +# The "./." is here so we don't have to mess with subdirs. +cat >> configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_CONFIG_AUX_DIR(./.) +END + +cat > Makefile.am << 'END' +pkgdata_DATA = +END + +# The "././" prefix confuses Automake into thinking it is doing a +# subdir build. Yes, this is hacky. +$AUTOMAKE ././Makefile || exit 1 + +grep '/\./\./mkinstalldirs' Makefile.in diff --git a/tests/backsl.test b/tests/backsl.test new file mode 100755 index 0000000..a35c5d1 --- /dev/null +++ b/tests/backsl.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for "\" problems. Bug report from Joerg-Martin Schwarz. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = \ + frob +END + +$AUTOMAKE || exit 1 + +grep '^_SOURCE' Makefile.in && exit 1 +exit 0 diff --git a/tests/badline.test b/tests/badline.test new file mode 100755 index 0000000..16ad128 --- /dev/null +++ b/tests/badline.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure that line number and file name in error message +# referring to variable is always correct. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_SUBST(TEXINFOS) +END + +: > Makefile.am + +$AUTOMAKE > out 2>&1 && exit 1 +grep Makefile out && exit 1 +exit 0 diff --git a/tests/badprog.test b/tests/badprog.test new file mode 100755 index 0000000..91876a7 --- /dev/null +++ b/tests/badprog.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure that programs with bad names are properly +# transformed. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = a,b +a_b_SOURCES = ab.c +END + +$AUTOMAKE diff --git a/tests/block.test b/tests/block.test new file mode 100755 index 0000000..8ec8c25 --- /dev/null +++ b/tests/block.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Make sure block comments are not double-spaced. +# Report from François Pinard. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +#START +#a +#b +#c +#END +END + +$AUTOMAKE || exit 1 + +(sed -e '/^#START/,/^#END/ !d' Makefile.in | grep -v '^#') && exit 1 +exit 0 diff --git a/tests/canon.test b/tests/canon.test new file mode 100755 index 0000000..b54caf3 --- /dev/null +++ b/tests/canon.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure that name canonicalization error works. + +. $srcdir/defs || exit 1 + +echo AC_PROG_CC >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = sniff-glue +sniff-glue_SOURCES = sg.c +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/canon2.test b/tests/canon2.test new file mode 100755 index 0000000..0efe346 --- /dev/null +++ b/tests/canon2.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure name canonicalization happens for texinfo. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = zar-doz.texi +zar_doz_TEXINFOS = frob.texi +END + +: > texinfo.tex +echo '@setfilename zar-doz.info' > zar-doz.texi +echo '@setfilename frob' > frob.texi + +$AUTOMAKE || exit 1 + +grep zar-doz_TEXINFOS Makefile.in && exit 1 +exit 0 diff --git a/tests/canon3.test b/tests/canon3.test new file mode 100755 index 0000000..d7a28a7 --- /dev/null +++ b/tests/canon3.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Yet another canonicalization test. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = perm-number +END + +: > perm-number.c + +$AUTOMAKE || exit 1 + +grep 'perm_number\.c' Makefile.in && exit 1 +exit 0 diff --git a/tests/canon4.test b/tests/canon4.test new file mode 100755 index 0000000..5ca51e7 --- /dev/null +++ b/tests/canon4.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure name canonicalization happens for libraries. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_RANLIB +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libx-y.a +libx_y_a_SOURCES = xy.c +END + +$AUTOMAKE || exit 1 + +grep '^libx-y.*=' Makefile.in && exit 1 +exit 0 diff --git a/tests/checkall.test b/tests/checkall.test new file mode 100755 index 0000000..34b7230 --- /dev/null +++ b/tests/checkall.test @@ -0,0 +1,16 @@ +#!/bin/sh + +# Test for bug where check target doesn't depend on all. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_SCRIPTS = derived +check-local: + true +END + +$AUTOMAKE || exit 1 + +grep '^check-am:.*all-am' Makefile.in || exit 1 +grep 'MAKE.*check-local' Makefile.in diff --git a/tests/clean.test b/tests/clean.test new file mode 100755 index 0000000..e34173f --- /dev/null +++ b/tests/clean.test @@ -0,0 +1,11 @@ +#! /bin/sh + +# Test to make sure a clean target depends on previous one. + +. $srcdir/defs || exit 1 + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep '^clean-am:.*mostlyclean-am' Makefile.in diff --git a/tests/colneq.test b/tests/colneq.test new file mode 100755 index 0000000..e3db494 --- /dev/null +++ b/tests/colneq.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test that := definitions work. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +ICONS := $(wildcard *.xbm) +data_DATA = $(ICONS) +END + +$AUTOMAKE diff --git a/tests/colneq2.test b/tests/colneq2.test new file mode 100755 index 0000000..a5af04c --- /dev/null +++ b/tests/colneq2.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test that := in var substitutions works. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +t = a b c +EXTRA_DIST = $(t:=.test) +END + +: > a.test +: > b.test +: > c.test + +$AUTOMAKE diff --git a/tests/colon.test b/tests/colon.test new file mode 100755 index 0000000..672bb54 --- /dev/null +++ b/tests/colon.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test for bug reported by Nyul Laszlo. When using the ":" syntax in +# AC_OUTPUT, Automake fails to find the correct file. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile foo.h:foo.hin) +END + +: > Makefile.am +: > foo.hin +: > stamp-h.in + +$AUTOMAKE diff --git a/tests/colon2.test b/tests/colon2.test new file mode 100755 index 0000000..feeda98 --- /dev/null +++ b/tests/colon2.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Make sure ":" works with files automake generates. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile:zardoz.in) +END + +: > zardoz.am + +$AUTOMAKE || exit 1 + +# We actually check several things here. +test -f zardoz.in || exit 1 +grep '^zardoz:' zardoz.in && exit 1 +exit 0 diff --git a/tests/colon3.test b/tests/colon3.test new file mode 100755 index 0000000..41ee212 --- /dev/null +++ b/tests/colon3.test @@ -0,0 +1,41 @@ +#! /bin/sh + +# Make sure ":" works with files automake generates. +# This test is for multiple ":"s. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile:zardoz.in:two.in:three.in) +END + +: > zardoz.am +: > two.in +: > three.in + +$AUTOMAKE || exit 1 + +# We actually check several things here. +# Automake should have created zardoz.in. +test -f zardoz.in || exit 1 + +# The generated file should refer to zardoz.in and zardoz.am, but +# never just "zardoz" -- except the actual automake invocation can +# refer to it (don't ask). +echo Grep1 +grep zardoz zardoz.in | fgrep -v 'zardoz.in' | fgrep -v 'zardoz.am' \ + | fgrep -v AUTOMAKE > O +# We cat the output file so we see in when verbose. +cat O +test -z "`cat O`" || exit 1 + +# Makefile should depend on two.in. +echo Grep2 +grep '^Makefile:.* two.in' zardoz.in || exit 1 +# Likewise three.in. +echo Grep3 +grep '^Makefile:.* three.in' zardoz.in diff --git a/tests/colon4.test b/tests/colon4.test new file mode 100755 index 0000000..c94059d --- /dev/null +++ b/tests/colon4.test @@ -0,0 +1,26 @@ +#! /bin/sh + +# Make sure ":" works with files automake generates. +# This test is for multiple ":"s. +# Test from Maciej W. Rozycki. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile zardoz:one:two:three) +END + +: > Makefile.am +: > one +: > two +: > three + +$AUTOMAKE || exit 1 + +# The rule should regenerate the file "zardoz". +grep '^zardoz:one:two' Makefile.in && exit 1 +exit 0 diff --git a/tests/colon5.test b/tests/colon5.test new file mode 100755 index 0000000..f1ca626 --- /dev/null +++ b/tests/colon5.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Another multi-":" test, this time from Doug Evans. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile:Makefile.in:Makefile.dep) +END + +: > Makefile.am +: > Makefile.dep + +$AUTOMAKE || exit 1 + +grep 'Makefile:Makefile.in' Makefile.in diff --git a/tests/colon6.test b/tests/colon6.test new file mode 100755 index 0000000..f156d3e --- /dev/null +++ b/tests/colon6.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Yet another multi-":" test, this time from Ken Pizzini. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(demo/Makefile demo/version.good:demo/version.gin) +END + +mkdir demo + +: > demo/Makefile.am +: > demo/version.gin + +$AUTOMAKE diff --git a/tests/colon7.test b/tests/colon7.test new file mode 100755 index 0000000..0e57f92 --- /dev/null +++ b/tests/colon7.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Another test for a failing ":" in AC_OUTPUT. Report from Maciej +# Stachowiak. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(subdir/bar:subdir/foo \ + Makefile \ + subdir/Makefile +) +END + +: > Makefile.am + +mkdir subdir +: > subdir/Makefile.am +: > subdir/foo + +$AUTOMAKE diff --git a/tests/comment.test b/tests/comment.test new file mode 100755 index 0000000..1d2b4f3 --- /dev/null +++ b/tests/comment.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Make sure that `#' as start of word in AUTOMAKE_OPTIONS means +# comment. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = #no such option +END + +$AUTOMAKE diff --git a/tests/comment2.test b/tests/comment2.test new file mode 100755 index 0000000..d25a19a --- /dev/null +++ b/tests/comment2.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Make sure comment recognition works in PROGRAMS. Report from Mark +# Galassi. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = sim_products receive_th receive_pos # image_proc +END + +$AUTOMAKE || exit 1 + +grep '^image_proc' Makefile.in && exit 1 +exit 0 diff --git a/tests/compile_f_c_cxx.test b/tests/compile_f_c_cxx.test new file mode 100755 index 0000000..2ef19dc --- /dev/null +++ b/tests/compile_f_c_cxx.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Test to make sure rules to invoke all compilers are selected with +# mixed source objects. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +AC_PROG_F77 +AC_F77_LIBRARY_LDFLAGS +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = foo.f bar.c baz.cc +foo_LDADD = @FLIBS@ +END + +: > foo.f +: > bar.c +: > baz.cc + +$AUTOMAKE || exit 1 + + +# Look for the macros at the beginning of rules. Be careful, as there +# are literal tabs at the beginning of the search strings. +grep ' \$(COMPILE)' Makefile.in || exit 1 +grep ' \$(CXXCOMPILE)' Makefile.in || exit 1 +grep ' \$(F77COMPILE)' Makefile.in || exit 1 + +exit 0 diff --git a/tests/cond.test b/tests/cond.test new file mode 100755 index 0000000..459b64b --- /dev/null +++ b/tests/cond.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Check basic use of conditionals. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AM_CONDITIONAL(TEST, true) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +if TEST +VAR = true +else +VAR = false +endif +END + +$AUTOMAKE || exit 1 + +grep '^@TEST_TRUE@' Makefile.in || exit 1 +exit 0 diff --git a/tests/cond2.test b/tests/cond2.test new file mode 100755 index 0000000..8e4ee5b --- /dev/null +++ b/tests/cond2.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Check SUBDIRS set based on conditionals. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AM_CONDITIONAL(TEST, true) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +if TEST +DIR = dir1 +else +DIR = dir2 +endif +SUBDIRS = $(DIR) +END + +mkdir dir1 + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/cond3.test b/tests/cond3.test new file mode 100755 index 0000000..44a3760 --- /dev/null +++ b/tests/cond3.test @@ -0,0 +1,43 @@ +#! /bin/sh + +# Test sources listed in conditional. +# Report from Rob Savoye . + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_PROG_CC +AM_CONDITIONAL(ONE, true) +AM_CONDITIONAL(TWO, false) +AM_CONDITIONAL(THREE, maybe) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = targ + +if ONE +SONE = one.c +else +SONE = +endif + +if TWO +STWO = two.c +else +STWO = +endif + +if THREE +STHREE = three.c +else +STHREE = +endif + +targ_SOURCES = $(SONE) $(STWO) $(STHREE) +END + +$AUTOMAKE || exit 1 + +test "`grep 'targ_OBJECTS =' Makefile.in | wc -l`" -eq 8 diff --git a/tests/cond4.test b/tests/cond4.test new file mode 100755 index 0000000..42d7251 --- /dev/null +++ b/tests/cond4.test @@ -0,0 +1,31 @@ +#! /bin/sh + +# Another sources-in-conditional test. Report from Tim Goodwin. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_PROG_CC +AM_CONDITIONAL(ONE, true) +AM_CONDITIONAL(TWO, false) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = targ + +if ONE +OPT1 = one.c +endif + +if TWO +OPT2 = two.c +endif + +targ_SOURCES = main.c $(OPT1) $(OPT2) +END + +$AUTOMAKE || exit 1 + +test "`grep TWO_FALSE Makefile.in | wc -l`" -eq 2 diff --git a/tests/cond5.test b/tests/cond5.test new file mode 100755 index 0000000..ff65743 --- /dev/null +++ b/tests/cond5.test @@ -0,0 +1,39 @@ +#! /bin/sh + +# Yet another sources-in-conditional test. Report from Tim Goodwin. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_PROG_CC +AM_CONDITIONAL(ONE, true) +AM_CONDITIONAL(TWO, false) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = targ + +if ONE +OPT_SRC = one.c +endif + +if TWO +OPT_SRC = $(OPT_SRC) two.c +endif + +targ_SOURCES = main.c $(OPT_SRC) +END + +# The bug is that automake hangs. So we give it a few seconds and +# then kill it. +$AUTOMAKE & +pid=$! + +sleep 5 +kill -0 $pid && { + kill $pid + exit 1 +} +exit 0 diff --git a/tests/cond6.test b/tests/cond6.test new file mode 100755 index 0000000..7ea2510 --- /dev/null +++ b/tests/cond6.test @@ -0,0 +1,26 @@ +#! /bin/sh + +# Test for an odd conditional bug. Report from Matt Leach. + +. $srcdir/defs || exit 1 + +echo 'AM_CONDITIONAL(FOO, true)' >> configure.in + +cat > Makefile.am << 'END' + +if FOO + +helpdir = $(prefix)/Help +# The continuation line below must start with a Tab to see the bug. +help_DATA = a b c d e \ + f g h + +else + +helpdir = $(prefix)/help +help_DATA = foo + +endif +END + +$AUTOMAKE diff --git a/tests/cond7.test b/tests/cond7.test new file mode 100755 index 0000000..7a257b4 --- /dev/null +++ b/tests/cond7.test @@ -0,0 +1,26 @@ +#! /bin/sh + +# Test for an odd conditional bug. Report from Pavel Roskin. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT() +AM_INIT_AUTOMAKE(test,0.1) +compat=yes +AM_CONDITIONAL(Compatible, test x$compat = xyes) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS=foreign +if Compatible +abdir = none +ab_HEADERS = \ + minus.h +endif +END + +$AUTOMAKE || exit 1 +grep '002' Makefile.in && exit 1 +exit 0 diff --git a/tests/condman.test b/tests/condman.test new file mode 100755 index 0000000..4559c94 --- /dev/null +++ b/tests/condman.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Make sure conditionals work with man pages. +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AM_CONDITIONAL(FRED, true) +END + +cat > Makefile.am << 'END' +if FRED +man_MANS = foo.1 +else +man_MANS = joe.1 +endif +END + +: > foo.1 +: > joe.1 + +$AUTOMAKE diff --git a/tests/condman2.test b/tests/condman2.test new file mode 100755 index 0000000..941b24e --- /dev/null +++ b/tests/condman2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Make sure appropriate man install targets generated in all cases. +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +man_MANS = foo.1 foo.2 +man5_MANS = foo.5 +END + +$AUTOMAKE || exit 1 + +grep '^install-man1:' Makefile.in || exit 1 +grep '^install-man2:' Makefile.in || exit 1 +grep '^install-man5:' Makefile.in || exit 1 diff --git a/tests/conf2.test b/tests/conf2.test new file mode 100755 index 0000000..52a0265 --- /dev/null +++ b/tests/conf2.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure several config headers are allowed. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_CONFIG_HEADER(config.h two.h) +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +: > Makefile.am + +: > config.h.in +: > two.h.in + +$AUTOMAKE diff --git a/tests/confdist.test b/tests/confdist.test new file mode 100755 index 0000000..f02307e --- /dev/null +++ b/tests/confdist.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure configure is included in distribution. Report +# from Eleftherios Gkioulekas. + +. $srcdir/defs || exit 1 + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep '^DIST_COMMON.*configure ' Makefile.in diff --git a/tests/confh.test b/tests/confh.test new file mode 100755 index 0000000..6b70705 --- /dev/null +++ b/tests/confh.test @@ -0,0 +1,32 @@ +#! /bin/sh + +# Test to make sure config.h works in a subdir. +# Report from Alexandre Oliva. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AM_CONFIG_HEADER(include/config.h) +AC_OUTPUT(Makefile) +END + +: > Makefile.am +: > acconfig.h + +mkdir include +: > include/config.h.in + +$AUTOMAKE || exit 1 + +grep '^DIST_COMMON =.* acconfig.h' Makefile.in || exit 1 +grep 'stamp-h.in:.*acconfig.h' Makefile.in || exit 1 + +# Make sure re-running automake in a different way generates same +# Makefile.in. +mv Makefile.in save +$AUTOMAKE Makefile || exit 1 +cmp Makefile.in save diff --git a/tests/confh2.test b/tests/confh2.test new file mode 100755 index 0000000..45b64f8 --- /dev/null +++ b/tests/confh2.test @@ -0,0 +1,28 @@ +#! /bin/sh + +# Test to make sure stamp files created correctly. +# Report from Erez Zadok. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AM_CONFIG_HEADER(config.h:include/config.h.in) +AC_OUTPUT(Makefile) +END + +: > Makefile.am +: > acconfig.h + +mkdir include +: > include/config.h.in + +$AUTOMAKE || exit 1 + +grep '^config.h:' Makefile.in || exit 1 +fgrep 'echo timestamp > stamp-h' Makefile.in || exit 1 +fgrep '../include/config.h.in' Makefile.in && exit 1 +exit 0 diff --git a/tests/confh3.test b/tests/confh3.test new file mode 100755 index 0000000..8cfe589 --- /dev/null +++ b/tests/confh3.test @@ -0,0 +1,30 @@ +#! /bin/sh + +# Another test to make sure stamp files created correctly. +# Report from Erez Zadok. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AM_CONFIG_HEADER(d1/config.h:d2/config.h.in) +AC_OUTPUT(Makefile d1/Makefile) +END + +: > Makefile.am +: > acconfig.h + +mkdir d1 d2 + +: > d1/Makefile.am + +: > d2/config.h.in + +$AUTOMAKE || exit 1 + +grep '^config.h:' d1/Makefile.in || exit 1 +fgrep 'echo timestamp > stamp-h' d1/Makefile.in || exit 1 +fgrep '../d2/config.h.in' d1/Makefile.in || exit 1 diff --git a/tests/config.test b/tests/config.test new file mode 100755 index 0000000..cbe6ba7 --- /dev/null +++ b/tests/config.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Test to make sure config.h rule made even if it is in a subdir. The +# idea is that if config.h is in a subdir, and there is no Makefile in +# that subdir, then we want to build config.h as the top level. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_CONFIG_HEADER(subdir/config.h) +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +: > Makefile.am +mkdir subdir +: > subdir/config.h.in + +$AUTOMAKE || exit 1 + +grep '^subdir/config.h:' Makefile.in diff --git a/tests/confincl.test b/tests/confincl.test new file mode 100755 index 0000000..a6e0932 --- /dev/null +++ b/tests/confincl.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# This tests for a bug reported by Gord Matzigkeit. +# If config.h is not used, @CONFIG_INCLUDE_SPEC@ should not appear +# in Makefile.in. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'EOF' +bin_PROGRAMS = fred +EOF + +$AUTOMAKE || exit 1 + +if grep '@CONFIG_INCLUDE_SPEC@' Makefile.in; then + exit 1 +fi +exit 0 diff --git a/tests/confsub.test b/tests/confsub.test new file mode 100755 index 0000000..d7ba30f --- /dev/null +++ b/tests/confsub.test @@ -0,0 +1,33 @@ +#! /bin/sh + +# Test to make sure config.h can be in subdir. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_PROG_MAKE_SET +AM_CONFIG_HEADER(subdir/config.h) +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile subdir/Makefile) +END + +cat > Makefile.am << 'END' +SUBDIRS = subdir +END + +mkdir subdir +cat > subdir/Makefile.am << 'END' +bin_PROGRAMS = fred +END + +: > subdir/config.h.in + +$AUTOMAKE || exit 1 + +# Make sure subdir Makefile.in doesn't itself look in the subdir. +(grep 'subdir/config.h' subdir/Makefile.in | grep -v CONFIG_HEADERS) && exit 1 +exit 0 diff --git a/tests/confvar.test b/tests/confvar.test new file mode 100755 index 0000000..fdae95f --- /dev/null +++ b/tests/confvar.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure configure_vars stuff works. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_SUBST(QBERT) +END + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep '^QBERT' Makefile.in diff --git a/tests/confvar2.test b/tests/confvar2.test new file mode 100755 index 0000000..a1f5c61 --- /dev/null +++ b/tests/confvar2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test for bug reported by Jim Meyering. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_SUBST(OTHER_SCRIPTS) +END + +cat > Makefile.am << 'END' +bin_SCRIPTS = foo +END + +$AUTOMAKE diff --git a/tests/cxxcpp.test b/tests/cxxcpp.test new file mode 100755 index 0000000..0a90fc7 --- /dev/null +++ b/tests/cxxcpp.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Make sure automake sees AC_PROG_CXXCPP. From Garth Corral. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXXCPP +END + + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep '^CXXCPP' Makefile.in diff --git a/tests/cxxlibobj.test b/tests/cxxlibobj.test new file mode 100755 index 0000000..13add34 --- /dev/null +++ b/tests/cxxlibobj.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Test to make sure LIBOBJS and C++ sources work right. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +AC_PROG_CC +AC_REPLACE_FUNCS(strdup) +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.C jane.C +anonymous_LDADD = @LIBOBJS@ +END + +: > strdup.c +: > doe.C +: > jane.C + +$AUTOMAKE || exit 1 + +grep CC Makefile.in diff --git a/tests/cxxlink.test b/tests/cxxlink.test new file mode 100755 index 0000000..bcf03bb --- /dev/null +++ b/tests/cxxlink.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test to make sure C++ linker is used when appropriate. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.cxx +END + +: > lava.c +: > lamp.cxx + +$AUTOMAKE || exit 1 + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.CXXLINK' Makefile.in diff --git a/tests/cxxnoc.test b/tests/cxxnoc.test new file mode 100755 index 0000000..558040d --- /dev/null +++ b/tests/cxxnoc.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure pure C++ sources don't include C-specific code. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.C jane.C +END + +: > doe.C +: > jane.C + +$AUTOMAKE || exit 1 + +grep CC Makefile.in | grep -v MKDEP && exit 1 +exit 0 diff --git a/tests/cxxo.test b/tests/cxxo.test new file mode 100755 index 0000000..32beec8 --- /dev/null +++ b/tests/cxxo.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Make sure C++ files are rewritten to ".o" and not just "o". +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.C +END + +: > doe.C + +$AUTOMAKE || exit 1 + +fgrep doe.o Makefile.in diff --git a/tests/cygwin32.test b/tests/cygwin32.test new file mode 100755 index 0000000..99fa66a --- /dev/null +++ b/tests/cygwin32.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test basic Cygwin32 functionality. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AM_EXEEXT +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = www +www_SOURCES = www.c @extra_stuff@ +EXTRA_www_SOURCES = xtra.c +END + +: > www.c +: > xtra.c + +$AUTOMAKE || exit 1 + +grep '^CYGWIN' Makefile.in && exit 1 +grep 'EXEEXT' Makefile.in diff --git a/tests/defs b/tests/defs new file mode 100644 index 0000000..b23a779 --- /dev/null +++ b/tests/defs @@ -0,0 +1,62 @@ +# -*- ksh -*- +# Defines for Automake testing environment. +# Tom Tromey + +# Ensure $srcdir set correctly. +test -f $srcdir/defs || { + echo "defs: installation error" 1>&2 + exit 1 +} + +# If srcdir is relative, we need to modify it. +case "$srcdir" in + /*) + ;; + + *) + srcdir="../$srcdir" + ;; +esac + +rm -rf testSubDir > /dev/null 2>&1 +mkdir testSubDir +cd testSubDir + +# Build appropriate environment in test directory. Eg create +# configure.in, touch all necessary files, etc. +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +: > install-sh +: > mkinstalldirs +: > missing + +# See how redirections should work. User can set VERBOSE to see all +# output. +test -z "$VERBOSE" && { + exec > /dev/null 2>&1 +} + +# User can set PERL to change the perl interpreter used. +test -z "$PERL" && PERL=perl + +# User can set MAKE to choose which make to use. Must use GNU make. +test -z "$MAKE" && MAKE=make + +echo "=== Running test $0" + +# See how Automake should be run. We put --foreign as the default +# strictness to avoid having to create lots and lots of files. A test +# can override this by specifying a different strictness. +AUTOMAKE="$PERL ../../automake --amdir=$srcdir/.. --foreign" + +# See how aclocal should be run. +# Most of the files are in $srcdir/../m4. However amversion.m4 is +# generated in ../m4, so we include that directory in the search +# path too. +ACLOCAL="$PERL `pwd`/../../aclocal -I `pwd`/../../m4 --acdir=$srcdir/../m4" diff --git a/tests/defun.test b/tests/defun.test new file mode 100755 index 0000000..c11e06e --- /dev/null +++ b/tests/defun.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Make sure aclocal picks up on all macro definitions. + +. $srcdir/defs || exit 1 + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_FUNC_TWO],) +AC_DEFUN([AM_FUNC_ONE], +AC_REQUIRE([AM_FUNC_TWO])) +END + +$ACLOCAL diff --git a/tests/defun2.test b/tests/defun2.test new file mode 100755 index 0000000..d6869c5 --- /dev/null +++ b/tests/defun2.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Make sure we don't mistake a macro definition for an invocation. +# From Jim Meyering. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +dnl if buggy this will require getloadavg.c +AC_PROG_CC +AC_DEFUN([AC_FUNC_GETLOADAVG], +dnl need this to avoid LIBOBJS used but not defined. +AC_FUNC_MEMCMP +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_LDADD = @LIBOBJS@ +END + +: > memcmp.c + +$AUTOMAKE diff --git a/tests/dejagnu.test b/tests/dejagnu.test new file mode 100755 index 0000000..140ec07 --- /dev/null +++ b/tests/dejagnu.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure dejagnu tests and automake-style tests can coexist. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = dejagnu +TESTS = frob.test +END + +: > frob.test + +$AUTOMAKE || exit 1 + +grep '^check-TESTS' Makefile.in && grep '^check-DEJAGNU' Makefile.in diff --git a/tests/depacl.test b/tests/depacl.test new file mode 100755 index 0000000..c8b2268 --- /dev/null +++ b/tests/depacl.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Test to make sure dependency tracking works. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_C_PROTOTYPES +END + +$ACLOCAL || exit 1 + +grep '^AC_DEFUN.*AM_PROG_CC_STDC' aclocal.m4 diff --git a/tests/depacl2.test b/tests/depacl2.test new file mode 100755 index 0000000..bb7c660 --- /dev/null +++ b/tests/depacl2.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure dependencies work when require'd macro is part of +# autoconf. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_C_PROTOTYPES +END + +cat > AM_C_PROTOTYPES.m4 << 'END' +AC_REQUIRE([AC_HEADER_STDC]) +END + +# Our --acdir overrides the one in $ACLOCAL. +$ACLOCAL -I . diff --git a/tests/depend.test b/tests/depend.test new file mode 100755 index 0000000..23c2045 --- /dev/null +++ b/tests/depend.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# This tests for a bug reported by Henrik Frystyk Nielsen +# In some cases the auto-dependency can get confused and try +# to `-include' a directory. +# This actually tests for two bugs: +# * A configure substitution in _SOURCES incorrectly ends up in DEP_FILES +# * A backslash-newline in _SOURCES causes just the directory to +# appear in DEP_FILES. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = fred +fred_SOURCES = \ + @BLATT@ +END + +$AUTOMAKE || exit 1 + +# In this case we no longer expect to find DEP_FILES. +grep '^DEP_FILES = *$' Makefile.in && exit 1 +exit 0 diff --git a/tests/depend2.test b/tests/depend2.test new file mode 100755 index 0000000..8978165 --- /dev/null +++ b/tests/depend2.test @@ -0,0 +1,71 @@ +#! /bin/sh + +# Test that automatically generated dependencies are correctly +# rewritten into distribution Makefiles. This test is set up to look +# like a C program was built in a subdir of the distribution. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_PROG_CC +AC_OUTPUT(Makefile src/Makefile) +END + +cat > Makefile.am << 'END' +SUBDIRS = src +END + +mkdir src +cat > src/Makefile.am << 'END' +bin_PROGRAMS = copyin +END + +: > src/copyin.c + +mkdir build +mkdir build/src +mkdir build/src/.deps + +: > build/src/.deps/.P + +cat > build/src/.deps/copyin.P << 'END' +copyin.o: ../../src/copyin.c ../config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \ + /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../i586-unknown-linuxaout/include/_G_config.h \ + /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/sys/stat.h \ + /usr/include/linux/stat.h ../../lib/filetypes.h ../../src/system.h \ + /usr/include/string.h \ + /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/stddef.h \ + /usr/include/time.h /usr/include/stdlib.h /usr/include/errno.h \ + /usr/include/linux/errno.h \ + /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/float.h \ + /usr/include/alloca.h /usr/include/unistd.h /usr/include/posix_opt.h \ + /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/sysmacros.h /usr/include/fcntl.h \ + /usr/include/linux/fcntl.h /usr/include/utime.h \ + /usr/include/linux/utime.h /usr/include/dirent.h \ + /usr/include/linux/limits.h /usr/include/linux/dirent.h \ + /usr/include/posix1_lim.h ../../src/cpiohdr.h ../../src/cpio.h \ + ../../src/extern.h \ + /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../include/libintl.h \ + /usr/include/locale.h ../../lib/ansidecl.h ../../lib/dstring.h \ + ../../lib/error.h ../../src/defer.h ../../src/rmt.h \ + ../../lib/fnmatch.h +END + +mkdir outdir + +$AUTOMAKE --include-deps --build-dir=`pwd`/build --srcdir-name=../.. \ + --output-dir=`pwd`/outdir src/Makefile || exit 1 + +# The buggy output contains this string. +fgrep '../../lib/filetypes.h' outdir/src/Makefile.in && exit 1 + +# Also make sure that filetypes.h is mentioned at all. +fgrep filetypes.h outdir/src/Makefile.in diff --git a/tests/depend3.test b/tests/depend3.test new file mode 100755 index 0000000..7ff4909 --- /dev/null +++ b/tests/depend3.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test _DEPENDENCIES variable. From Lee Iverson. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_CC +AC_SUBST(DEPS) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = TerraVision + +TerraVision_SOURCES = \ + AboutDialog.c Clock.c Dialogs.c DrawModel.c \ + TsmWidget.c Gats.c GATSDialogs.c Model.c ModelAnim.c \ + ScannedMap.c \ + TerraVision.c TerraVisionAvs.c TerraVisionCAVE.c \ + Texture.c ThreeDControl.c ThreeDPanel.c \ + ThreeDWidget.c ThreeDWidget1.c TileManager.c \ + TileRequester.c TwoDWidget.c \ + Visible.c RequestGenerator.c X11FrameGrab.c \ + matrix.c pixmaps.c xpmhash.c xpmread.c xcolor.c xv24to8.c + +DEPS = @DEPS@ + +TerraVision_DEPENDENCIES = $(DEPS) +END + +$AUTOMAKE diff --git a/tests/discover.test b/tests/discover.test new file mode 100755 index 0000000..2daa9e7 --- /dev/null +++ b/tests/discover.test @@ -0,0 +1,27 @@ +#! /bin/sh + +# Test to make sure LIBOBJS file cannot be mentioned explicitly. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_PROG_CC +LIBOBJS="$LIBOBJS fsusage.o" +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = fsusage.c +libtu_a_LIBADD = @LIBOBJS@ +END + +: > fsusage.c + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/distdir.test b/tests/distdir.test new file mode 100755 index 0000000..80db378 --- /dev/null +++ b/tests/distdir.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure subdirs in EXTRA_DIST work. Also tests to make +# sure "./" is ignored. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +EXTRA_DIST = foo/bar ./joe +END + +$AUTOMAKE || exit 1 + +grep 'mkinstalldirs.*\.' Makefile.in && exit 1 +grep 'mkinstalldirs.*foo' Makefile.in diff --git a/tests/dup2.test b/tests/dup2.test new file mode 100755 index 0000000..c012f16 --- /dev/null +++ b/tests/dup2.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Make sure aclocal only warns about definitions overridden by acinclude.m4. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_FUNC_STRTOD +END + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_FUNC_STRTOD]) +END + +$ACLOCAL || exit 1 +exit 0 diff --git a/tests/else.test b/tests/else.test new file mode 100755 index 0000000..a1cd725 --- /dev/null +++ b/tests/else.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure line numbers are correct in some error reports. + +. $srcdir/defs || exit 1 + +echo 'AM_CONDITIONAL(FOO, true)' >> configure.in + +cat > Makefile.am << 'END' +# flag to tell us if apache dir is a source distribution +APACHE_DIR_IS_SRC = @APACHE_DIR_IS_SRC@ + +# we only need to descend into the c dir if we're doing a 1.3 DSO configuration +ifeq ("${APACHE_DIR_IS_SRC}","yes") +SUBDIRS = java +else +SUBDIRS = c java +endif +END + +$AUTOMAKE > out 2>&1 && exit 1 +grep :7: out diff --git a/tests/empty.test b/tests/empty.test new file mode 100755 index 0000000..1e41f44 --- /dev/null +++ b/tests/empty.test @@ -0,0 +1,33 @@ +#! /bin/sh + +# Test for bug where if the list of installables is empty, invalid sh +# code is generated. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +data_DATA = +END + +$AUTOMAKE || exit 1 + +# Create configure so Makefile doesn't look out-of-date. +echo frob > configure.ac +echo frob > configure +echo frob > config.status + +# Need a mkinstalldirs we can actually execute. make on my Linux box +# won't execute this file if is empty, or has just a colon in it (but +# it will run from the shell). +cat > mkinstalldirs << 'END' +#!/bin/sh +END +chmod +x mkinstalldirs + +# Substitute variables we need. +sed -e 's,@SHELL@,/bin/sh,g' -e 's/@srcdir@/./g' \ + -e 's/@top_srcdir@/./g' -e 's/@datadir@/./g' \ + -e 's/@CONFIGURE_AC@/configure.ac/g' \ + < Makefile.in > Makefile + +$MAKE install diff --git a/tests/error.test b/tests/error.test new file mode 100755 index 0000000..a5a9117 --- /dev/null +++ b/tests/error.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure error handling in add_file works. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_C_PROTOTYPES +END + +# Set up a strange environment, where AM_C_PROTOTYPES exists but its +# dependency does not. +cat > AM_C_PROTOTYPES.m4 << 'END' +AC_DEFUN(AM_C_PROTOTYPES, +AC_REQUIRE([AM_PROG_CC_STDC])) +END + +# Our --acdir overrides the one in $ACLOCAL. +$ACLOCAL --acdir=. && exit 1 +exit 0 diff --git a/tests/exdir.test b/tests/exdir.test new file mode 100755 index 0000000..0ef3cbe --- /dev/null +++ b/tests/exdir.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Check to make sure new extended directory mechanism works. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'EOF' +htmldir = $(prefix)/html +html_DATA = zot.html +pkgdata_DATA = qbert +EOF + +$AUTOMAKE || exit 1 + +grep '^DATA' Makefile.in | grep html diff --git a/tests/exdir2.test b/tests/exdir2.test new file mode 100755 index 0000000..7dbdfb6 --- /dev/null +++ b/tests/exdir2.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Test to make sure undefined directories are invalid. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'EOF' +html_DATA = zot.html +pkgdata_DATA = qbert +EOF + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/exsource.test b/tests/exsource.test new file mode 100755 index 0000000..1ebfaef --- /dev/null +++ b/tests/exsource.test @@ -0,0 +1,37 @@ +#! /bin/sh + +# Test to make sure EXTRA_..._SOURCES actually works. +# Bug report from Henrik Frystyk Nielsen. + +. $srcdir/defs || exit 1 + +# This test relies on GNU make. +$MAKE --version > /dev/null 2>&1 || { + # Nope. + exit 0 +} + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = www +www_SOURCES = www.c @extra_stuff@ +EXTRA_www_SOURCES = xtra.c +magic: + @echo $(DEP_FILES) +END + +: > www.c +: > xtra.c + +$AUTOMAKE || exit 1 + +# Make sure the Makefile.in can find the .-files it needs. +mkdir .deps +echo > .deps/.P +echo > .deps/xtra.P +echo > .deps/www.P + +$MAKE -s -f Makefile.in SHELL=/bin/sh srcdir=`pwd` magic | grep xtra diff --git a/tests/extra.test b/tests/extra.test new file mode 100755 index 0000000..f79c99f --- /dev/null +++ b/tests/extra.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Test to make sure EXTRA_ targets are generated. This test used to +# make sure the targets were *not* generated. That is wrong; the +# targets should always be generated. However, they should not be +# built by default. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = @foo@ +EXTRA_PROGRAMS = zardoz +END + +$AUTOMAKE || exit 1 + +grep "^zardoz" Makefile.in || exit 1 + +# Can't have EXTRA clean rules. +grep 'clean.*EXTRA' Makefile.in && exit 1 +exit 0 diff --git a/tests/extra3.test b/tests/extra3.test new file mode 100755 index 0000000..5c9a485 --- /dev/null +++ b/tests/extra3.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Check to make sure EXTRA_DATA not required. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(CODICIL)' >> configure.in + +cat > Makefile.am << 'END' +sysconf_DATA = @CODICIL@ +END + +$AUTOMAKE diff --git a/tests/extra4.test b/tests/extra4.test new file mode 100755 index 0000000..40f57f9 --- /dev/null +++ b/tests/extra4.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Check to make sure EXTRA_DATA cannot be specified. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(CODICIL)' >> configure.in + +cat > Makefile.am << 'END' +sysconf_DATA = @CODICIL@ +EXTRA_DATA = codicil.txt +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/flibs.test b/tests/flibs.test new file mode 100755 index 0000000..a4978f9 --- /dev/null +++ b/tests/flibs.test @@ -0,0 +1,37 @@ +#! /bin/sh + +# Make sure `AC_F77_LIBRARY_LDFLAGS' works properly. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_F77 +AC_F77_LIBRARY_LDFLAGS +END + +# Tue Aug 11 09:50:48 1998 Matthew D. Langston +# +# This test currently fails with automake v. 1.3 since automake assumes +# that elements of `bin_PROGRAMS' (e.g. zardoz) without a corresponding +# `_SOURCES' (e.g. zardoz_SOURCES) should be compiled from `zardoz.c' +# whether or not `zardoz.c' actually exists. For example, even if the +# file `zardoz.c' doesn't exist but the file `zardoz.f' does exist, this +# tests would still fail. +# +# Therefore, for now I have put in the line `zardoz_SOURCES = zardoz.f' +# (see below) so that automake's top-level `make check' won't fail, but +# this line should be removed once automake handles this situation +# correctly. + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.f +zardoz_LDADD = @FLIBS@ +END + +: > zardoz.f + +$AUTOMAKE || exit 1 + +grep '@FLIBS@' Makefile.in diff --git a/tests/fnoc.test b/tests/fnoc.test new file mode 100755 index 0000000..f264d39 --- /dev/null +++ b/tests/fnoc.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test to make sure that pure Fortran 77 sources don't include +# C-specific code. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.f jane.f +END + +: > doe.f +: > jane.f + +$AUTOMAKE || exit 1 + +grep '[^F]CC' Makefile.in | grep -v MKDEP && exit 1 +exit 0 diff --git a/tests/fo.test b/tests/fo.test new file mode 100755 index 0000000..8571b2d --- /dev/null +++ b/tests/fo.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Make sure Fortran 77 files are rewritten to ".o" and not just "o". +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +sbin_PROGRAMS = anonymous +anonymous_SOURCES = doe.f +END + +: > doe.f + +$AUTOMAKE || exit 1 + +fgrep doe.o Makefile.in diff --git a/tests/fonly.test b/tests/fonly.test new file mode 100755 index 0000000..392b676 --- /dev/null +++ b/tests/fonly.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Make sure programs with only Fortran 77 source are handled properly. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_F77 +END + +# Tue Aug 11 09:50:48 1998 Matthew D. Langston +# +# This test currently fails with automake v. 1.3 since automake assumes +# that elements of `bin_PROGRAMS' (e.g. zardoz) without a corresponding +# `_SOURCES' (e.g. zardoz_SOURCES) should be compiled from `zardoz.c' +# whether or not `zardoz.c' actually exists. For example, even if the +# file `zardoz.c' doesn't exist but the file `zardoz.f' does exist, this +# tests would still fail. +# +# Therefore, for now I have put in the line `zardoz_SOURCES = zardoz.f' +# (see below) so that automake's top-level `make check' won't fail, but +# this line should be removed once automake handles this situation +# correctly. + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.f +END + +: > zardoz.f + +$AUTOMAKE || exit 1 + +grep 'zardoz.f' Makefile.in diff --git a/tests/fpinst2.test b/tests/fpinst2.test new file mode 100755 index 0000000..ed814cb --- /dev/null +++ b/tests/fpinst2.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Test to make sure "reversed" order of AC_PROG_INSTALL and +# AC_PROG_INSTALL is not buggy. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +cat > Makefile.am <<'END' +bin_SCRIPTS = zot +END + +$AUTOMAKE || exit 1 diff --git a/tests/fpinstall.test b/tests/fpinstall.test new file mode 100755 index 0000000..d5ed8f4 --- /dev/null +++ b/tests/fpinstall.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Test for bug reported by Thomas Morgan. If both AC_PROG_INSTALL and +# AC_PROG_INSTALL appear in configure.in, bad error results. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +cat > Makefile.am <<'END' +bin_SCRIPTS = zot +END + +$AUTOMAKE || exit 1 diff --git a/tests/gnits.test b/tests/gnits.test new file mode 100755 index 0000000..e4243be --- /dev/null +++ b/tests/gnits.test @@ -0,0 +1,29 @@ +#! /bin/sh + +# Test to ensure --gnits version checking is correct. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=3.5.3.2 +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +pkgdata_DATA = +END + +# Files required by Gnits. +: > INSTALL +: > NEWS +: > README +: > COPYING +: > AUTHORS +: > ChangeLog +: > THANKS + +$AUTOMAKE --gnits && exit 1 +exit 0 diff --git a/tests/implicit.test b/tests/implicit.test new file mode 100755 index 0000000..443a753 --- /dev/null +++ b/tests/implicit.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Test to make sure implicit .o's are listed as appropriate. Report +# from Henrik Frystyk Nielsen. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +noinst_PROGRAMS = libapp_1 +END + +$AUTOMAKE || exit 1 + +grep '^libapp_1_OBJECTS' Makefile.in | grep '\.o' diff --git a/tests/include.test b/tests/include.test new file mode 100755 index 0000000..179ab61 --- /dev/null +++ b/tests/include.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure header vars defined only once when including. +# Report from Marcus G. Daniels. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +include foo +END + +: > foo + +$AUTOMAKE || exit 1 +len="`grep '^srcdir' Makefile.in | wc -l`" +echo "len = $len" +test $len -eq 1 diff --git a/tests/info.test b/tests/info.test new file mode 100755 index 0000000..f5c3cfa --- /dev/null +++ b/tests/info.test @@ -0,0 +1,28 @@ +#! /bin/sh + +# Test to make sure info files are distributed correctly. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = foo.texi + +magic: + @echo $(INFOS) +END + +echo '@setfilename foo.info' > foo.texi +: > texinfo.tex + +$AUTOMAKE || exit 1 + +for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do + echo $i + case "$i" in + foo*) + ;; + *) + exit 1 + ;; + esac +done diff --git a/tests/insh.test b/tests/insh.test new file mode 100755 index 0000000..a0ef405 --- /dev/null +++ b/tests/insh.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test for bug where missing mkinstalldirs give bogus error about +# missing install-sh. + +. $srcdir/defs || exit 1 + +rm mkinstalldirs + +: > Makefile.am + +$AUTOMAKE > out 2>&1 && exit 1 + +grep mkinstalldirs out diff --git a/tests/insh2.test b/tests/insh2.test new file mode 100755 index 0000000..ae4ea2c --- /dev/null +++ b/tests/insh2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test for bug where install-sh not included in distribution. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +pkgdata_DATA = +magic: + @echo $(DISTFILES) +END + +$AUTOMAKE || exit 1 + +$MAKE -s -f Makefile.in SHELL=/bin/sh magic | grep install-sh diff --git a/tests/install.test b/tests/install.test new file mode 100755 index 0000000..031b97c --- /dev/null +++ b/tests/install.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for `; installing' message when not wanted. +# From François Pinard. + +. $srcdir/defs || exit 1 + +: > Makefile.am +: > INSTALL +: > NEWS +: > COPYING + +# It isn't possible to write this test. That's because all files that +# might be required are actually included in the automake +# distribution. +# $AUTOMAKE --gnu --add-missing > output 2>&1 && exit 1 +# grep installing output + +exit 0 diff --git a/tests/installsh.test b/tests/installsh.test new file mode 100755 index 0000000..a9589d1 --- /dev/null +++ b/tests/installsh.test @@ -0,0 +1,38 @@ +#! /bin/sh + +# Test for this bug: +# automake: Makefile.am: required file "../../install-sh" not found; installing +# This also makes sure that install-sh is created in the correct directory. + +. $srcdir/defs || exit 1 + +: > Makefile.am +rm install-sh + +# Since the default path includes '../..', we must run this test in +# yet another subdir. +mkdir frob +mv Makefile.am configure.in mkinstalldirs frob/ +cd frob + +# If srcdir is relative, we need to modify it. +case "$srcdir" in + /*) + ;; + + *) + srcdir="../$srcdir" + ;; +esac + +AUTOMAKE="../../../automake --amdir=$srcdir/.. --foreign" + +# Now we proceed with the test +$AUTOMAKE --add-missing > output 2>&1 \ + || exit 1 + +# Only one `/' should appear in the output. +grep '/.*/' output \ + && exit 1 + +test -f install-sh diff --git a/tests/instdata.test b/tests/instdata.test new file mode 100755 index 0000000..134ca1c --- /dev/null +++ b/tests/instdata.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to see if defining INSTALL_DATA causes problems. From EGCS +# list. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(INSTALL_DATA)' >> configure.in + +: > Makefile.am + +$AUTOMAKE || exit 1 + +(grep '^DATA =' Makefile.in | grep INSTALL_DATA) && exit 1 +exit 0 diff --git a/tests/instexec.test b/tests/instexec.test new file mode 100755 index 0000000..98480a0 --- /dev/null +++ b/tests/instexec.test @@ -0,0 +1,12 @@ +#!/bin/sh + +# Test for this bug: when a Makefile.am builds nothing, no +# install-exec target is generated. + +. $srcdir/defs || exit 1 + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep '^install-exec:' Makefile.in diff --git a/tests/insthook.test b/tests/insthook.test new file mode 100755 index 0000000..e8d9b2a --- /dev/null +++ b/tests/insthook.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure install-exec-hook works. +# Report from Tim Goodwin. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +install-exec-hook: + @echo nothing +END + +$AUTOMAKE || exit 1 + +test "`grep install-exec-hook Makefile.in | wc -l`" -gt 1 || exit 1 +grep -A2 '^install-exec-am:' Makefile.in | grep install-exec-hook diff --git a/tests/instman.test b/tests/instman.test new file mode 100755 index 0000000..60d231b --- /dev/null +++ b/tests/instman.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure mkinstalldirs invocation correct in install-man +# target. Bug reported by Gordon Irlam . + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'EOF' +man_MANS = frob.8 +EOF + +: > frob.8 + +$AUTOMAKE || exit 1 + +grep '[^(/]mkinstalldirs' Makefile.in > out || exit 1 +test `wc -l < out` -eq 1 diff --git a/tests/interp.test b/tests/interp.test new file mode 100755 index 0000000..08c847a --- /dev/null +++ b/tests/interp.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure variable interpolation works. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = qqq +s1 = z.c +qqq_SOURCES = $(s1) +END + +$AUTOMAKE || exit 1 + +grep 'z\.o' Makefile.in diff --git a/tests/interp2.test b/tests/interp2.test new file mode 100755 index 0000000..4404a9d --- /dev/null +++ b/tests/interp2.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure variable interpolation doesn't break other +# features. Report from Joel N. Weber, II. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PATH_X +AC_PATH_XTRA +END + +cat > Makefile.am << 'END' +noinst_PROGRAMS = x +x_SOURCES = x.c +x_LDADD = $(X_EXTRA_LIBS) +END + +$AUTOMAKE diff --git a/tests/java.test b/tests/java.test new file mode 100755 index 0000000..47a2992 --- /dev/null +++ b/tests/java.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Minimal test of Java functionality. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +javadir = $(datadir)/java +java_JAVA = a.java b.java c.java +END + +$AUTOMAKE || exit 1 +grep '^all[-a-z]*:.*classjava\.stamp' Makefile.in diff --git a/tests/javaprim.test b/tests/javaprim.test new file mode 100755 index 0000000..640ce79 --- /dev/null +++ b/tests/javaprim.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test to make sure JAVA variable can be defined. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(JAVA)' >> configure.in + +cat > Makefile.am << 'END' +javadir = $(datadir)/java +java_JAVA = a.java b.java c.java +END + +$AUTOMAKE diff --git a/tests/javasubst.test b/tests/javasubst.test new file mode 100755 index 0000000..1743115 --- /dev/null +++ b/tests/javasubst.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure redefining JAVAC works. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(JAVAC)' >> configure.in + +cat > Makefile.am << 'END' +javadir = $(datadir)/java +java_JAVA = a.java b.java c.java +END + +$AUTOMAKE || exit 1 + +grep 'JAVAC.*@JAVAC@' Makefile.in diff --git a/tests/ldadd.test b/tests/ldadd.test new file mode 100755 index 0000000..80aba9a --- /dev/null +++ b/tests/ldadd.test @@ -0,0 +1,33 @@ +#! /bin/sh + +# Check to make sure incorrect LDADD usage is diagnosed. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AM_PROG_LIBTOOL +AC_OUTPUT(Makefile) +LTLIBOBJS="$LTLIBOBJS q.o" +LIBOBJS="$LIBOBJS q.o" +AC_SUBST(LTLIBOBJS) +END + +cat > Makefile.am << 'END' +lib_LTLIBRARIES = libtu.la +libtu_la_SOURCES = foo.c +libtu_la_LDADD = @LTLIBOBJS@ +END + +: > ltconfig +: > ltmain.sh +: > config.guess +: > config.sub +: > q.c + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/lex.test b/tests/lex.test new file mode 100755 index 0000000..e9b565e --- /dev/null +++ b/tests/lex.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure that lex source generates correct target. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AM_PROG_LEX +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zot +zot_SOURCES = joe.l +LDADD = @LEXLIB@ +END + +: > joe.l + +$AUTOMAKE || exit 1 + +grep '\$(LEX)' Makefile.in diff --git a/tests/lex2.test b/tests/lex2.test new file mode 100755 index 0000000..021d1bf --- /dev/null +++ b/tests/lex2.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure AC_PROG_LEX is an error. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_LEX +AC_DECL_YYTEXT +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zot +zot_SOURCES = joe.l +LDADD = @LEXLIB@ +END + +: > joe.l + +$AUTOMAKE 2> output || exit 1 +test -n "`cat output`" diff --git a/tests/libobj.test b/tests/libobj.test new file mode 100755 index 0000000..7918f86 --- /dev/null +++ b/tests/libobj.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# Test for bug reported by Jim Meyering: +# automake-0.29 didn't handle this line properly. +# LIBOBJS="$LIBOBJS fsusage.o mountlist.o" + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +LIBOBJS="$LIBOBJS fsusage.o mountlist.o" +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +: > fsusage.c +: > mountlist.c + +$AUTOMAKE diff --git a/tests/libobj2.test b/tests/libobj2.test new file mode 100755 index 0000000..fa9b889 --- /dev/null +++ b/tests/libobj2.test @@ -0,0 +1,31 @@ +#! /bin/sh + +# Test to make sure LIBOBJS works in subdirs. +# Bug from Josh MacDonald. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +LIBOBJS="$LIBOBJS fsusage.o" +AC_OUTPUT(subdir/Makefile) +END + +mkdir subdir + +cat > subdir/Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +: > subdir/fsusage.c + +$AUTOMAKE || exit 1 + +grep 'fsusage\.c' subdir/Makefile.in diff --git a/tests/libobj3.test b/tests/libobj3.test new file mode 100755 index 0000000..3c7ca65 --- /dev/null +++ b/tests/libobj3.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Test to make sure LIBOBJS actually set in configure.in if seen. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_RANLIB +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/libobj4.test b/tests/libobj4.test new file mode 100755 index 0000000..226e509 --- /dev/null +++ b/tests/libobj4.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to make sure LIBOBJS error only occurs if LIBOBJS seen. Report +# from Jim Meyering. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +END + +cat >> configure.in << 'END' +AC_PROG_CC +AC_REPLACE_FUNCS(foo) +END + +$AUTOMAKE diff --git a/tests/libobj5.test b/tests/libobj5.test new file mode 100755 index 0000000..8ad45e9 --- /dev/null +++ b/tests/libobj5.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure AC_REPLACE_FUNCS works across lines. Report from +# Jim Meyering. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = joe +LDADD = @LIBOBJS@ +END + +cat >> configure.in << 'END' +AC_PROG_CC +AC_REPLACE_FUNCS(\ + foo) +END + +: > foo.c + +$AUTOMAKE || exit 1 +fgrep foo.c Makefile.in diff --git a/tests/libobj6.test b/tests/libobj6.test new file mode 100755 index 0000000..9094cf5 --- /dev/null +++ b/tests/libobj6.test @@ -0,0 +1,28 @@ +#! /bin/sh + +# Test for a bug reported by Akim Demaille. +# LIBOBJS specified in the "wrong order" aren't seen. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +LIBOBJS="fsusage.o mountlist.o $LIBOBJS" +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +: > fsusage.c +: > mountlist.c + +$AUTOMAKE diff --git a/tests/libobj7.test b/tests/libobj7.test new file mode 100755 index 0000000..ed0d101 --- /dev/null +++ b/tests/libobj7.test @@ -0,0 +1,37 @@ +#! /bin/sh + +# Test for multiple replacement functions. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_REPLACE_FUNCS(basename dirname strsignal) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +: > basename.c +: > dirname.c +: > strsignal.c + +$AUTOMAKE || exit 1 + +sed -n -e ': again + /^DIST_COMMON.*[^\]$/ p + /^DIST_COMMON/ { + s/^DIST_COMMON//p + n + s/^/DIST_COMMON/ + b again + }' < Makefile.in | fgrep dirname.c diff --git a/tests/libobj8.test b/tests/libobj8.test new file mode 100755 index 0000000..a4b4090 --- /dev/null +++ b/tests/libobj8.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test to make sure `_.c' dependencies are generated for LIBOBJS +# objects. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_REPLACE_FUNCS(basename dirname strsignal) +AM_C_PROTOTYPES +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = ansi2knr +noinst_LIBRARIES = libtu.a +libtu_a_SOURCES = +libtu_a_LIBADD = @LIBOBJS@ +END + +: > basename.c +: > dirname.c +: > strsignal.c + +: > ansi2knr.1 +: > ansi2knr.c + +$AUTOMAKE || exit 1 + +grep 'strsignal_.c:' Makefile.in diff --git a/tests/library.test b/tests/library.test new file mode 100755 index 0000000..baf6109 --- /dev/null +++ b/tests/library.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test for _DEPENDENCIES with libraries. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_RANLIB +AM_MAINTAINER_MODE +AC_EXEEXT +AC_PROG_CC +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = dejagnu cygnus +lib_LIBRARIES = libfoo.a +libfoo_a_DEPENDENCIES = libzot.a +END + +$AUTOMAKE diff --git a/tests/link_c_cxx.test b/tests/link_c_cxx.test new file mode 100755 index 0000000..8ff69a4 --- /dev/null +++ b/tests/link_c_cxx.test @@ -0,0 +1,34 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.cxx +END + +: > lava.c +: > lamp.cxx + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(FLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_c.test b/tests/link_f_c.test new file mode 100755 index 0000000..8dea51c --- /dev/null +++ b/tests/link_f_c.test @@ -0,0 +1,35 @@ +#! /bin/sh + +# Test to make sure the Fortran 77 linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.f +END + +: > lava.c +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the Fortran 77 linker in the rules of +# `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(F77LINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(LINK)' Makefile.in && exit 1 +grep '.\$(CXXLINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_c_cxx.test b/tests/link_f_c_cxx.test new file mode 100755 index 0000000..8155576 --- /dev/null +++ b/tests/link_f_c_cxx.test @@ -0,0 +1,36 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_CXX +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.c lamp.cxx lamp2.f +END + +: > lava.c +: > lamp.cxx +: > lamp2.f + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(F77LINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_cxx.test b/tests/link_f_cxx.test new file mode 100755 index 0000000..c90b263 --- /dev/null +++ b/tests/link_f_cxx.test @@ -0,0 +1,34 @@ +#! /bin/sh + +# Test to make sure the C++ linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lava.cxx lamp.f +END + +: > lava.cxx +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the C++ linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(CXXLINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(F77LINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/link_f_only.test b/tests/link_f_only.test new file mode 100755 index 0000000..ca57793 --- /dev/null +++ b/tests/link_f_only.test @@ -0,0 +1,32 @@ +#! /bin/sh + +# Test to make sure the Fortran 77 linker is used when appropriate. +# Matthew D. Langston + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_F77 +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = lavalamp +lavalamp_SOURCES = lamp.f +END + +: > lamp.f + +$AUTOMAKE || exit 1 + + +# We should only see the Fortran linker in the rules of `Makefile.in'. + +# Look for this macro not at the beginning of any line; that will have +# to be good enough for now. +grep '.\$(F77LINK)' Makefile.in || exit 1 + +# We should not see these patterns: +grep '.\$(CXXLINK)' Makefile.in && exit 1 +grep '.\$(LINK)' Makefile.in && exit 1 + +exit 0 diff --git a/tests/lisp.test b/tests/lisp.test new file mode 100755 index 0000000..fa7366f --- /dev/null +++ b/tests/lisp.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Test to make sure lisp handling works. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AM_PATH_LISPDIR +END + +cat > Makefile.am << 'END' +lisp_LISP = foo.el +END + +: > foo.el +: > elisp-comp + +$AUTOMAKE || exit 1 + +grep '^ELCFILES.*ELCFILES' Makefile.in && exit 1 +exit 0 diff --git a/tests/mdate.test b/tests/mdate.test new file mode 100755 index 0000000..c0619e8 --- /dev/null +++ b/tests/mdate.test @@ -0,0 +1,19 @@ +#!/bin/sh + +# Test that mdate-sh is required when Texinfo used and version.texi needed. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +cat > textutils.texi << 'END' +@include version.texi +@setfilename textutils.info +END + +# Required when using Texinfo. +: > texinfo.tex + +$AUTOMAKE 2>&1 > /dev/null | grep 'required file.*mdate-sh' diff --git a/tests/mdate2.test b/tests/mdate2.test new file mode 100755 index 0000000..ef19458 --- /dev/null +++ b/tests/mdate2.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Test to make sure mdate-sh is included in distribution. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +cat > textutils.texi << 'END' +@include version.texi +END + +# Required when using Texinfo. +: > texinfo.tex +: > mdate-sh +echo '@setfilename textutils' > textutils.texi + +# Use "././" to confuse Automake into thinking this is a subdir build. +$AUTOMAKE ././Makefile || exit 1 + +grep 'mdate-sh' Makefile.in | grep -v SHELL diff --git a/tests/mdate3.test b/tests/mdate3.test new file mode 100755 index 0000000..26618cb --- /dev/null +++ b/tests/mdate3.test @@ -0,0 +1,32 @@ +#! /bin/sh + +# Test to make sure mdate-sh run correctly. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_CONFIG_AUX_DIR(foo) +END + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +cat > textutils.texi << 'END' +@include version.texi +@setfilename textutils.info +END + +mkdir foo + +# Required when using Texinfo. +: > foo/texinfo.tex +: > foo/mdate-sh +mv install-sh foo +mv missing foo +mv mkinstalldirs foo + +$AUTOMAKE || exit 1 + +grep '[^/]mdate-sh' Makefile.in && exit 1 +exit 0 diff --git a/tests/mkinst2.test b/tests/mkinst2.test new file mode 100755 index 0000000..b30e46d --- /dev/null +++ b/tests/mkinst2.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Test to make sure no-installman suppresses man dir creation. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = no-installman +man_MANS = foo.1 +END + +: > foo.1 + +cat > mkinstalldirs << 'END' +echo "$@" +END + +chmod +x mkinstalldirs + +$AUTOMAKE || exit 1 + +($MAKE -s -f Makefile.in installdirs | grep man) && exit 1 +exit 0 diff --git a/tests/mkinstall.test b/tests/mkinstall.test new file mode 100755 index 0000000..eed6e8f --- /dev/null +++ b/tests/mkinstall.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test for bug where mkinstalldirs variable can be set incorrectly. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +pkgdata_DATA = +END + +# The "././" prefix confuses Automake into thinking it is doing a +# subdir build. Yes, this is hacky. +$AUTOMAKE ././Makefile || exit 1 + +grep ' /mkinstalldirs' Makefile.in && exit 1 +exit 0 diff --git a/tests/noinst.test b/tests/noinst.test new file mode 100755 index 0000000..d5970a8 --- /dev/null +++ b/tests/noinst.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Check to make sure "make install" will build all in directory with +# nothing to install. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +all-local: + exit 1 +END + +$AUTOMAKE || exit 1 + +grep '^install[-a-z]*:.* all' Makefile.in diff --git a/tests/number.test b/tests/number.test new file mode 100755 index 0000000..d4af17e --- /dev/null +++ b/tests/number.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure _OBJECTS only generated once. Bug reported by +# Joerg-Martin Schwarz. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zardoz +END + +$AUTOMAKE || exit 1 + +count=`grep -c '^zardoz_OBJECTS' Makefile.in` +test $count -eq 1 diff --git a/tests/objc.test b/tests/objc.test new file mode 100755 index 0000000..1b8b4db --- /dev/null +++ b/tests/objc.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure LINK defined for Objective C. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(OBJC)' >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = foo.m + +SUFFIXES = .m +.m.o: + whatever +END + +: > foo.m + +$AUTOMAKE || exit 1 + +grep '^LINK' Makefile.in diff --git a/tests/obsolete.test b/tests/obsolete.test new file mode 100755 index 0000000..143999b --- /dev/null +++ b/tests/obsolete.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure obsolete macros really are. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_MAKE_SET +fp_PROG_INSTALL +AC_OUTPUT(Makefile one/Makefile one/two/Makefile) +END + +: > Makefile.am + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/order.test b/tests/order.test new file mode 100755 index 0000000..ed965bd --- /dev/null +++ b/tests/order.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Make sure AC_DEFUN is handled correctly. This test isn't named very +# well. Report from Jim Meyering. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +jm_TEST +END + +cat > acinclude.m4 << 'END' +AC_DEFUN(jm_TEST +) +AC_REQUIRE([jm_TEST]) +END + +$ACLOCAL diff --git a/tests/outdir.test b/tests/outdir.test new file mode 100755 index 0000000..c905568 --- /dev/null +++ b/tests/outdir.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test to ensure that --output-dir works. Bug report from Joshua +# Cowan. + +. $srcdir/defs || exit 1 + +cat > Makefile.am <<'END' +pkgdata_DATA = +END + +mkdir zardir + +$AUTOMAKE --output-dir=zardir || exit 1 + +test -f Makefile.in && exit 1 +test -f zardir/Makefile.in diff --git a/tests/output.test b/tests/output.test new file mode 100755 index 0000000..dfb609c --- /dev/null +++ b/tests/output.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure files listed in AC_OUTPUT are found. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile frob/zardoz) +END + +: > Makefile.am + +mkdir frob +: > frob/zardoz.in + +$AUTOMAKE diff --git a/tests/output2.test b/tests/output2.test new file mode 100755 index 0000000..711de2d --- /dev/null +++ b/tests/output2.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Another AC_OUTPUT test. From report by Ulrich Drepper. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile intl/intlh.inst po/Makefile.in misc/gettextize) +END + +: > Makefile.am + +mkdir intl po misc +: > intl/intlh.inst.in +: > po/Makefile.in.am +: > misc/gettextize.in + +$AUTOMAKE || exit 1 + +grep '^gettextize' Makefile.in && exit 1 +exit 0 diff --git a/tests/output3.test b/tests/output3.test new file mode 100755 index 0000000..311fe03 --- /dev/null +++ b/tests/output3.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Yet another AC_OUTPUT test. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT([Makefile +tests/Makefile tests/defs], +[blah]) +END + +: > Makefile.am + +mkdir tests +: > tests/Makefile.am +: > tests/defs.in + +$AUTOMAKE diff --git a/tests/output4.test b/tests/output4.test new file mode 100755 index 0000000..91e960f --- /dev/null +++ b/tests/output4.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# It's hard to believe there are so many AC_OUTPUT-related bugs. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(tests/Makefile tests/defs) +END + +mkdir tests +: > tests/defs.in +: > tests/Makefile.am + +$AUTOMAKE || exit 1 + +grep tests/defs.in tests/Makefile.in && exit 1 +exit 0 diff --git a/tests/output5.test b/tests/output5.test new file mode 100755 index 0000000..8bfd99f --- /dev/null +++ b/tests/output5.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for AC_OUTPUT(). From Mark Galassi. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT() +END + +: > Makefile.am + +$AUTOMAKE > output 2>&1 && exit 1 +grep 'found or specified' output && exit 1 +exit 0 diff --git a/tests/package.test b/tests/package.test new file mode 100755 index 0000000..f920d7e --- /dev/null +++ b/tests/package.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Test to ensure PACKAGE required. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +pkgdata_DATA = +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/parse.test b/tests/parse.test new file mode 100755 index 0000000..fb7cec5 --- /dev/null +++ b/tests/parse.test @@ -0,0 +1,27 @@ +#! /bin/sh + +# Test to make sure backslash-newline is treated as whitespace. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_PROG_CC +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zot +zot_SOURCES = \ +zar.c\ +doz.c +END + +$AUTOMAKE || exit 1 + +fgrep zar.cdoz Makefile.in && exit 1 +exit 0 diff --git a/tests/pluseq.test b/tests/pluseq.test new file mode 100755 index 0000000..165f4e2 --- /dev/null +++ b/tests/pluseq.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test `+=' functionality. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +data_DATA = zar +data_DATA += doz +END + +: > zar +: > doz + +$AUTOMAKE || exit 1 +fgrep 'zar doz' Makefile.in diff --git a/tests/pluseq2.test b/tests/pluseq2.test new file mode 100755 index 0000000..69b8b2d --- /dev/null +++ b/tests/pluseq2.test @@ -0,0 +1,29 @@ +#! /bin/sh + +# Test `+=' with conditionals. + +. $srcdir/defs || exit 1 + +echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in + +cat > Makefile.am << 'END' + +if CHECK +data_DATA = zar +endif + +if CHECK +data_DATA += doz +else +data_DATA += dog +endif + +END + +: > zar +: > doz +: > dog + +$AUTOMAKE || exit 1 +fgrep '= zar doz' Makefile.in || exit 1 +fgrep '= dog' Makefile.in diff --git a/tests/pluseq3.test b/tests/pluseq3.test new file mode 100755 index 0000000..f6d935e --- /dev/null +++ b/tests/pluseq3.test @@ -0,0 +1,30 @@ +#! /bin/sh + +# Another `+=' test with conditionals. + +. $srcdir/defs || exit 1 + +echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in + +cat > Makefile.am << 'END' + +if CHECK +data_DATA = zar +endif + +if CHECK +data_DATA += \ + doz +else +data_DATA += dog +endif + +END + +: > zar +: > doz +: > dog + +$AUTOMAKE || exit 1 +grep '= zar *doz' Makefile.in || exit 1 +fgrep '= dog' Makefile.in diff --git a/tests/pluseq4.test b/tests/pluseq4.test new file mode 100755 index 0000000..9d67013 --- /dev/null +++ b/tests/pluseq4.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Yet another `+=' test. + +. $srcdir/defs || exit 1 + +echo AC_PROG_CC >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +CC += -Dwhatever +END + +: > foo.c + +$AUTOMAKE || exit 1 +fgrep '@CC@ -Dwhatever' Makefile.in diff --git a/tests/pluseq5.test b/tests/pluseq5.test new file mode 100755 index 0000000..b5700b5 --- /dev/null +++ b/tests/pluseq5.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test for another `+=' problem. Report from Brian Jones. + +. $srcdir/defs || exit 1 + +echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in + +cat > Makefile.am << 'END' +if CHECK +INCLUDES = abc +endif +INCLUDES += def +END + +$AUTOMAKE || exit 0 +exit 1 diff --git a/tests/prefix.test b/tests/prefix.test new file mode 100755 index 0000000..f14208c --- /dev/null +++ b/tests/prefix.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure range of prefixes can be extended + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'EOF' +bnidir = $(prefix)/bni +bni_PROGRAMS = zardoz +EOF + +$AUTOMAKE diff --git a/tests/primary.test b/tests/primary.test new file mode 100755 index 0000000..3a561b7 --- /dev/null +++ b/tests/primary.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure errors in am_install_var work. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = @programs@ +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/primary2.test b/tests/primary2.test new file mode 100755 index 0000000..89f0bc6 --- /dev/null +++ b/tests/primary2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure errors in am_install_var work. + +. $srcdir/defs || exit 1 + +echo AC_PROG_CC >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = @programs@ +EXTRA_PROGRAMS = joe @more@ +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/proginst.test b/tests/proginst.test new file mode 100755 index 0000000..1a3d106 --- /dev/null +++ b/tests/proginst.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test for bug where when multiple scripts are installed, +# the check for AC_PROG_INSTALL fails. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_SCRIPTS = zardoz qbert brownie +END + +$AUTOMAKE diff --git a/tests/ranlib.test b/tests/ranlib.test new file mode 100755 index 0000000..d977a39 --- /dev/null +++ b/tests/ranlib.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure AC_PROG_RANLIB can be overridden. Idea from Tatu +# Ylonen. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_CHECK_TOOL(RANLIB, ranlib, :) +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = libjoe.a +END + +: > config.guess +: > config.sub + +$AUTOMAKE diff --git a/tests/recurs.test b/tests/recurs.test new file mode 100755 index 0000000..9816df1 --- /dev/null +++ b/tests/recurs.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Test to make sure recursive variable definitions die. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_PROG_CC +AM_CONDITIONAL(ONE, true) +AM_CONDITIONAL(TWO, false) +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = $(foo) +foo = $(bin_PROGRAMS) +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/recurs2.test b/tests/recurs2.test new file mode 100755 index 0000000..6611b83 --- /dev/null +++ b/tests/recurs2.test @@ -0,0 +1,23 @@ +#! /bin/sh + +# Test to make sure recursive variable definitions die. +# From Jim Meyering. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_PROG_CC +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +man_MANS = chgrp.1 +man_aux = $(man_MANS:.1=.x) +EXTRA_DIST = $(man_aux) $(man_MANS) +END + +> chgrp.1 +> chgrp.x + +$AUTOMAKE \ No newline at end of file diff --git a/tests/remake.test b/tests/remake.test new file mode 100755 index 0000000..cf28765 --- /dev/null +++ b/tests/remake.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Make sure remaking rules in subdir are correctly generated. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(sub/Makefile) +END + +mkdir sub +: > sub/Makefile.am + +$AUTOMAKE || exit 1 + +grep '^Makefile' sub/Makefile.in diff --git a/tests/remake2.test b/tests/remake2.test new file mode 100755 index 0000000..b8b8044 --- /dev/null +++ b/tests/remake2.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Make sure remaking rules in subdir are correct. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(sub/Makefile) +END + +mkdir sub +: > sub/Makefile.am + +$AUTOMAKE || exit 1 + +grep 'AUTOMAKE.*sub/Makefile' sub/Makefile.in diff --git a/tests/req.test b/tests/req.test new file mode 100755 index 0000000..f2372f1 --- /dev/null +++ b/tests/req.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure macro used in m4 file is included. + +. $srcdir/defs || exit 1 + +echo AM_INIT_GUILE_MODULE > configure.in + +cat > acinclude.m4 << 'END' +AC_DEFUN([AM_INIT_GUILE_MODULE],[ +. $srcdir/../GUILE-VERSION +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AC_CONFIG_AUX_DIR(..) +module=[$1] +AC_SUBST(module)]) +END + +$ACLOCAL || exit 1 + +grep 'DEFUN.*INIT_AUTOMAKE' aclocal.m4 diff --git a/tests/rulepat.test b/tests/rulepat.test new file mode 100755 index 0000000..1a1544c --- /dev/null +++ b/tests/rulepat.test @@ -0,0 +1,13 @@ +#! /bin/sh + +# Test to make sure RULE_PATTERN catches strange targets. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +$(srcdir)/Makefile.am: +END + +$AUTOMAKE || exit 1 + +grep '^$(srcdir)/Makefile\.am' Makefile.in diff --git a/tests/scripts.test b/tests/scripts.test new file mode 100755 index 0000000..6f7c15a --- /dev/null +++ b/tests/scripts.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test for bug reported by Jim Meyering. +# AC_PROG_INSTALL was required when only noinst_SCRIPTS was defined. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile) +END + +cat > Makefile.am << 'END' +noinst_SCRIPTS = foo +END + +$AUTOMAKE diff --git a/tests/seenc.test b/tests/seenc.test new file mode 100755 index 0000000..87bfc54 --- /dev/null +++ b/tests/seenc.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# Test to make sure C-but-not-CC error works. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +LIBOBJS="$LIBOBJS fsusage.o mountlist.o" +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = x.C +foo_LDADD = @LIBOBJS@ +END + +: > fsusage.c +: > mountlist.c + +$AUTOMAKE > out 2>&1 && exit 1 +exit 0 diff --git a/tests/sinclude.test b/tests/sinclude.test new file mode 100755 index 0000000..4ef1688 --- /dev/null +++ b/tests/sinclude.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to see if `sinclude' works. + +. $srcdir/defs || exit 1 + +cat > aclocal.m4 << 'END' +sinclude(sub/p.m4) +END + +mkdir sub +cat > sub/p.m4 << 'END' +AC_SUBST(MAGICALPIG) +END + +: > Makefile.am + +$AUTOMAKE || exit 1 + +grep MAGICALPIG Makefile.in diff --git a/tests/spell.test b/tests/spell.test new file mode 100755 index 0000000..493612c --- /dev/null +++ b/tests/spell.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test to make sure misspellings in _SOURCES variables cause failure. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = zardoz foo +zardoz_SOURCES = x.c +boo_SOURCES = y.c +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/spell2.test b/tests/spell2.test new file mode 100755 index 0000000..f5e4e79 --- /dev/null +++ b/tests/spell2.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure misspellings in _SOURCES variables cause failure. + +. $srcdir/defs || exit 1 + +echo AC_PROG_CC >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = x.c +qardoz_LDADD = -ljoe +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/spell3.test b/tests/spell3.test new file mode 100755 index 0000000..0f3571e --- /dev/null +++ b/tests/spell3.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test to make sure some internal _DEPENDENCIES variables don't cause +# errors. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +TAGS_DEPENDENCIES = joe +## Required to avoid error. +ETAGS_ARGS = joe +END + +$AUTOMAKE diff --git a/tests/spelling.test b/tests/spelling.test new file mode 100755 index 0000000..b0cf203 --- /dev/null +++ b/tests/spelling.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test to make sure that misspelled prefixes actually cause error. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'EOF' +bni_PROGRAMS = zot +EOF + +if $AUTOMAKE; then + exit 1 +fi +exit 0 diff --git a/tests/stamph.test b/tests/stamph.test new file mode 100755 index 0000000..bf3b3f7 --- /dev/null +++ b/tests/stamph.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Error if stamp-h appears in AC_OUTPUT line. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_INSTALL +AC_OUTPUT(Makefile stamp-h) +END + +: > Makefile.am + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/stdlib.test b/tests/stdlib.test new file mode 100755 index 0000000..5e8031a --- /dev/null +++ b/tests/stdlib.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test "not a standard library" error. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_RANLIB +END + +cat > Makefile.am << 'END' +noinst_LIBRARIES = foo +END + +$AUTOMAKE 2> output.log && exit 1 +# We're specifically testing for line-number information. +# Well, when it is implemented. +# grep 1 output.log +exit 0 diff --git a/tests/subdir.test b/tests/subdir.test new file mode 100755 index 0000000..a3fa485 --- /dev/null +++ b/tests/subdir.test @@ -0,0 +1,27 @@ +#! /bin/sh + +# Test to make sure install-sh and mkinstalldirs correctly found in +# subdirs. + +. $srcdir/defs || exit 1 + +mkdir zot + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_OUTPUT(Makefile zot/Makefile) +END + +cat > Makefile.am << 'END' +SUBDIRS = zot +END + +cat > zot/Makefile.am << 'END' +pkgdata_DATA = +END + +$AUTOMAKE diff --git a/tests/subdir2.test b/tests/subdir2.test new file mode 100755 index 0000000..485cae7 --- /dev/null +++ b/tests/subdir2.test @@ -0,0 +1,39 @@ +#! /bin/sh + +# Test to make sure sub-sub-dirs work correctly. + +. $srcdir/defs || exit 1 + +mkdir one +mkdir one/two + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_OUTPUT(Makefile one/Makefile one/two/Makefile) +END + +# Files required because we are using `--gnu'. +: > INSTALL +: > NEWS +: > README +: > COPYING +: > AUTHORS +: > ChangeLog + +cat > Makefile.am << 'END' +SUBDIRS = one +END + +cat > one/Makefile.am << 'END' +SUBDIRS = two +END + +cat > one/two/Makefile.am << 'END' +pkgdata_DATA = +END + +$AUTOMAKE --gnu diff --git a/tests/subst.test b/tests/subst.test new file mode 100755 index 0000000..42098ec --- /dev/null +++ b/tests/subst.test @@ -0,0 +1,17 @@ +#! /bin/sh + +# Test that AC_SUBST($1) does something sensible. From Ulrich +# Drepper. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_SUBST($1) +AC_SUBST([$]$1) dnl this is the actual invocation that was used +END + +: > Makefile.am + +$AUTOMAKE || exit 1 +grep '^\$1' Makefile.in && exit 1 +exit 0 diff --git a/tests/symlink.test b/tests/symlink.test new file mode 100755 index 0000000..f2f2949 --- /dev/null +++ b/tests/symlink.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Make sure we get an error if symlink creation fails. +# Reported by Joerg-Martin Schwarz + +. $srcdir/defs || exit 1 + +rm install-sh +rm mkinstalldirs + +: > Makefile.am + +cat >> configure.in << 'END' +AC_CONFIG_AUX_DIR(aux) +END + +$AUTOMAKE --add-missing && exit 1 +exit 0 diff --git a/tests/syntax.test b/tests/syntax.test new file mode 100755 index 0000000..8ca0392 --- /dev/null +++ b/tests/syntax.test @@ -0,0 +1,14 @@ +#! /bin/sh + +# Test for error for bad syntax. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +foo = q \ + +lib_LTLIBRARIES = foo.la +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/tags.test b/tests/tags.test new file mode 100755 index 0000000..ca6a29f --- /dev/null +++ b/tests/tags.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test for bug reported by Harlan Stenn: the tags target doesn't work +# when there are only headers in a directory. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +noinst_HEADERS = iguana.h +END + +: > iguana.h + +$AUTOMAKE || exit 1 + +grep '^ID:' Makefile.in diff --git a/tests/tagsub.test b/tests/tagsub.test new file mode 100755 index 0000000..54be5a8 --- /dev/null +++ b/tests/tagsub.test @@ -0,0 +1,31 @@ +#! /bin/sh + +# Test to make sure tags and subdirs work correctly. Bug report by +# François Pinard. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +SUBDIRS = sub +END + +mkdir sub + +cat > sub/Makefile.am << 'END' +noinst_HEADERS = iguana.h +END + +: > sub/iguana.h + +cat > configure.in << 'END' +PACKAGE=nonesuch +VERSION=nonesuch +AC_ARG_PROGRAM +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_OUTPUT(Makefile sub/Makefile) +END + +$AUTOMAKE || exit 1 + +grep '^TAGS:.*tags-recursive' Makefile.in diff --git a/tests/target.test b/tests/target.test new file mode 100755 index 0000000..532c2e6 --- /dev/null +++ b/tests/target.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for a bug where target names and variable names are treated alike. +# Bug from François Pinard. + +. $srcdir/defs || exit 1 + +echo AC_PROG_CC >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = consud +## Note next line is target, not variable. +consud_SOURCES: consud.c +END + +echo > consud.c + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/texinfo.test b/tests/texinfo.test new file mode 100755 index 0000000..1421867 --- /dev/null +++ b/tests/texinfo.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to ensure texinfo.tex included in distribution. Bug report by +# Jim Meyering. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +magic: + @echo $(DISTFILES) +END + +echo '@setfilename textutils.info' > textutils.texi +: > texinfo.tex + +$AUTOMAKE || exit 1 + +$MAKE -s -f Makefile.in SHELL=/bin/sh magic | grep 'texinfo\.tex' diff --git a/tests/texinfo2.test b/tests/texinfo2.test new file mode 100755 index 0000000..a7d9a3c --- /dev/null +++ b/tests/texinfo2.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to ensure that a ".info~" file doesn't end up in the +# distribution. Bug report from Greg McGary. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +magic: + @echo $(DISTFILES) +END + +: > texinfo.tex +echo '@setfilename textutils.info' > textutils.texi +: > textutils.info~ + +$AUTOMAKE || exit 1 + +test -z "`$MAKE -s -f Makefile.in magic | grep '~'`" diff --git a/tests/texinfo3.test b/tests/texinfo3.test new file mode 100755 index 0000000..e5ae269 --- /dev/null +++ b/tests/texinfo3.test @@ -0,0 +1,16 @@ +#! /bin/sh + +# Test to make sure .info-less @setfilename works. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +echo '@setfilename textutils' > textutils.texi +: > texinfo.tex + +$AUTOMAKE || exit 1 + +grep '^INFO_DEPS.*textutils$' Makefile.in diff --git a/tests/texinfo4.test b/tests/texinfo4.test new file mode 100755 index 0000000..17b76e5 --- /dev/null +++ b/tests/texinfo4.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Make sure non-empty, non-info suffixes are diagnosed. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +echo '@setfilename textutils.frob' > textutils.texi +: > texinfo.tex + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/texinfo5.test b/tests/texinfo5.test new file mode 100755 index 0000000..0548709 --- /dev/null +++ b/tests/texinfo5.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Test to make sure that texinfo.tex is not required by --cygnus. +# Report from Ian Taylor. +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AM_MAINTAINER_MODE +AC_EXEEXT +END + +cat > Makefile.am << 'END' +info_TEXINFOS = ian.texi +END + +echo '@setfilename ian.info' > ian.texi + +$AUTOMAKE --cygnus diff --git a/tests/texinfo6.test b/tests/texinfo6.test new file mode 100755 index 0000000..dd984f8 --- /dev/null +++ b/tests/texinfo6.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure `.txi' extension works. +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = foo.txi +END + +echo '@setfilename foo.info' > foo.txi +: > texinfo.tex + +$AUTOMAKE || exit 1 + +fgrep '.txi.info' Makefile.in diff --git a/tests/texinfo7.test b/tests/texinfo7.test new file mode 100755 index 0000000..b981213 --- /dev/null +++ b/tests/texinfo7.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Test to make sure texinfo.tex correctly installed by -a. Bug report +# by Per Cederqvist. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +magic: + @echo $(DISTFILES) +END + +echo '@setfilename textutils.info' > textutils.texi + +$AUTOMAKE -a || exit 1 + +test -f texinfo.tex diff --git a/tests/unused.test b/tests/unused.test new file mode 100755 index 0000000..18f02da --- /dev/null +++ b/tests/unused.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test for failing check for unused macros. From Johan Danielsson. +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +MACRO_1 +MACRO_1_2 +MACRO_1_2_3 +END + +cat > acinclude.m4 << 'END' +AC_DEFUN(MACRO_1, echo 1) +AC_DEFUN(MACRO_1_2, echo 12) +AC_DEFUN(MACRO_1_2_3, echo 123) +END + +$ACLOCAL 2> output || exit 1 +test -z "`cat output`" diff --git a/tests/version.test b/tests/version.test new file mode 100755 index 0000000..6554602 --- /dev/null +++ b/tests/version.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test to make sure [...] is ok in version number. Report from Jim +# Meyering. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE([sh-utils], [1.12o]) +AC_OUTPUT(Makefile) +END + +: > Makefile.am + +# Files required by Gnits. +: > INSTALL +: > NEWS +: > README +: > COPYING +: > AUTHORS +: > ChangeLog +: > THANKS + +$AUTOMAKE --gnits diff --git a/tests/version2.test b/tests/version2.test new file mode 100755 index 0000000..f709497 --- /dev/null +++ b/tests/version2.test @@ -0,0 +1,24 @@ +#! /bin/sh + +# Test to make sure 3rd arg to AM_INIT_AUTOMAKE not picked up in +# version. From Joel Weber. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AM_INIT_AUTOMAKE([sh-utils], 1.12o, no) +AC_OUTPUT(Makefile) +END + +: > Makefile.am + +# Files required by Gnits. +: > INSTALL +: > NEWS +: > README +: > COPYING +: > AUTHORS +: > ChangeLog +: > THANKS + +$AUTOMAKE --gnits diff --git a/tests/version3.test b/tests/version3.test new file mode 100755 index 0000000..00fdcfb --- /dev/null +++ b/tests/version3.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure version in AUTOMAKE_OPTIONS works. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = 9.9x +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/version4.test b/tests/version4.test new file mode 100755 index 0000000..9744b59 --- /dev/null +++ b/tests/version4.test @@ -0,0 +1,11 @@ +#! /bin/sh + +# Test to make sure we are compatible with the 1.4-p1 series. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = 1.4-p3 +END + +$AUTOMAKE diff --git a/tests/vpath.test b/tests/vpath.test new file mode 100755 index 0000000..03bbc09 --- /dev/null +++ b/tests/vpath.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Test to make sure VPATH can be overridden. +# Report from Anthony Green. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +VPATH = zardoz +END + +$AUTOMAKE || exit 1 + +grep 'VPATH.*@srcdir@' Makefile.in && exit 1 +exit 0 diff --git a/tests/vtexi.test b/tests/vtexi.test new file mode 100755 index 0000000..09524eb --- /dev/null +++ b/tests/vtexi.test @@ -0,0 +1,27 @@ +#!/bin/sh + +# Test for bug reported by Jim Meyering: +# When I ran automake-0.29 on textutils, +# I noticed that doc/Makefile.in had +# textutils.info: textutils.texi +# instead of +# textutils.info: textutils.texi version.texi + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = textutils.texi +END + +cat > textutils.texi << 'END' +@include version.texi +@setfilename textutils.info +END + +# Required when using Texinfo. +: > mdate-sh +: > texinfo.tex + +$AUTOMAKE || exit 1 + +grep '^textutils\.info: textutils\.texi version\.texi$' Makefile.in diff --git a/tests/vtexi2.test b/tests/vtexi2.test new file mode 100755 index 0000000..d950c25 --- /dev/null +++ b/tests/vtexi2.test @@ -0,0 +1,25 @@ +#! /bin/sh + +# Test for bug reported by Glenn Amerine: +# When automake sees version.texi is being included by a texi file, +# version.texi gets listed as a dependency for the .info file but +# not the .dvi file. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +info_TEXINFOS = zardoz.texi +END + +cat > zardoz.texi << 'END' +@setfilename zardoz +@include version.texi +END + +# Required when using Texinfo. +: > mdate-sh +: > texinfo.tex + +$AUTOMAKE || exit 1 + +grep '^zardoz\.dvi:' Makefile.in diff --git a/tests/whoami.test b/tests/whoami.test new file mode 100755 index 0000000..8c8dd13 --- /dev/null +++ b/tests/whoami.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure aclocal doesn't barf on "WHO_AM_I=...". Report +# from Johan Danielsson (and a very nice bug report, too, I might +# add). +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +WHO_AM_I=17 +END + +$ACLOCAL diff --git a/tests/xsource.test b/tests/xsource.test new file mode 100755 index 0000000..07b1953 --- /dev/null +++ b/tests/xsource.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure source in another directory correctly fails. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = z.c x/y.c +END + +cat >> configure.in << 'END' +AC_PROG_CC +END + +mkdir x + +: > z.c +: > x/y.c + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/yacc.test b/tests/yacc.test new file mode 100755 index 0000000..3dd0749 --- /dev/null +++ b/tests/yacc.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Test to make sure intermediate .c file is built from yacc source. +# Bug from Thomas Morgan. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_YACC +END + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.y +END + +$AUTOMAKE || exit 1 + +grep 'zardoz.c' Makefile.in diff --git a/tests/yaccpp.test b/tests/yaccpp.test new file mode 100755 index 0000000..c61c169 --- /dev/null +++ b/tests/yaccpp.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Test to make sure yacc + c++ works. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CXX +AC_PROG_YACC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.yy +END + +$AUTOMAKE || exit 1 + +grep zardoz.cc Makefile.in diff --git a/texi-vers.am b/texi-vers.am new file mode 100644 index 0000000..8caf258 --- /dev/null +++ b/texi-vers.am @@ -0,0 +1,45 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1998, 1999 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. +$(srcdir)/@VTEXI@: @MAINTAINER_MODE_TRUE@stamp-@VTI@ + @: + +## Depend on configure.ac so that version number updates cause a +## rebuild. +$(srcdir)/stamp-@VTI@: @TEXI@ $(top_srcdir)/@CONFIGURE_AC@ + @echo "@set UPDATED `$(SHELL) @MDDIR@mdate-sh $(srcdir)/@TEXI@`" > @VTI@.tmp + @echo "@set EDITION $(VERSION)" >> @VTI@.tmp + @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 $(srcdir)/@VTEXI@ \ + || (echo "Updating $(srcdir)/@VTEXI@"; \ + cp @VTI@.tmp $(srcdir)/@VTEXI@) + -@rm -f @VTI@.tmp + @cp $(srcdir)/@VTEXI@ $@ + +mostlyclean-@VTI@: + -rm -f @VTI@.tmp + +clean-@VTI@: + +distclean-@VTI@: + +maintainer-clean-@VTI@: + -@MAINTAINER_MODE_TRUE@rm -f $(srcdir)/stamp-@VTI@ $(srcdir)/@VTEXI@ + diff --git a/texinfo.tex b/texinfo.tex new file mode 100644 index 0000000..b0a1cfc --- /dev/null +++ b/texinfo.tex @@ -0,0 +1,6341 @@ +% 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{2002-06-04.06} +% +% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, +% 2000, 01, 02 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 2, 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 texinfo.tex file; see the file COPYING. If not, write +% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +% Boston, MA 02111-1307, USA. +% +% In other words, you are welcome to use, share and improve this program. +% You are forbidden to forbid anyone else to use, share and improve +% what you give them. Help stamp out software-hoarding! +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% ftp://ftp.gnu.org/gnu/texinfo.tex +% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% ftp://texinfo.org/texinfo/texinfo.tex +% ftp://tug.org/tex/texinfo.tex +% (and all CTAN mirrors, see http://www.ctan.org), +% and /home/gd/gnu/doc/texinfo.tex on the GNU machines. +% +% The texinfo.tex in any given Texinfo distribution could well be out +% of date, so if that's what you're using, please check. +% +% Texinfo has a small home page at http://texinfo.org/ and also +% http://www.gnu.org/software/texinfo. +% +% 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. You can get +% the existing language-specific files from the full Texinfo distribution. + +\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} + +% Save some parts of plain tex 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\ptexi=\i +\let\ptexlbrace=\{ +\let\ptexrbrace=\} +\let\ptexstar=\* +\let\ptext=\t + +% We never want plain's outer \+ definition in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +\message{Basics,} +\chardef\other=12 + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% 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\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\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi +\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi + +% Ignore a token. +% +\def\gobble#1{} + +\hyphenation{ap-pen-dix} +\hyphenation{mini-buf-fer mini-buf-fers} +\hyphenation{eshell} +\hyphenation{white-space} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen \bindingoffset +\newdimen \normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% 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. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\ifx\eTeXversion\undefined +\def\loggingall{\tracingcommands2 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\else +\def\loggingall{\tracingcommands3 \tracingstats2 + \tracingpages1 \tracingoutput1 \tracinglostchars1 + \tracingmacros2 \tracingparagraphs1 \tracingrestores1 + \tracingscantokens1 \tracingassigns1 \tracingifs1 + \tracinggroups1 \tracingnesting2 + \showboxbreadth\maxdimen\showboxdepth\maxdimen +}% +\fi + +% 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} + +% For @cropmarks command. +% 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 + +% 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). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \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. + % + \escapechar = `\\ % use backslash in output files. + \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. + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfmkdest{\the\pageno} \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 \oddfootingxxx.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 2\baselineskip + \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 \turnoffactive + \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 \unvbox#1 +\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#1{% + \let\next = #1% + \begingroup + \obeylines + \futurelet\temp\parseargx +} + +% If the next token is an obeyed space (from an @example environment or +% the like), remove it and recurse. Otherwise, we're done. +\def\parseargx{% + % \obeyedspace is defined far below, after the definition of \sepspaces. + \ifx\obeyedspace\temp + \expandafter\parseargdiscardspace + \else + \expandafter\parseargline + \fi +} + +% Remove a single space (as the delimiter token to the macro call). +{\obeyspaces % + \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + % + % First remove any @c comment, then any @comment. + % Result of each macro is put in \toks0. + \argremovec #1\c\relax % + \expandafter\argremovecomment \the\toks0 \comment\relax % + % + % Call the caller's macro, saved as \next in \parsearg. + \expandafter\next\expandafter{\the\toks0}% + }% +} + +% Since all \c{,omment} does is throw away the argument, we can let TeX +% do that for us. The \relax here is matched by the \relax in the call +% in \parseargline; it could be more or less anything, its purpose is +% just to delimit the argument to the \c. +\def\argremovec#1\c#2\relax{\toks0 = {#1}} +\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} + +% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% @end itemize @c foo +% will have two active spaces as part of the argument with the +% `itemize'. Here we remove all active spaces from #1, and assign the +% result to \toks0. +% +% This loses if there are any *other* active characters besides spaces +% in the argument -- _ ^ +, for example -- since they get expanded. +% Fortunately, Texinfo does not define any such commands. (If it ever +% does, the catcode of the characters in questionwill have to be changed +% here.) But this means we cannot call \removeactivespaces as part of +% \argremovec{,omment}, since @c uses \parsearg, and thus the argument +% that \parsearg gets might well have any character at all in it. +% +\def\removeactivespaces#1{% + \begingroup + \ignoreactivespaces + \edef\temp{#1}% + \global\toks0 = \expandafter{\temp}% + \endgroup +} + +% Change the active space to expand to nothing. +% +\begingroup + \obeyspaces + \gdef\ignoreactivespaces{\obeyspaces\let =\empty} +\endgroup + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +%% These are used to keep @begin/@end levels from running away +%% Call \inENV within environments (after a \begingroup) +\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} +\def\ENVcheck{% +\ifENV\errmessage{Still within an environment; press RETURN to continue} +\endgroup\fi} % This is not perfect, but it should reduce lossage + +% @begin foo is the same as @foo, for now. +\newhelp\EMsimple{Press RETURN to continue.} + +\outer\def\begin{\parsearg\beginxxx} + +\def\beginxxx #1{% +\expandafter\ifx\csname #1\endcsname\relax +{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else +\csname #1\endcsname\fi} + +% @end foo executes the definition of \Efoo. +% +\def\end{\parsearg\endxxx} +\def\endxxx #1{% + \removeactivespaces{#1}% + \edef\endthing{\the\toks0}% + % + \expandafter\ifx\csname E\endthing\endcsname\relax + \expandafter\ifx\csname \endthing\endcsname\relax + % There's no \foo, i.e., no ``environment'' foo. + \errhelp = \EMsimple + \errmessage{Undefined command `@end \endthing'}% + \else + \unmatchedenderror\endthing + \fi + \else + % Everything's ok; the right environment has been started. + \csname E\endthing\endcsname + \fi +} + +% There is an environment #1, but it hasn't been started. Give an error. +% +\def\unmatchedenderror#1{% + \errhelp = \EMsimple + \errmessage{This `@end #1' doesn't have a matching `@#1'}% +} + +% Define the control sequence \E#1 to give an unmatched @end error. +% +\def\defineunmatchedend#1{% + \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +} + + +% Single-spacing is done by various environments (specifically, in +% \nonfillstart and \quotations). +\newskip\singlespaceskip \singlespaceskip = 12.5pt +\def\singlespace{% + % Why was this kern here? It messes up equalizing space above and below + % environments. --karl, 6may93 + %{\advance \baselineskip by -\singlespaceskip + %\kern \baselineskip}% + \setleading\singlespaceskip +} + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=\mylbrace +\let\}=\myrbrace +\begingroup + % Definitions to produce actual \{ & \} command in an index. + \catcode`\{ = 12 \catcode`\} = 12 + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\@ = 0 \catcode`\\ = 12 + @gdef@lbracecmd[\{]% + @gdef@rbracecmd[\}]% +@endgroup + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown +% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% 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\*{\hfil\break\hbox{}\ignorespaces} + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=3000 } + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=3000 } + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=3000 } + +% @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. +% +\def\group{\begingroup + \ifnum\catcode13=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + % + % The \vtop we start below 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. (See p.82 of + % the TeXbook.) Thus, space below is not quite equal to space + % above. But it's pretty close. + \def\Egroup{% + \egroup % End the \vtop. + \endgroup % End the \group. + }% + % + \vtop\bgroup + % We have to put a strut on the last line in case the @group is in + % the midst of an example, rather than completely enclosing it. + % Otherwise, the interline space between the last line of the group + % and the first line afterwards is too small. But we can't put the + % strut in \Egroup, since there it would be on a line by itself. + % Hence this just inserts a strut at the beginning of each line. + \everypar = {\strut}% + % + % Since we have a strut on every line, we don't need any of TeX's + % normal interline spacing. + \offinterlineskip + % + % OK, but now we have to do something about blank + % lines in the input in @example-like environments, which normally + % just turn into \lisppar, which will insert no space now that we've + % turned off the interline space. Simplest is to make them be an + % empty paragraph. + \ifx\par\lisppar + \edef\par{\leavevmode \par}% + % + % Reset ^^M's definition to new definition of \par. + \obeylines + \fi + % + % 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 +} +% +% 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 + +\def\need{\parsearg\needx} + +% Old definition--didn't work. +%\def\needx #1{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=-1000pt +%}} + +\def\needx#1{% + % 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 + +\let\br = \par + +% @dots{} output an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \leavevmode + \hbox to 2em{% + \hskip 0pt plus 0.25fil minus 0.25fil + .\hss.\hss.\hss.% + \hskip 0pt plus 0.5fil minus 0.5fil + }% + \spacefactor=3000 +} + + +% @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. +\def\exdent{\parsearg\exdentyyy} +\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} + +% This defn is used inside nofill environments such as @example. +\def\nofillexdent{\parsearg\nofillexdentyyy} +\def\nofillexdentyyy #1{{\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'. +% +\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 +} + +% @include file insert text of that file as input. +% Allow normal characters that we make active in the argument (a file name). +\def\include{\begingroup + \catcode`\\=12 + \catcode`~=12 + \catcode`^=12 + \catcode`_=12 + \catcode`|=12 + \catcode`<=12 + \catcode`>=12 + \catcode`+=12 + \parsearg\includezzz} +% Restore active chars for included file. +\def\includezzz#1{\endgroup\begingroup + % Read the included file in a group so nested @include's work. + \def\thisfile{#1}% + \input\thisfile +\endgroup} + +\def\thisfile{} + +% @center line outputs that line, centered + +\def\center{\parsearg\centerzzz} +\def\centerzzz #1{{\advance\hsize by -\leftskip +\advance\hsize by -\rightskip +\centerline{#1}}} + +% @sp n outputs n lines of vertical space + +\def\sp{\parsearg\spxxx} +\def\spxxx #1{\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. +% We cannot implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\def\paragraphindent{\parsearg\doparagraphindent} +\def\doparagraphindent#1{% + \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. +\def\exampleindent{\parsearg\doexampleindent} +\def\doexampleindent#1{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% We don't use $'s directly in the definition of \math because we need +% to set catcodes according to plain TeX first, to allow for subscripts, +% superscripts, special math chars, etc. +% +% @math does not do math typesetting in section titles, index +% entries, and other such contexts where the catcodes are set before +% @math gets a chance to work. This could perhaps be fixed, but for now +% at least we can have real math in the main text, where it's needed most. +% +\let\implicitmath = $%$ font-lock fix +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ within @math be active (mathcode "8000), and distinguish by seeing +% if the current family is \slfam, which is what @var uses. +% +{\catcode95 = \active % 95 = _ +\gdef\mathunderscore{% + \catcode95=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% +}} +% +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathcode`\_="8000 \mathunderscore + \let\\ = \mathbackslash + \implicitmath\finishmath} +\def\finishmath#1{#1\implicitmath\Etex} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{\implicitmath\ptexbullet\implicitmath} +\def\minus{\implicitmath-\implicitmath} + +% @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{% + \iflinks + \readauxfile + \fi % \openindices needs to do some work in any case. + \openindices + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + % Just to be on the safe side, close the input stream before the \input. + \openin 1 texinfo.cnf + \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi + \closein1 + \temp + % + \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 + +\ifx\pdfoutput\undefined + \pdffalse + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\else + \pdftrue + \pdfoutput = 1 + \input pdfcolor + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}% + \def\imageheight{#3}% + % without \immediate, 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 + \ifx\empty\imagewidth\else width \imagewidth \fi + \ifx\empty\imageheight\else height \imageheight \fi + \ifnum\pdftexversion<13 + #1.pdf% + \else + {#1.pdf}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} + \def\pdfmkpgn#1{#1} + \let\linkcolor = \Blue % was Cyan, but that seems light? + \def\endlink{\Black\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 by1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + \def\pdfmakeoutlines{{% + \openin 1 \jobname.toc + \ifeof 1\else\begingroup + \closein 1 + \indexnofonts + \def\tt{} + \let\_ = \normalunderscore + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + \def\chapentry ##1##2##3{} + \let\appendixentry = \chapentry + \def\unnumbchapentry ##1##2{} + \def\secentry ##1##2##3##4{\advancenumber{chap##2}} + \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} + \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} + \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} + \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} + \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} + \input \jobname.toc + \def\chapentry ##1##2##3{% + \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} + \let\appendixentry = \chapentry + \def\unnumbchapentry ##1##2{% + \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} + \def\secentry ##1##2##3##4{% + \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} + \def\unnumbsecentry ##1##2##3{% + \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} + \def\subsecentry ##1##2##3##4##5{% + \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} + \def\unnumbsubsecentry ##1##2##3##4{% + \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} + \def\subsubsecentry ##1##2##3##4##5##6{% + \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} + \def\unnumbsubsubsecentry ##1##2##3##4##5{% + \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} + \input \jobname.toc + \endgroup\fi + }} + \def\makelinks #1,{% + \def\params{#1}\def\E{END}% + \ifx\params\E + \let\nextmakelinks=\relax + \else + \let\nextmakelinks=\makelinks + \ifnum\lnkcount>0,\fi + \picknum{#1}% + \startlink attr{/Border [0 0 0]} + goto name{\pdfmkpgn{\the\pgn}}% + \linkcolor #1% + \advance\lnkcount by 1% + \endlink + \fi + \nextmakelinks + } + \def\picknum#1{\expandafter\pn#1} + \def\pn#1{% + \def\p{#1}% + \ifx\p\lbrace + \let\nextpn=\ppn + \else + \let\nextpn=\ppnn + \def\first{#1} + \fi + \nextpn + } + \def\ppn#1{\pgn=#1\gobble} + \def\ppnn{\pgn=\first} + \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + \def\pdfurl#1{% + \begingroup + \normalturnoffactive\def\@{@}% + \let\value=\expandablevalue + \leavevmode\Red + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + % #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| + \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}} + \linkcolor #1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\fi % \ifx\pdfoutput + + +\message{fonts,} +% Font-change commands. + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf analogous to plain's \rm, etc. +\newfam\sffam +\def\sf{\fam=\sffam \tensf} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this one. +\def\ttsl{\tenttsl} + +% Default leading. +\newdimen\textleading \textleading = 13.2pt + +% 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} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor +\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\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} + +\newcount\mainmagstep +\ifx\bigger\relax + % not really supported. + \let\mainmagstep=\magstep1 + \setfont\textrm\rmshape{12}{1000} + \setfont\texttt\ttshape{12}{1000} +\else + \mainmagstep=\magstephalf + \setfont\textrm\rmshape{10}{\mainmagstep} + \setfont\texttt\ttshape{10}{\mainmagstep} +\fi +% Instead of cmb10, you many want to use cmbx10. +% cmbx10 is a prettier font on its own, but cmb10 +% looks better when embedded in a line with cmr10. +\setfont\textbf\bfshape{10}{\mainmagstep} +\setfont\textit\itshape{10}{\mainmagstep} +\setfont\textsl\slshape{10}{\mainmagstep} +\setfont\textsf\sfshape{10}{\mainmagstep} +\setfont\textsc\scshape{10}{\mainmagstep} +\setfont\textttsl\ttslshape{10}{\mainmagstep} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep + +% A few fonts for @defun, etc. +\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +\setfont\deftt\ttshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\setfont\smallrm\rmshape{9}{1000} +\setfont\smalltt\ttshape{9}{1000} +\setfont\smallbf\bfshape{10}{900} +\setfont\smallit\itshape{9}{1000} +\setfont\smallsl\slshape{9}{1000} +\setfont\smallsf\sfshape{9}{1000} +\setfont\smallsc\scshape{10}{900} +\setfont\smallttsl\ttslshape{10}{900} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 + +% Fonts for small examples (8pt). +\setfont\smallerrm\rmshape{8}{1000} +\setfont\smallertt\ttshape{8}{1000} +\setfont\smallerbf\bfshape{10}{800} +\setfont\smallerit\itshape{8}{1000} +\setfont\smallersl\slshape{8}{1000} +\setfont\smallersf\sfshape{8}{1000} +\setfont\smallersc\scshape{10}{800} +\setfont\smallerttsl\ttslshape{10}{800} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 + +% Fonts for title page: +\setfont\titlerm\rmbshape{12}{\magstep3} +\setfont\titleit\itbshape{10}{\magstep4} +\setfont\titlesl\slbshape{10}{\magstep4} +\setfont\titlett\ttbshape{12}{\magstep3} +\setfont\titlettsl\ttslshape{10}{\magstep4} +\setfont\titlesf\sfbshape{17}{\magstep1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} + +% Chapter (and unnumbered) fonts (17.28pt). +\setfont\chaprm\rmbshape{12}{\magstep2} +\setfont\chapit\itbshape{10}{\magstep3} +\setfont\chapsl\slbshape{10}{\magstep3} +\setfont\chaptt\ttbshape{12}{\magstep2} +\setfont\chapttsl\ttslshape{10}{\magstep3} +\setfont\chapsf\sfbshape{17}{1000} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 + +% Section fonts (14.4pt). +\setfont\secrm\rmbshape{12}{\magstep1} +\setfont\secit\itbshape{10}{\magstep2} +\setfont\secsl\slbshape{10}{\magstep2} +\setfont\sectt\ttbshape{12}{\magstep1} +\setfont\secttsl\ttslshape{10}{\magstep2} +\setfont\secsf\sfbshape{12}{\magstep1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 + +% Subsection fonts (13.15pt). +\setfont\ssecrm\rmbshape{12}{\magstephalf} +\setfont\ssecit\itbshape{10}{1315} +\setfont\ssecsl\slbshape{10}{1315} +\setfont\ssectt\ttbshape{12}{\magstephalf} +\setfont\ssecttsl\ttslshape{10}{1315} +\setfont\ssecsf\sfbshape{12}{\magstephalf} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{\magstep1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +% The smallcaps and symbol fonts should actually be scaled \magstep1.5, +% but that is not a standard magnification. + +% 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 so that font changes will continue to work +% in math mode, where it is the current \fam that is relevant in most +% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam +% \tenbf}, for example. By redefining \tenbf, we obviate the need to +% redefine \bf itself. +\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 + \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 + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #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 + \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 + \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 + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? +\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 + \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 + \resetmathfonts \setleading{9.5pt}} +\let\smallexamplefonts = \smallerfonts + +% Set up the default fonts, so we can use them for creating boxes. +% +\textfonts + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000} +\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontsl\slshape{12}{1000} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} +\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\var=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic +\let\cite=\smartslanted + +\def\b#1{{\bf #1}} +\let\strong=\b + +% 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 = `- } + +\def\t#1{% + {\tt \rawbackslash \frenchspacing #1}% + \null +} +\let\ttfont=\t +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000} +\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}}}} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=\samp +\let\option=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\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 + \frenchspacing + #1% + }% + \null +} + +% 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 + % + \global\def\code{\begingroup + \catcode`\-=\active \let-\codedash + \catcode`\_=\active \let_\codeunder + \codex + } + % + % If we end up with any active - characters when handling the index, + % just treat them as a normal -. + \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} +} + +\def\realdash{-} +\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{}{}{}}% + {\_}% +} +\def\codex #1{\tclose{#1}\endgroup} + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @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). +\def\kbdinputstyle{\parsearg\kbdinputstylexxx} +\def\kbdinputstylexxx#1{% + \def\arg{#1}% + \ifx\arg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\arg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\arg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is kbdinputdistinct. (Too much of a hassle to call the macro, +% the catcodes are wrong for parsearg to work.) +\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @url, @env, @command quotes seem unnecessary, so use \code. +\let\url=\code +\let\env=\code +\let\command=\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. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#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} + +% 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 + +% 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 } + +% 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} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @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} + +% 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 + +% @acronym downcases the argument and prints in smallcaps. +\def\acronym#1{{\smallcaps \lowercase{#1}}} + +% @pounds{} is a sterling sign. +\def\pounds{{\it\$}} + + +\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 + +\def\shorttitlepage{\parsearg\shorttitlepagezzz} +\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\def\titlepage{\begingroup \parindent=0pt \textfonts + \let\subtitlerm=\tenrm + \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% + % + \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% + % + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % + % Now you can print the title using @title. + \def\title{\parsearg\titlezzz}% + \def\titlezzz##1{\leftline{\titlefonts\rm ##1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Now you can put text using @subtitle. + \def\subtitle{\parsearg\subtitlezzz}% + \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% + % + % @author should come last, but may come many times. + \def\author{\parsearg\authorzzz}% + \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi + {\authorfont \leftline{##1}}}% + % + % 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 + \oldpage + \let\page = \oldpage + \hbox{}}% +% \def\page{\oldpage \hbox{}} +} + +\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 +} + +%%% 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\oddheading{\parsearg\oddheadingxxx} +\def\everyheading{\parsearg\everyheadingxxx} + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\oddfooting{\parsearg\oddfootingxxx} +\def\everyfooting{\parsearg\everyfootingxxx} + +{\catcode`\@=0 % + +\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} +\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} +\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} +\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} +\gdef\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 -\baselineskip + \global\advance\vsize by -\baselineskip +} + +\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} +% +}% unbind the catcode of @. + +% @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{ +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% 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\undefined +\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\settitlezzz} +\def\settitlezzz #1{\gdef\thistitle{#1}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(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, @vtable, 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\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} +\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} + +\def\internalBkitem{\smallbreak \parsearg\kitemzzz} +\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} + +\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% + \itemzzz {#1}} + +\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% + \itemzzz {#1}} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemfont{#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 + \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. Unfortunately + % we can't prevent a possible page break at the following + % \baselineskip glue. + \nobreak + \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 table}} +\def\itemx{\errmessage{@itemx while not in a table}} +\def\kitem{\errmessage{@kitem while not in a table}} +\def\kitemx{\errmessage{@kitemx while not in a table}} +\def\xitem{\errmessage{@xitem while not in a table}} +\def\xitemx{\errmessage{@xitemx while not in a table}} + +% Contains a kludge to get @end[description] to work. +\def\description{\tablez{\dontindex}{1}{}{}{}{}} + +% @table, @ftable, @vtable. +\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} +{\obeylines\obeyspaces% +\gdef\tablex #1^^M{% +\tabley\dontindex#1 \endtabley}} + +\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} +{\obeylines\obeyspaces% +\gdef\ftablex #1^^M{% +\tabley\fnitemindex#1 \endtabley +\def\Eftable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} +{\obeylines\obeyspaces% +\gdef\vtablex #1^^M{% +\tabley\vritemindex#1 \endtabley +\def\Evtable{\endgraf\afterenvbreak\endgroup}% +\let\Etable=\relax}} + +\def\dontindex #1{} +\def\fnitemindex #1{\doind {fn}{\code{#1}}}% +\def\vritemindex #1{\doind {vr}{\code{#1}}}% + +{\obeyspaces % +\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% +\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} + +\def\tablez #1#2#3#4#5#6{% +\aboveenvbreak % +\begingroup % +\def\Edescription{\Etable}% Necessary kludge. +\let\itemindex=#1% +\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % +\ifnum 0#4>0 \tableindent=#4\mil \fi % +\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % +\def\itemfont{#2}% +\itemmax=\tableindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \tableindent % +\exdentamount=\tableindent +\parindent = 0pt +\parskip = \smallskipamount +\ifdim \parskip=0pt \parskip=2pt \fi% +\def\Etable{\endgraf\afterenvbreak\endgroup}% +\let\item = \internalBitem % +\let\itemx = \internalBitemx % +\let\kitem = \internalBkitem % +\let\kitemx = \internalBkitemx % +\let\xitem = \internalBxitem % +\let\xitemx = \internalBxitemx % +} + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\def\itemize{\parsearg\itemizezzz} + +\def\itemizezzz #1{% + \begingroup % ended by the @end itemize + \itemizey {#1}{\Eitemize} +} + +\def\itemizey #1#2{% +\aboveenvbreak % +\itemmax=\itemindent % +\advance \itemmax by -\itemmargin % +\advance \leftskip by \itemindent % +\exdentamount=\itemindent +\parindent = 0pt % +\parskip = \smallskipamount % +\ifdim \parskip=0pt \parskip=2pt \fi% +\def#2{\endgraf\afterenvbreak\endgroup}% +\def\itemcontents{#1}% +\let\item=\itemizeitem} + +% Set sfcode to normal for the chars that usually have another value. +% These are `.?!:;,' +\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 + \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } + +% \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'. +% +\def\enumerate{\parsearg\enumeratezzz} +\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + \begingroup % ended by the @end enumerate + % + % 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 itemizey, 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 + \itemizey{#1.}\Eenumerate\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} + +% Definition of @item while inside @itemize. + +\def\itemizeitem{% +\advance\itemno by 1 +{\let\par=\endgraf \smallbreak}% +\ifhmode \errmessage{In hmode at itemizeitem}\fi +{\parskip=0in \hskip 0pt +\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% +\vadjust{\penalty 1200}}% +\flushcr} + +% @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. +% +% For those who want to use more than one line's worth of words in +% the preamble, break the line within one argument and it +% will parse correctly, i.e., +% +% @multitable {Column 1 template} {Column 2 template} {Column 3 +% template} +% Not: +% @multitable {Column 1 template} {Column 2 template} +% {Column 3 template} + +% 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, @multitable or @end multitable 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 part of the @columnfraction before the decimal point, which +% is presumably either 0 or the empty string (but we don't check, we +% just throw it away). #2 is the decimal part, which we use as the +% percent of \hsize for this column. +\def\pickupwholefraction#1.#2 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{.#2\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 }% 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 +} + +% This used to have \hskip1sp. But then the space in a template line is +% not enough. That is bad. So let's go back to just & until we +% encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{&} + +% @multitable ... @end multitable definitions: +% +\def\multitable{\parsearg\dotable} +\def\dotable#1{\bgroup + \vskip\parskip + \let\item\crcr + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% + % + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % \everycr will reset column counter, \colcount, at the end of + % each line. Every column entry will cause \colcount to advance by one. + % The table preamble + % looks at the current \colcount to find the correct column width. + \everycr{\noalign{% + % + % \filbreak%% keeps underfull box messages off when table breaks over pages. + % 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. + \global\colcount=0\relax}}% + % + % 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\relax + \multistrut\vtop{\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\setmultitablespacing{% test to see if user has set \multitablelinespace. +% If so, do nothing. If not, give it an appropriate dimension based on +% current baselineskip. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +%% strut to put in table in case some entry doesn't have descenders, +%% to keep lines equally spaced +\let\multistrut = \strut +\else +%% FIXME: what is \box0 supposed to be? +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \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,} +% Prevent errors for section commands. +% Used in @ignore and in failing conditionals. +\def\ignoresections{% + \let\chapter=\relax + \let\unnumbered=\relax + \let\top=\relax + \let\unnumberedsec=\relax + \let\unnumberedsection=\relax + \let\unnumberedsubsec=\relax + \let\unnumberedsubsection=\relax + \let\unnumberedsubsubsec=\relax + \let\unnumberedsubsubsection=\relax + \let\section=\relax + \let\subsec=\relax + \let\subsubsec=\relax + \let\subsection=\relax + \let\subsubsection=\relax + \let\appendix=\relax + \let\appendixsec=\relax + \let\appendixsection=\relax + \let\appendixsubsec=\relax + \let\appendixsubsection=\relax + \let\appendixsubsubsec=\relax + \let\appendixsubsubsection=\relax + \let\contents=\relax + \let\smallbook=\relax + \let\titlepage=\relax +} + +% Used in nested conditionals, where we have to parse the Texinfo source +% and so want to turn off most commands, in case they are used +% incorrectly. +% +\def\ignoremorecommands{% + \let\defcodeindex = \relax + \let\defcv = \relax + \let\deffn = \relax + \let\deffnx = \relax + \let\defindex = \relax + \let\defivar = \relax + \let\defmac = \relax + \let\defmethod = \relax + \let\defop = \relax + \let\defopt = \relax + \let\defspec = \relax + \let\deftp = \relax + \let\deftypefn = \relax + \let\deftypefun = \relax + \let\deftypeivar = \relax + \let\deftypeop = \relax + \let\deftypevar = \relax + \let\deftypevr = \relax + \let\defun = \relax + \let\defvar = \relax + \let\defvr = \relax + \let\ref = \relax + \let\xref = \relax + \let\printindex = \relax + \let\pxref = \relax + \let\settitle = \relax + \let\setchapternewpage = \relax + \let\setchapterstyle = \relax + \let\everyheading = \relax + \let\evenheading = \relax + \let\oddheading = \relax + \let\everyfooting = \relax + \let\evenfooting = \relax + \let\oddfooting = \relax + \let\headings = \relax + \let\include = \relax + \let\lowersections = \relax + \let\down = \relax + \let\raisesections = \relax + \let\up = \relax + \let\set = \relax + \let\clear = \relax + \let\item = \relax +} + +% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, +% @direntry, and @documentdescription. +% +\def\ignore{\doignore{ignore}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifnottex{\doignore{ifnottex}} +\def\html{\doignore{html}} +\def\menu{\doignore{menu}} +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\documentdescriptionword{documentdescription} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory = \comment + +% Ignore text until a line `@end #1'. +% +\def\doignore#1{\begingroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define a command to swallow text until we reach `@end #1'. + % This @ is a catcode 12 token (that is the normal catcode of @ in + % this texinfo.tex file). We change the catcode of @ below to match. + \long\def\doignoretext##1@end #1{\enddoignore}% + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \catcode32 = 10 + % + % Ignore braces, too, so mismatched braces don't cause trouble. + \catcode`\{ = 9 + \catcode`\} = 9 + % + % We must not have @c interpreted as a control sequence. + \catcode`\@ = 12 + % + \def\ignoreword{#1}% + \ifx\ignoreword\documentdescriptionword + % The c kludge breaks documentdescription, since + % `documentdescription' contains a `c'. Means not everything will + % be ignored inside @documentdescription, but oh well... + \else + % Make the letter c a comment character so that the rest of the line + % will be ignored. This way, the document can have (for example) + % @c @end ifinfo + % and the @end ifinfo will be properly ignored. + % (We've just changed @ to catcode 12.) + \catcode`\c = 14 + \fi + % + % And now expand the command defined above. + \doignoretext +} + +% What we do to finish off ignored text. +% +\def\enddoignore{\endgroup\ignorespaces}% + +\newif\ifwarnedobs\warnedobsfalse +\def\obstexwarn{% + \ifwarnedobs\relax\else + % We need to warn folks that they may have trouble with TeX 3.0. + % This uses \immediate\write16 rather than \message to get newlines. + \immediate\write16{} + \immediate\write16{WARNING: for users of Unix TeX 3.0!} + \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} + \immediate\write16{If you are running another version of TeX, relax.} + \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} + \immediate\write16{ Then upgrade your TeX installation if you can.} + \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} + \immediate\write16{If you are stuck with version 3.0, run the} + \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} + \immediate\write16{ to use a workaround.} + \immediate\write16{} + \global\warnedobstrue + \fi +} + +% **In TeX 3.0, setting text in \nullfont hangs tex. For a +% workaround (which requires the file ``dummy.tfm'' to be installed), +% uncomment the following line: +%%%%%\font\nullfont=dummy\let\obstexwarn=\relax + +% Ignore text, except that we keep track of conditional commands for +% purposes of nesting, up to an `@end #1' command. +% +\def\nestedignore#1{% + \obstexwarn + % We must actually expand the ignored text to look for the @end + % command, so that nested ignore constructs work. Thus, we put the + % text into a \vbox and then do nothing with the result. To minimize + % the change of memory overflow, we follow the approach outlined on + % page 401 of the TeXbook: make the current font be a dummy font. + % + \setbox0 = \vbox\bgroup + % Don't complain about control sequences we have declared \outer. + \ignoresections + % + % Define `@end #1' to end the box, which will in turn undefine the + % @end command again. + \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% + % + % We are going to be parsing Texinfo commands. Most cause no + % trouble when they are used incorrectly, but some commands do + % complicated argument parsing or otherwise get confused, so we + % undefine them. + % + % We can't do anything about stray @-signs, unfortunately; + % they'll produce `undefined control sequence' errors. + \ignoremorecommands + % + % Set the current font to be \nullfont, a TeX primitive, and define + % all the font commands to also use \nullfont. We don't use + % dummy.tfm, as suggested in the TeXbook, because not all sites + % might have that installed. Therefore, math mode will still + % produce output, but that should be an extremely small amount of + % stuff compared to the main input. + % + \nullfont + \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont + \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont + \let\tensf=\nullfont + % Similarly for index fonts. + \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont + \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont + \let\smallsf=\nullfont + % Similarly for smallexample fonts. + \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont + \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont + \let\smallersf=\nullfont + % + % Don't complain when characters are missing from the fonts. + \tracinglostchars = 0 + % + % Don't bother to do space factor calculations. + \frenchspacing + % + % Don't report underfull hboxes. + \hbadness = 10000 + % + % Do minimal line-breaking. + \pretolerance = 10000 + % + % Do not execute instructions in @tex + \def\tex{\doignore{tex}}% + % Do not execute macro definitions. + % `c' is a comment character, so the word `macro' will get cut off. + \def\macro{\doignore{ma}}% +} + +% @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. Make sure the catcode of space is correct to avoid +% losing inside @example, for instance. +% +\def\set{\begingroup\catcode` =10 + \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. + \parsearg\setxxx} +\def\setxxx#1{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + \def\temp{#2}% + \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty + \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. + \fi + \endgroup +} +% Can't use \xdef to pre-expand #2 and save some time, since \temp or +% \next or other control sequences that we've defined might get us into +% an infinite loop. Consider `@set foo @cite{bar}'. +\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\def\clear{\parsearg\clearxxx} +\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} + +% @value{foo} gets the text saved in variable foo. +{ + \catcode`\_ = \active + % + % We might end up with active _ or - characters in the argument if + % we're called from @code, as @code{@value{foo-bar_}}. So \let any + % such active characters to their normal equivalents. + \gdef\value{\begingroup + \catcode`\-=12 \catcode`\_=12 + \indexbreaks \let_\normalunderscore + \valuexxx} +} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we \let\value to this in \indexdummies). Ones +% whose names contain - or _ still won't work, but we can't do anything +% about that. The command has to be fully expandable, 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'']}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +\def\ifset{\parsearg\ifsetxxx} +\def\ifsetxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifsetfail + \else + \expandafter\ifsetsucceed + \fi +} +\def\ifsetsucceed{\conditionalsucceed{ifset}} +\def\ifsetfail{\nestedignore{ifset}} +\defineunmatchedend{ifset} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +\def\ifclear{\parsearg\ifclearxxx} +\def\ifclearxxx #1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \expandafter\ifclearsucceed + \else + \expandafter\ifclearfail + \fi +} +\def\ifclearsucceed{\conditionalsucceed{ifclear}} +\def\ifclearfail{\nestedignore{ifclear}} +\defineunmatchedend{ifclear} + +% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we +% read the text following, through the first @end iftex (etc.). Make +% `@end iftex' (etc.) valid only after an @iftex. +% +\def\iftex{\conditionalsucceed{iftex}} +\def\ifnothtml{\conditionalsucceed{ifnothtml}} +\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} +\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} +\defineunmatchedend{iftex} +\defineunmatchedend{ifnothtml} +\defineunmatchedend{ifnotinfo} +\defineunmatchedend{ifnotplaintext} + +% We can't just want to start a group at @iftex (etc.) and end it at +% @end iftex, since then @set commands inside the conditional have no +% effect (they'd get reverted at the end of the group). So we must +% define \Eiftex to redefine itself to be its previous value. (We can't +% just define it to fail again with an ``unmatched end'' error, since +% the @ifset might be nested.) +% +\def\conditionalsucceed#1{% + \edef\temp{% + % Remember the current value of \E#1. + \let\nece{prevE#1} = \nece{E#1}% + % + % At the `@end #1', redefine \E#1 to be its previous value. + \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% + }% + \temp +} + +% We need to expand lots of \csname's, but we don't want to expand the +% control sequences after we've constructed them. +% +\def\nece#1{\expandafter\noexpand\csname#1\endcsname} + +% @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 \newindex. +{\catcode`\@=11 +\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} + +% \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 \undefined + % 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 likely to appear in an index entry. +% (Must be a way to avoid doing expansion at all, and thus not have to +% laboriously list every single command here.) +% +\def\indexdummies{% +\def\ { }% +\def\@{@}% change to @@ when we switch to @ as escape char in aux files. +% Need these in case \tex is in effect and \{ is a \delimiter again. +% But can't use \lbracecmd and \rbracecmd because texindex assumes +% braces and backslashes are used only as delimiters. +\let\{ = \mylbrace +\let\} = \myrbrace +\def\_{{\realbackslash _}}% +\normalturnoffactive +% +% Take care of the plain tex accent commands. +\def\,##1{\realbackslash ,{##1}}% +\def\"{\realbackslash "}% +\def\`{\realbackslash `}% +\def\'{\realbackslash '}% +\def\^{\realbackslash ^}% +\def\~{\realbackslash ~}% +\def\={\realbackslash =}% +\def\b{\realbackslash b}% +\def\c{\realbackslash c}% +\def\d{\realbackslash d}% +\def\u{\realbackslash u}% +\def\v{\realbackslash v}% +\def\H{\realbackslash H}% +\def\dotless##1{\realbackslash dotless {##1}}% +% Take care of the plain tex special European modified letters. +\def\AA{\realbackslash AA}% +\def\AE{\realbackslash AE}% +\def\L{\realbackslash L}% +\def\OE{\realbackslash OE}% +\def\O{\realbackslash O}% +\def\aa{\realbackslash aa}% +\def\ae{\realbackslash ae}% +\def\l{\realbackslash l}% +\def\oe{\realbackslash oe}% +\def\o{\realbackslash o}% +\def\ss{\realbackslash ss}% +% +% Although these internals commands shouldn't show up, sometimes they do. +\def\bf{\realbackslash bf }% +\def\gtr{\realbackslash gtr}% +\def\hat{\realbackslash hat}% +\def\less{\realbackslash less}% +%\def\rm{\realbackslash rm }% +\def\sf{\realbackslash sf}% +\def\sl{\realbackslash sl }% +\def\tclose##1{\realbackslash tclose {##1}}% +\def\tt{\realbackslash tt}% +% +\def\b##1{\realbackslash b {##1}}% +\def\i##1{\realbackslash i {##1}}% +\def\sc##1{\realbackslash sc {##1}}% +\def\t##1{\realbackslash t {##1}}% +\def\r##1{\realbackslash r {##1}}% +% +\def\TeX{\realbackslash TeX}% +\def\acronym##1{\realbackslash acronym {##1}}% +\def\cite##1{\realbackslash cite {##1}}% +\def\code##1{\realbackslash code {##1}}% +\def\command##1{\realbackslash command {##1}}% +\def\dfn##1{\realbackslash dfn {##1}}% +\def\dots{\realbackslash dots }% +\def\emph##1{\realbackslash emph {##1}}% +\def\env##1{\realbackslash env {##1}}% +\def\file##1{\realbackslash file {##1}}% +\def\kbd##1{\realbackslash kbd {##1}}% +\def\key##1{\realbackslash key {##1}}% +\def\math##1{\realbackslash math {##1}}% +\def\option##1{\realbackslash option {##1}}% +\def\samp##1{\realbackslash samp {##1}}% +\def\strong##1{\realbackslash strong {##1}}% +\def\uref##1{\realbackslash uref {##1}}% +\def\url##1{\realbackslash url {##1}}% +\def\var##1{\realbackslash var {##1}}% +\def\w{\realbackslash w }% +% +% These math commands don't seem likely to be used in index entries. +\def\copyright{\realbackslash copyright}% +\def\equiv{\realbackslash equiv}% +\def\error{\realbackslash error}% +\def\expansion{\realbackslash expansion}% +\def\point{\realbackslash point}% +\def\print{\realbackslash print}% +\def\result{\realbackslash result}% +% +% Handle some cases of @value -- where the variable name does not +% contain - or _, and the value does not contain any +% (non-fully-expandable) commands. +\let\value = \expandablevalue +% +\unsepspaces +% Turn off macro expansion +\turnoffmacros +} + +% 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 \ ). +{\obeyspaces + \gdef\unsepspaces{\obeyspaces\let =\space}} + +% \indexnofonts no-ops all font-change commands. +% This is used when outputting the strings to sort the index by. +\def\indexdummyfont#1{#1} +\def\indexdummytex{TeX} +\def\indexdummydots{...} + +\def\indexnofonts{% +\def\@{@}% +% how to handle braces? +\def\_{\normalunderscore}% +% +\let\,=\indexdummyfont +\let\"=\indexdummyfont +\let\`=\indexdummyfont +\let\'=\indexdummyfont +\let\^=\indexdummyfont +\let\~=\indexdummyfont +\let\==\indexdummyfont +\let\b=\indexdummyfont +\let\c=\indexdummyfont +\let\d=\indexdummyfont +\let\u=\indexdummyfont +\let\v=\indexdummyfont +\let\H=\indexdummyfont +\let\dotless=\indexdummyfont +% Take care of the plain tex special European modified letters. +\def\AA{AA}% +\def\AE{AE}% +\def\L{L}% +\def\OE{OE}% +\def\O{O}% +\def\aa{aa}% +\def\ae{ae}% +\def\l{l}% +\def\oe{oe}% +\def\o{o}% +\def\ss{ss}% +% +% 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=\indexdummyfont +% +\let\b=\indexdummyfont +\let\i=\indexdummyfont +\let\r=\indexdummyfont +\let\sc=\indexdummyfont +\let\t=\indexdummyfont +% +\let\TeX=\indexdummytex +\let\acronym=\indexdummyfont +\let\cite=\indexdummyfont +\let\code=\indexdummyfont +\let\command=\indexdummyfont +\let\dfn=\indexdummyfont +\let\dots=\indexdummydots +\let\emph=\indexdummyfont +\let\env=\indexdummyfont +\let\file=\indexdummyfont +\let\kbd=\indexdummyfont +\let\key=\indexdummyfont +\let\math=\indexdummyfont +\let\option=\indexdummyfont +\let\samp=\indexdummyfont +\let\strong=\indexdummyfont +\let\uref=\indexdummyfont +\let\url=\indexdummyfont +\let\var=\indexdummyfont +\let\w=\indexdummyfont +} + +% To define \realbackslash, we must make \ not be an escape. +% We must first make another character (@) an escape +% so we do not become unable to do a definition. + +{\catcode`\@=0 \catcode`\\=\other + @gdef@realbackslash{\}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% For \ifx comparisons. +\def\emptymacro{\empty} + +% Most index entries go through here, but \dosubind is the general case. +% +\def\doind#1#2{\dosubind{#1}{#2}\empty} + +% 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 defuns, which call us directly. +% +\def\dosubind#1#2#3{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \fi + {% + \count255=\lastpenalty + {% + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + {% + \let\folio = 0% We will expand all macros now EXCEPT \folio. + \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + \def\thirdarg{#3}% + % + % If third arg is present, precede it with space in sort key. + \ifx\thirdarg\emptymacro + \let\subentry = \empty + \else + \def\subentry{ #3}% + \fi + % + % First process the index entry with all font commands turned + % off to get the string to sort by. + {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% + % + % Now the real index entry with the fonts. + \toks0 = {#2}% + % + % If the third (subentry) arg is present, add it to the index + % line to write. + \ifx\thirdarg\emptymacro \else + \toks0 = \expandafter{\the\toks0{#3}}% + \fi + % + % 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\csname#1indfile\endcsname{% + \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% + }% + % + % 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 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. + % + \iflinks + \ifvmode + \skip0 = \lastskip + \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi + \fi + % + \temp % do the write + % + % + \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi + \fi + }% + }% + \penalty\count255 + }% +} + +% 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). +% +\def\printindex{\parsearg\doprintindex} +\def\doprintindex#1{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \indexbreaks + % + % 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{\rawbackslashxx}% + \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. + \penalty -300 + % + % 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}% + \vskip .33\baselineskip plus .1\baselineskip + % + % Do our best not to break after the initial. + \nobreak +}} + +% This typesets a paragraph consisting of #1, dot leaders, and then #2 +% flush to the right margin. It is used for index and table of contents +% entries. The paragraph is indented by \leftskip. +% +\def\entry#1#2{\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 + % + % Start a ``paragraph'' for the index entry so the line breaking + % parameters we've set above will have an effect. + \noindent + % + % Insert the text of the index entry. TeX will do line-breaking on it. + #1% + % 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. + \def\tempa{{\rm }}% + \def\tempb{#2}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd\ \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#2.\ \the\toksA % The page number ends the paragraph. + \else + \ #2% The page number ends the paragraph. + \fi + \fi% + \par +\endgroup} + +% Like \dotfill except takes at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \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{% + \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. + +\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 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 this as the name of the chapter. +% page headings and footings can use it. @section does likewise. +\def\thischapter{} +\def\thissection{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raise/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 + +% Choose a numbered-heading macro +% #1 is heading level if unmodified by @raisesections or @lowersections +% #2 is text for heading +\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \chapterzzz{#2} +\or + \seczzz{#2} +\or + \numberedsubseczzz{#2} +\or + \numberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \chapterzzz{#2} + \else + \numberedsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses appendix heading levels +\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \appendixzzz{#2} +\or + \appendixsectionzzz{#2} +\or + \appendixsubseczzz{#2} +\or + \appendixsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \appendixzzz{#2} + \else + \appendixsubsubseczzz{#2} + \fi +\fi +} + +% like \numhead, but chooses numberless heading levels +\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 +\ifcase\absseclevel + \unnumberedzzz{#2} +\or + \unnumberedseczzz{#2} +\or + \unnumberedsubseczzz{#2} +\or + \unnumberedsubsubseczzz{#2} +\else + \ifnum \absseclevel<0 + \unnumberedzzz{#2} + \else + \unnumberedsubsubseczzz{#2} + \fi +\fi +} + +% @chapter, @appendix, @unnumbered. +\def\thischaptername{No Chapter Title} +\outer\def\chapter{\parsearg\chapteryyy} +\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% +\chapmacro {#1}{\the\chapno}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +% We don't substitute the actual chapter name into \thischapter +% because we don't want its macros evaluated now. +\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% + {\the\chapno}}}% +\temp +\donoderef +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec +} + +\outer\def\appendix{\parsearg\appendixyyy} +\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +\global\advance \appendixno by 1 +\message{\putwordAppendix\space \appendixletter}% +\chapmacro {#1}{\putwordAppendix{} \appendixletter}% +\gdef\thissection{#1}% +\gdef\thischaptername{#1}% +\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% + {\appendixletter}}}% +\temp +\appendixnoderef +\global\let\section = \appendixsec +\global\let\subsection = \appendixsubsec +\global\let\subsubsection = \appendixsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\def\centerchap{\parsearg\centerchapyyy} +\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} + +% @top is like @unnumbered. +\outer\def\top{\parsearg\unnumberedyyy} + +\outer\def\unnumbered{\parsearg\unnumberedyyy} +\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz #1{% +\secno=0 \subsecno=0 \subsubsecno=0 +% +% 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)}% +% +\unnumbchapmacro {#1}% +\gdef\thischapter{#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% +\temp +\unnumbnoderef +\global\let\section = \unnumberedsec +\global\let\subsection = \unnumberedsubsec +\global\let\subsubsection = \unnumberedsubsubsec +} + +% Sections. +\outer\def\numberedsec{\parsearg\secyyy} +\def\secyyy #1{\numhead1{#1}} % normally calls seczzz +\def\seczzz #1{% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\the\chapno}{\the\secno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsection{\parsearg\appendixsecyyy} +\outer\def\appendixsec{\parsearg\appendixsecyyy} +\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz #1{% +\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % +\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% + {\appendixletter}{\the\secno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} +\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz #1{% +\plainsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% + {\the\toks0}{\the\chapno}}}% +\temp +\unnumbnoderef +\nobreak +} + +% Subsections. +\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} +\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz #1{% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} +\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz #1{% +\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % +\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} +\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz #1{% +\plainsubsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% + {\the\toks0}{\the\chapno}{\the\secno}}}% +\temp +\unnumbnoderef +\nobreak +} + +% Subsubsections. +\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} +\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz #1{% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\donoderef +\nobreak +} + +\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} +\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz #1{% +\gdef\thissection{#1}\global\advance \subsubsecno by 1 % +\subsubsecheading {#1} + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% + {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% +\temp +\appendixnoderef +\nobreak +} + +\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} +\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz #1{% +\plainsubsubsecheading {#1}\gdef\thissection{#1}% +\toks0 = {#1}% +\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% + {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% +\temp +\unnumbnoderef +\nobreak +} + +% These are variants which are not "outer", so they can appear in @ifinfo. +% Actually, they should now be obsolete; ordinary section commands should work. +\def\infotop{\parsearg\unnumberedzzz} +\def\infounnumbered{\parsearg\unnumberedzzz} +\def\infounnumberedsec{\parsearg\unnumberedseczzz} +\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} +\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} + +\def\infoappendix{\parsearg\appendixzzz} +\def\infoappendixsec{\parsearg\appendixseczzz} +\def\infoappendixsubsec{\parsearg\appendixsubseczzz} +\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} + +\def\infochapter{\parsearg\chapterzzz} +\def\infosection{\parsearg\sectionzzz} +\def\infosubsection{\parsearg\subsectionzzz} +\def\infosubsubsection{\parsearg\subsubsectionzzz} + +% 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. +\global\let\section = \numberedsec +\global\let\subsection = \numberedsubsec +\global\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{\parsearg\majorheadingzzz} +\def\majorheadingzzz #1{% +{\advance\chapheadingskip by 10pt \chapbreak }% +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +\def\chapheading{\parsearg\chapheadingzzz} +\def\chapheadingzzz #1{\chapbreak % +{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\penalty 200} + +% @heading, @subheading, @subsubheading. +\def\heading{\parsearg\plainsecheading} +\def\subheading{\parsearg\plainsubsecheading} +\def\subsubheading{\parsearg\plainsubsubsecheading} + +% 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} + +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\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 + +\def\CHAPFplain{ +\global\let\chapmacro=\chfplain +\global\let\unnumbchapmacro=\unnchfplain +\global\let\centerchapmacro=\centerchfplain} + +% Plain chapter opening. +% #1 is the text, #2 the chapter number or empty if unnumbered. +\def\chfplain#1#2{% + \pchapsepmacro + {% + \chapfonts \rm + \def\chapnum{#2}% + \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% Plain opening for unnumbered. +\def\unnchfplain#1{\chfplain{#1}{}} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerchfplain#1{{% + \def\centerparametersmaybe{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt + }% + \chfplain{#1}{}% +}} + +\CHAPFplain % The default + +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\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 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} + +\def\CHAPFopen{ +\global\let\chapmacro=\chfopen +\global\let\unnumbchapmacro=\unnchfopen +\global\let\centerchapmacro=\centerchfopen} + + +% Section titles. +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip {-1000}} +\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} +\def\plainsecheading#1{\sectionheading{sec}{}{#1}} + +% Subsection titles. +\newskip \subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} +\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} +\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} + +% Subsubsection titles. +\let\subsubsecheadingskip = \subsecheadingskip +\let\subsubsecheadingbreak = \subsecheadingbreak +\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} +\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} + + +% Print any size section title. +% +% #1 is the section type (sec/subsec/subsubsec), #2 is the section +% number (maybe empty), #3 the text. +\def\sectionheading#1#2#3{% + {% + \expandafter\advance\csname #1headingskip\endcsname by \parskip + \csname #1headingbreak\endcsname + }% + {% + % Switch to the right set of fonts. + \csname #1fonts\endcsname \rm + % + % Only insert the separating space if we have a section number. + \def\secnum{#2}% + \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent = \wd0 % zero if no section number + \unhbox0 #3}% + }% + \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. We supply {\folio} at the end of the +% argument, which will end up as the last argument to the \...entry macro. +% +% We open the .toc file here instead of at @setfilename or any other +% fixed time so that @contents can be put in the document anywhere. +% +\newif\iftocfileopened +\def\writetocentry#1{% + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + \iflinks \write\tocfile{#1{\folio}}\fi + % + % Tell \shipout to create a page destination if we're doing pdf, which + % will be the target of the links in the table of contents. We can't + % just do it 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 \pdfmakepagedesttrue \fi +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Finish up the main text and 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. + \unnumbchapmacro{#1}\def\thischapter{}% + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \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 \pageno = \lastnegativepageno \fi +} + + +% Normal (long) toc. +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \pdfmakeoutlines + \endgroup + \lastnegativepageno = \pageno + \pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\chapentry = \shortchapentry + \let\appendixentry = \shortappendixentry + \let\unnumbchapentry = \shortunnumberedentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\secentry ##1##2##3##4{} + \def\unnumbsecentry ##1##2##3{} + \def\subsecentry ##1##2##3##4##5{} + \def\unnumbsubsecentry ##1##2##3##4{} + \def\subsubsecentry ##1##2##3##4##5##6{} + \def\unnumbsubsubsecentry ##1##2##3##4##5{} + \openin 1 \jobname.toc + \ifeof 1 \else + \closein 1 + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \pageno = \savepageno +} +\let\shortcontents = \summarycontents + +\ifpdf + \pdfcatalog{/PageMode /UseOutlines}% +\fi + +% 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, ... + +% Chapters, in the main contents. +\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +} + +% Appendices, in the main contents. +\def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} +% +% Appendices, in the short toc. +\let\shortappendixentry = \shortchapentry + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. +% We could simplify the code here by writing out an \appendixentry +% command in the toc file for appendices, instead of using \chapentry +% for both, but it doesn't seem worth it. +% +\newdimen\shortappendixwidth +% +\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.) + \dimen0 = 1em + \hbox to \dimen0{#1\hss}% +} + +% Unnumbered chapters. +\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} +\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} + +% Sections. +\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} +\def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} + +% Subsections. +\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} +\def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\subsubsecentry#1#2#3#4#5#6{% + \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} +\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} + +% This parameter controls the indentation of the various levels. +\newdimen\tocindent \tocindent = 3pc + +% 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} + +% Final typesetting of a toc entry; we use the same \entry macro as for +% the index entries, but we want to suppress hyphenation here. (We +% can't do that in the \entry macro, since index entries might consist +% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) +\def\tocentry#1#2{\begingroup + \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks + % Do not use \turnoffactive in these arguments. Since the toc is + % typeset in cmr, characters such as _ would come out wrong; we + % have to do the usual translation tricks. + \entry{#1}{#2}% +\endgroup} + +% 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} +\let\subsecentryfonts = \textfonts +\let\subsubsecentryfonts = \textfonts + + +\message{environments,} +% @foo ... @end foo. + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\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 \tensf error\kern-1.5pt} +% +\global\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} + +% @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 tex @ character. + +\def\tex{\begingroup + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\%=14 + \catcode 43=12 % plus + \catcode`\"=12 + \catcode`\==12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \escapechar=`\\ + % + \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\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\*=\ptexstar + \let\t=\ptext + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +\let\Etex=\endgroup} + +% Define @lisp ... @end lisp. +% @lisp does a \begingroup 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} + +% 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. +% +{\obeyspaces % +\gdef\sepspaces{\obeyspaces\let =\tie}} + +% Define \obeyedspace to be our active space, whatever it is. This is +% for use in \parsearg. +{\sepspaces% +\global\let\obeyedspace= } + +% 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{{% + \ifnum\lastpenalty < 10000 + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + \penalty-50 + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +\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 + +\long\def\cartouche{% +\begingroup + \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=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \hsize=\cartinner + \kern3pt + \begingroup + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip +\def\Ecartouche{% + \endgroup + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup +\endgroup +}} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \inENV % This group ends at the end of the body + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \singlespace + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + % @cartouche defines \nonarrowing to inhibit narrowing + % at next level down. + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \let\exdent=\nofillexdent + \let\nonarrowing=\relax + \fi +} + +% Define the \E... control sequence only if we are inside the particular +% environment, so the error checking in \end will work. +% +% To end an @example-like environment, we first end the paragraph (via +% \afterenvbreak's vertical glue), and then the group. That way we keep +% the zero \parskip that the environments set -- \parskip glue will be +% inserted at the beginning of the next paragraph in the document, after +% the environment. +% +\def\nonfillfinish{\afterenvbreak\endgroup} + +% @lisp: indented, narrowed, typewriter font. +\def\lisp{\begingroup + \nonfillstart + \let\Elisp = \nonfillfinish + \tt + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} + +% @example: Same as @lisp. +\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} + +% @small... is usually equivalent to the non-small (@smallbook +% redefines). We must call \example (or whatever) last in the +% definition, since it reads the return following the @example (or +% whatever) command. +% +% This actually allows (for example) @end display inside an +% @smalldisplay. Too bad, but makeinfo will catch the error anyway. +% +\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} +\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} +\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} +\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} + +% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. +% Originally contributed by Pavel@xerox. +\def\smalllispx{\begingroup + \def\Esmalllisp{\nonfillfinish\endgroup}% + \def\Esmallexample{\nonfillfinish\endgroup}% + \smallexamplefonts + \lisp +} + +% @display: same as @lisp except keep current font. +% +\def\display{\begingroup + \nonfillstart + \let\Edisplay = \nonfillfinish + \gobble +} +% +% @smalldisplay (when @smallbook): @display plus smaller fonts. +% +\def\smalldisplayx{\begingroup + \def\Esmalldisplay{\nonfillfinish\endgroup}% + \smallexamplefonts \rm + \display +} + +% @format: same as @display except don't narrow margins. +% +\def\format{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eformat = \nonfillfinish + \gobble +} +% +% @smallformat (when @smallbook): @format plus smaller fonts. +% +\def\smallformatx{\begingroup + \def\Esmallformat{\nonfillfinish\endgroup}% + \smallexamplefonts \rm + \format +} + +% @flushleft (same as @format). +% +\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} + +% @flushright. +% +\def\flushright{\begingroup + \let\nonarrowing = t + \nonfillstart + \let\Eflushright = \nonfillfinish + \advance\leftskip by 0pt plus 1fill + \gobble +} + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. +% +\def\quotation{% + \begingroup\inENV %This group ends at the end of the @quotation body + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \singlespace + \parindent=0pt + % We have retained a nonzero parskip for the environment, since we're + % doing normal filling. So to avoid extra space below the environment... + \def\Equotation{\parskip = 0pt \nonfillfinish}% + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \let\nonarrowing = \relax + \fi +} + + +% 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 '@' too +\def\dospecials{% + \do\ \do\\\do\@\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=12}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% 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}% + \catcode`\`=\active + \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 +% +\def\starttabbox{\setbox0=\hbox\bgroup} +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } +\endgroup +\def\setupverbatim{% + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + % 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`\{=12\catcode`\}=12 + \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] +%% Include LaTeX hack for completeness -- never know +%% \begingroup +%% \catcode`|=0 \catcode`[=1 +%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active +%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ +%% #1|endgroup|def|Everbatim[]|end[verbatim]] +%% |endgroup +\begingroup + \catcode`\ =\active + \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} +\endgroup +% +\def\verbatim{% + \def\Everbatim{\nonfillfinish\endgroup}% + \begingroup + \nonfillstart + \advance\leftskip by -\defbodyindent + \begingroup\setupverbatim\doverbatim +} + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +% Allow normal characters that we make active in the argument (a file name). +\def\verbatiminclude{% + \begingroup + \catcode`\\=12 + \catcode`~=12 + \catcode`^=12 + \catcode`_=12 + \catcode`|=12 + \catcode`<=12 + \catcode`>=12 + \catcode`+=12 + \parsearg\doverbatiminclude +} +\def\setupverbatiminclude{% + \begingroup + \nonfillstart + \advance\leftskip by -\defbodyindent + \begingroup\setupverbatim +} +% +\def\doverbatiminclude#1{% + % Restore active chars for included file. + \endgroup + \begingroup + \def\thisfile{#1}% + \expandafter\expandafter\setupverbatiminclude\input\thisfile + \endgroup\nonfillfinish\endgroup +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +\newbox\copyingbox +% +\def\copying{\begingroup + \parindent = 0pt % looks wrong on title page + \def\Ecopying{\egroup\endgroup}% + \global\setbox\copyingbox = \vbox\bgroup +} + +% @insertcopying. +% +\def\insertcopying{\unvcopy\copyingbox} + + +\message{defuns,} +% @defun etc. + +% Allow user to change definition object font (\df) internally +\def\setdeffont #1 {\csname DEF#1\endcsname} + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deftypemargin \deftypemargin=12pt +\newskip\deflastargmargin \deflastargmargin=18pt + +\newcount\parencount +% define \functionparens, which makes ( and ) and & do special things. +% \functionparens affects the group it is contained in. +\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 = ) + +{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) + +% 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. +\global\let(=\lparen \global\let)=\rparen +\global\let[=\lbrack \global\let]=\rbrack + +\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } +\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} +% This is used to turn on special parens +% but make & act ordinary (given that it's active). +\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} + +% Definitions of (, ) and & used in args for functions. +% This is the definition of ( outside of all parentheses. +\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested + \global\advance\parencount by 1 +} +% +% This is the definition of ( when already inside a level of parens. +\gdef\opnested{\char`\(\global\advance\parencount by 1 } +% +\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. + % also in that case restore the outer-level definition of (. + \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi + \global\advance \parencount by -1 } +% If we encounter &foo, then turn on ()-hacking afterwards +\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } +% +\gdef\normalparens{\boldbrax\let&=\ampnr} +} % End of definition inside \activeparens +%% These parens (in \boldbrax) actually are a little bolder than the +%% contained text. This is especially needed for [ and ] +\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } +\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } +\let\ampnr = \& +\def\lbrb{{\bf\char`\[}} +\def\rbrb{{\bf\char`\]}} + +% Active &'s sneak into the index arguments, so make sure it's defined. +{ + \catcode`& = 13 + \global\let& = \ampnr +} + +% First, defname, which formats the header line itself. +% #1 should be the function name. +% #2 should be the type of definition, such as "Function". + +\def\defname #1#2{% +% Get the values of \leftskip and \rightskip as they were +% outside the @def... +\dimen2=\leftskip +\advance\dimen2 by -\defbodyindent +\noindent +\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% +\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line +\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations +\parshape 2 0in \dimen0 \defargsindent \dimen1 +% Now output arg 2 ("Function" or some such) +% ending at \deftypemargin from the right margin, +% but stuck inside a box of width 0 so it does not interfere with linebreaking +{% Adjust \hsize to exclude the ambient margins, +% so that \rightline will obey them. +\advance \hsize by -\dimen2 +\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% +% Make all lines underfull and no complaints: +\tolerance=10000 \hbadness=10000 +\advance\leftskip by -\defbodyindent +\exdentamount=\defbodyindent +{\df #1}\enskip % Generate function name +} + +% Common pieces to start any @def... +% #1 is the \E... control sequence to end the definition (which we define). +% #2 is the \...x control sequence (which our caller defines). +% #3 is the control sequence to process the header, such as \defunheader. +% +\def\parsebodycommon#1#2#3{% + \begingroup\inENV + % 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 want to allow a + % break after all. + \ifnum\lastpenalty = 10000 \penalty0 \fi + \medbreak + % + % Define the \E... end token that this defining construct specifies + % so that it will exit this group. + \def#1{\endgraf\endgroup\medbreak}% + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +% Process body of @defun, @deffn, @defmac, etc. +% +\def\defparsebody#1#2#3{% + \parsebodycommon{#1}{#2}{#3}% + \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% + \catcode61=\active % 61 is `=' + \begingroup\obeylines\activeparens + \spacesplit#3% +} + +% #1, #2, #3 are the common arguments (see \defparsebody). +% #4, delimited by the space, is the class name. +% +\def\defmethparsebody#1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#4}}% +} + +% Used for @deftypemethod and @deftypeivar. +% #1, #2, #3 are the common arguments (see \defparsebody). +% #4, delimited by a space, is the class name. +% #5 is the method's return type. +% +\def\deftypemethparsebody#1#2#3#4 #5 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#4}{#5}}% +} + +% Used for @deftypeop. The change from \deftypemethparsebody is an +% extra argument at the beginning which is the `category', instead of it +% being the hardwired string `Method' or `Instance Variable'. We have +% to account for this both in the \...x definition and in parsing the +% input at hand. Thus also need a control sequence (passed as #5) for +% the \E... definition to assign the category name to. +% +\def\deftypeopparsebody#1#2#3#4#5 #6 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 ##3 {% + \def#4{##1}% + \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#5}{#6}}% +} + +% For @defop. +\def\defopparsebody #1#2#3#4#5 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 {\def#4{##1}% + \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% + \begingroup\obeylines\activeparens + \spacesplit{#3{#5}}% +} + +% These parsing functions are similar to the preceding ones +% except that they do not make parens into active characters. +% These are used for "variables" since they have no arguments. +% +\def\defvarparsebody #1#2#3{% + \parsebodycommon{#1}{#2}{#3}% + \def#2{\begingroup\obeylines\spacesplit#3}% + \catcode61=\active % + \begingroup\obeylines + \spacesplit#3% +} + +% @defopvar. +\def\defopvarparsebody #1#2#3#4#5 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 ##2 {\def#4{##1}% + \begingroup\obeylines\spacesplit{#3{##2}}}% + \begingroup\obeylines + \spacesplit{#3{#5}}% +} + +\def\defvrparsebody#1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \begingroup\obeylines + \spacesplit{#3{#4}}% +} + +% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the +% type is just `struct', because we lose the braces in `{struct +% termios}' when \spacesplit reads its undelimited argument. Sigh. +% \let\deftpparsebody=\defvrparsebody +% +% So, to get around this, we put \empty in with the type name. That +% way, TeX won't find exactly `{...}' as an undelimited argument, and +% won't strip off the braces. +% +\def\deftpparsebody #1#2#3#4 {% + \parsebodycommon{#1}{#2}{#3}% + \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% + \begingroup\obeylines + \spacesplit{\parsetpheaderline{#3{#4}}}\empty +} + +% Fine, but then we have to eventually remove the \empty *and* the +% braces (if any). That's what this does. +% +\def\removeemptybraces\empty#1\relax{#1} + +% After \spacesplit has done its work, this is called -- #1 is the final +% thing to call, #2 the type name (which starts with \empty), and #3 +% (which might be empty) the arguments. +% +\def\parsetpheaderline#1#2#3{% + #1{\removeemptybraces#2\relax}{#3}% +}% + +% Split up #2 at the first space token. +% call #1 with two arguments: +% the first is all of #2 before the space token, +% the second is all of #2 after that space token. +% If #2 contains no space token, all of it is passed as the first arg +% and the second is passed as empty. +% +{\obeylines +\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% +\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% +\ifx\relax #3% +#1{#2}{}\else #1{#2}{#3#4}\fi}} + +% Define @defun. + +% First, define the processing that is wanted for arguments of \defun +% Use this to expand the args and terminate the paragraph they make up + +\def\defunargs#1{\functionparens \sl +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +% Set the font temporarily and use \font in case \setfont made \tensl a macro. +{\tensl\hyphenchar\font=0}% +#1% +{\tensl\hyphenchar\font=45}% +\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\nobreak\vskip -\parskip\nobreak +} + +\def\deftypefunargs #1{% +% Expand, preventing hyphenation at `-' chars. +% Note that groups don't affect changes in \hyphenchar. +% Use \boldbraxnoamp, not \functionparens, so that & is not special. +\boldbraxnoamp +\tclose{#1}% avoid \code because of side effects on active chars +\interlinepenalty=10000 +\advance\rightskip by 0pt plus 1fil +\endgraf\nobreak\vskip -\parskip\nobreak +} + +% Do complete processing of one @defun or @defunx line already parsed. + +% @deffn Command forward-char nchars + +\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} + +\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% +\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defun == @deffn Function + +\def\defun{\defparsebody\Edefun\defunx\defunheader} + +\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDeffunc}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefun int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} + +% #1 is the data type. #2 is the name and args. +\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} +% #1 is the data type, #2 the name, #3 the args. +\def\deftypefunheaderx #1#2 #3\relax{% +\doind {fn}{\code{#2}}% Make entry in function index +\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% +\deftypefunargs {#3}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) + +\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} + +% \defheaderxcond#1\relax$.$ +% puts #1 in @code, followed by a space, but does nothing if #1 is null. +\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} + +% #1 is the classification. #2 is the data type. #3 is the name and args. +\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} +% #1 is the classification, #2 the data type, #3 the name, #4 the args. +\def\deftypefnheaderx #1#2#3 #4\relax{% +\doind {fn}{\code{#3}}% Make entry in function index +\begingroup +\normalparens % notably, turn off `&' magic, which prevents +% at least some C++ text from working +\defname {\defheaderxcond#2\relax$.$#3}{#1}% +\deftypefunargs {#4}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defmac == @deffn Macro + +\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} + +\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDefmac}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defspec == @deffn Special Form + +\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} + +\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index +\begingroup\defname {#1}{\putwordDefspec}% +\defunargs {#2}\endgroup % +\catcode 61=\other % Turn off change made in \defparsebody +} + +% @defop CATEGORY CLASS OPERATION ARG... +% +\def\defop #1 {\def\defoptype{#1}% +\defopparsebody\Edefop\defopx\defopheader\defoptype} +% +\def\defopheader#1#2#3{% +\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index +\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% +\defunargs {#3}\endgroup % +} + +% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... +% +\def\deftypeop #1 {\def\deftypeopcategory{#1}% + \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader + \deftypeopcategory} +% +% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. +\def\deftypeopheader#1#2#3#4{% + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$.$#3} + {\deftypeopcategory\ \putwordon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup +} + +% @deftypemethod CLASS TYPE METHOD ARG... +% +\def\deftypemethod{% + \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% +% #1 is the class name, #2 the data type, #3 the method name, #4 the args. +\def\deftypemethodheader#1#2#3#4{% + \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% + \deftypefunargs{#4}% + \endgroup +} + +% @deftypeivar CLASS TYPE VARNAME +% +\def\deftypeivar{% + \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} +% +% #1 is the class name, #2 the data type, #3 the variable name. +\def\deftypeivarheader#1#2#3{% + \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index + \begingroup + \defname{\defheaderxcond#2\relax$.$#3} + {\putwordInstanceVariableof\ \code{#1}}% + \defvarargs{#3}% + \endgroup +} + +% @defmethod == @defop Method +% +\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} +% +% #1 is the class name, #2 the method name, #3 the args. +\def\defmethodheader#1#2#3{% + \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index + \begingroup + \defname{#2}{\putwordMethodon\ \code{#1}}% + \defunargs{#3}% + \endgroup +} + +% @defcv {Class Option} foo-class foo-flag + +\def\defcv #1 {\def\defcvtype{#1}% +\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} + +\def\defcvarheader #1#2#3{% +\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index +\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% +\defvarargs {#3}\endgroup % +} + +% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME +% +\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} +% +\def\defivarheader#1#2#3{% + \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index + \begingroup + \defname{#2}{\putwordInstanceVariableof\ #1}% + \defvarargs{#3}% + \endgroup +} + +% @defvar +% First, define the processing that is wanted for arguments of @defvar. +% This is actually simple: just print them in roman. +% This must expand the args and terminate the paragraph they make up +\def\defvarargs #1{\normalparens #1% +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak} + +% @defvr Counter foo-count + +\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} + +\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% +\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} + +% @defvar == @defvr Variable + +\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} + +\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{\putwordDefvar}% +\defvarargs {#2}\endgroup % +} + +% @defopt == @defvr {User Option} + +\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} + +\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index +\begingroup\defname {#1}{\putwordDefopt}% +\defvarargs {#2}\endgroup % +} + +% @deftypevar int foobar + +\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} + +% #1 is the data type. #2 is the name, perhaps followed by text that +% is actually part of the data type, which should not be put into the index. +\def\deftypevarheader #1#2{% +\dovarind#2 \relax% Make entry in variables index +\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak +\endgroup} +\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} + +% @deftypevr {Global Flag} int enable + +\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} + +\def\deftypevrheader #1#2#3{\dovarind#3 \relax% +\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} +\interlinepenalty=10000 +\endgraf\nobreak\vskip -\parskip\nobreak +\endgroup} + +% Now define @deftp +% Args are printed in bold, a slight difference from @defvar. + +\def\deftpargs #1{\bf \defvarargs{#1}} + +% @deftp Class window height width ... + +\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} + +\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% +\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} + +% These definitions are used if you use @defunx (etc.) +% anywhere other than immediately after a @defun or @defunx. +% +\def\defcvx#1 {\errmessage{@defcvx in invalid context}} +\def\deffnx#1 {\errmessage{@deffnx in invalid context}} +\def\defivarx#1 {\errmessage{@defivarx in invalid context}} +\def\defmacx#1 {\errmessage{@defmacx in invalid context}} +\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} +\def\defoptx #1 {\errmessage{@defoptx in invalid context}} +\def\defopx#1 {\errmessage{@defopx in invalid context}} +\def\defspecx#1 {\errmessage{@defspecx in invalid context}} +\def\deftpx#1 {\errmessage{@deftpx in invalid context}} +\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} +\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} +\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} +\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} +\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} +\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} +\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} +\def\defunx#1 {\errmessage{@defunx in invalid context}} +\def\defvarx#1 {\errmessage{@defvarx in invalid context}} +\def\defvrx#1 {\errmessage{@defvrx in invalid context}} + + +\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\undefined + \newwrite\macscribble + \def\scanmacro#1{% + \begingroup \newlinechar`\^^M + % Undo catcode changes of \startcontents and \doprintindex + \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ + % Append \endinput to make sure that TeX does not see the ending newline. + \toks0={#1\endinput}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \let\xeatspaces\eatspaces + \input \jobname.tmp + \endgroup +} +\else +\def\scanmacro#1{% +\begingroup \newlinechar`\^^M +% Undo catcode changes of \startcontents and \doprintindex +\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ +\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} +\fi + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? +\def\macrolist{} % List of all defined macros in the form + % \do\macro1\do\macro2... + +% Utility routines. +% Thisdoes \let #1 = #2, except with \csnames. +\def\cslet#1#2{% +\expandafter\expandafter +\expandafter\let +\expandafter\expandafter +\csname#1\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=12\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 \. + +% 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\macrobodyctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\@=12 + \catcode`\^^M=12 + \usembodybackslash} + +\def\macroargctxt{% + \catcode`\~=12 + \catcode`\^=12 + \catcode`\_=12 + \catcode`\|=12 + \catcode`\<=12 + \catcode`\>=12 + \catcode`\+=12 + \catcode`\@=12 + \catcode`\\=12} + +% \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\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% + \else + \expandafter\parsemargdef \argl;% + \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% + % Add the macroname to \macrolist + \toks0 = \expandafter{\macrolist\do}% + \xdef\macrolist{\the\toks0 + \expandafter\noexpand\csname\the\macname\endcsname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\def\unmacro{\parsearg\unmacroxxx} +\def\unmacroxxx#1{% + \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 + \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% + \def\do##1{% + \def\tempb{##1}% + \ifx\tempa\tempb + % remove this + \else + \toks0 = \expandafter{\newmacrolist\do}% + \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% + \fi}% + \def\newmacrolist{}% + % Execute macro list to define \newmacrolist + \macrolist + \global\let\macrolist\newmacrolist + \endgroup + \else + \errmessage{Macro #1 not defined}% + \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}} + +% 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 be ##N where N is the position in that list. +% 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. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\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} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, 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 % many + \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}}% + \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 % many + \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}% + \fi + \fi} + +\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\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \next} + +% We mant to disable all macros during \shipout so that they are not +% expanded by \write. +\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% + \edef\next{\macrolist}\expandafter\endgroup\next} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{\ignoreactivespaces +\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% + \expandafter\noexpand\csname#2\endcsname}% +\expandafter\endgroup\next} + + +\message{cross references,} +% @xref etc. + +\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 job is to define \lastnode. +\def\node{\ENVcheck\parsearg\nodezzz} +\def\nodezzz#1{\nodexxx [#1,]} +\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\let\nwnode=\node +\let\lastnode=\relax + +% The sectioning commands (@chapter, etc.) call these. +\def\donoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Ysectionnumberandtype}% + \global\let\lastnode=\relax + \fi +} +\def\unnumbnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% + \global\let\lastnode=\relax + \fi +} +\def\appendixnoderef{% + \ifx\lastnode\relax\else + \expandafter\expandafter\expandafter\setref{\lastnode}% + {Yappendixletterandtype}% + \global\let\lastnode=\relax + \fi +} + + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME, namely +% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have +% to set \indexdummies so commands such as @code in a section title +% aren't expanded. It would be nicer not to expand the titles in the +% first place, but there's so many layers that that is hard to do. +% +\def\setref#1#2{{% + \indexdummies + \pdfmkdest{#1}% + \dosetq{#1-title}{Ytitle}% + \dosetq{#1-pg}{Ypagenumber}% + \dosetq{#1-snt}{#2}% +}} + +% @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,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printednodename{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual}% + \setbox0=\hbox{\printednodename}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printednodename{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printednodename{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printednodename{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printednodename{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % If we use \unhbox0 and \unhbox1 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. + \ifpdf + \leavevmode + \getfilename{#4}% + {\normalturnoffactive + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{#1}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{#1}% + \fi + }% + \linkcolor + \fi + % + \ifdim \wd1 > 0pt + \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + \else + % _ (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. + {\normalturnoffactive + % 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 + }% + % [mynode], + [\printednodename],\space + % page 3 + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi + \endlink +\endgroup} + +% \dosetq is the interface for calls from other macros + +% Use \normalturnoffactive so that punctuation chars such as underscore +% and backslash work in node names. (\turnoffactive doesn't do \.) +\def\dosetq#1#2{% + {\let\folio=0% + \normalturnoffactive + \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% + \iflinks + \next + \fi + }% +} + +% \internalsetq {foo}{page} expands into +% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} +% When the aux file is read, ' is the escape character + +\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} + +% Things to be expanded by \internalsetq + +\def\Ypagenumber{\folio} + +\def\Ytitle{\thissection} + +\def\Ynothing{} + +\def\Ysectionnumberandtype{% +\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % +\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\def\Yappendixletterandtype{% +\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% +\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % +\else \ifnum \subsubsecno=0 % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % +\else % +\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % +\fi \fi \fi } + +\gdef\xreftie{'tie} + +% 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 % Non-3.0. +\else + \def\linenumber{\the\inputlineno:\space} +\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{% + \expandafter\ifx\csname X#1\endcsname\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \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. + \csname X#1\endcsname + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. +% +\def\xrdef#1{\begingroup + % Reenable \ as an escape while reading the second argument. + \catcode`\\ = 0 + \afterassignment\endgroup + \expandafter\gdef\csname X#1\endcsname +} + +% Read the last existing aux file, if any. No error if none exists. +\def\readauxfile{\begingroup + \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 + \catcode`\@=\other + \catcode`\^=\other + % It was suggested to define this as 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 + \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 + % Make the characters 128-255 be printing characters + {% + \count 1=128 + \def\loop{% + \catcode\count 1=\other + \advance\count 1 by 1 + \ifnum \count 1<256 \loop \fi + }% + }% + % The aux file uses ' as the escape (for now). + % Turn off \ as an escape so we do not lose on + % entries which were dumped with control sequences in their names. + % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ + % Reference to such entries still does not work the way one would wish, + % but at least they do not bomb out when the aux file is read in. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\%=\other + \catcode`\'=0 + \catcode`\\=\other + % + \openin 1 \jobname.aux + \ifeof 1 \else + \closein 1 + \input \jobname.aux + \global\havexrefstrue + \global\warnedobstrue + \fi + % Open the new aux file. TeX will close it automatically at exit. + \openout\auxfile=\jobname.aux +\endgroup} + + +% 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 + +\let\ptexfootnote=\footnote + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \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}\/\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \footnotezzz +}% + +% 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 fail inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\long\gdef\footnotezzz{\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. + \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 + \futurelet\next\fo@t +} +\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} +\def\f@@t{\bgroup\aftergroup\@foot\let\next} +\def\f@t#1{#1\@foot} +\def\@foot{\strut\par\egroup} + +}%end \catcode `\@=11 + +% @| 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). +% +\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 + }% + }% +} + +% 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} + +% @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 + \closein 1 + % Do not bother showing banner with post-v2.7 epsf.tex (available in + % doc/epsf.tex until it shows up on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +% +% 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\undefined + \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 this 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 + \nobreak\bigskip + % 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 + \line\bgroup\hss + \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 \hss \egroup \bigbreak \fi % space after the image +\endgroup} + + +\message{localization,} +% and i18n. + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language abbreviation. +% It would be nice if we could set up a hyphenation file here. +% +\def\documentlanguage{\parsearg\dodocumentlanguage} +\def\dodocumentlanguage#1{% + \tex % read txi-??.tex file in plain TeX. + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \let\temp = \relax + \else + \def\temp{\input txi-#1.tex }% + \fi + \temp + \endgroup +} +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + + +% @documentencoding should change something in TeX eventually, most +% likely, but for now just recognize it. +\let\documentencoding = \comment + + +% Page size parameters. +% +\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 so finicky about underfull hboxes, either. +\hbadness = 2000 + +% Following George Bush, just 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. 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{% + \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 + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% Use `small' versions. +% +\def\smallenvironments{% + \let\smalldisplay = \smalldisplayx + \let\smallexample = \smalllispx + \let\smallformat = \smallformatx + \let\smalllisp = \smalllispx +} + +% @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{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% +}} + +% Use @smallbook to reset parameters for 7x9.5 (or so) format. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \deftypemargin = 0pt + \defbodyindent = .5cm + \smallenvironments +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 12pt + % + \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % + \tolerance = 700 + \hfuzz = 1pt +}} + +% 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{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0mm + \deftypemargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm + % + \smallenvironments +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin +% 29mm, hence bottom margin 28mm, nominal side margin 3cm. +\def\afourlatex{{\globaldefs = 1 + \textleading = 13.6pt + % + \afourpaper + \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + % + % Must explicitly reset to 0 because we call \afourpaper, apparently, + % although this does not entirely make sense. + \globaldefs = 0 +}} + +% Use @afourwide to print on European A4 paper in wide format. +\def\afourwide{% + \afourpaper + \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% +} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\def\pagesizes{\parsearg\pagesizesxxx} +\def\pagesizesxxx#1{\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}% + % + \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\catcode`\$=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$}%$ font-lock fix + +% This macro is used to make a character print one way in ttfont +% where it can probably just be output, 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\_} +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} + +\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 +%\catcode 27=\active +%\def^^[{$\diamondsuit$} + +% Set up an active definition for =, but don't enable it most of the time. +{\catcode`\==\active +\global\def={{\tt \char 61}}} + +\catcode`+=\active +\catcode`\_=\active + +% 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} + +\catcode`\@=0 + +% \rawbackslashxx output one backslash character in current font +\global\chardef\rawbackslashxx=`\\ +%{\catcode`\\=\other +%@gdef@rawbackslashxx{\}} + +% \rawbackslash redefines \ as input to do \rawbackslashxx. +{\catcode`\\=\active +@gdef@rawbackslash{@let\=@rawbackslashxx }} + +% \normalbackslash outputs one backslash in fixed width font. +\def\normalbackslash{{\tt\rawbackslashxx}} + +% \catcode 17=0 % Define control-q +\catcode`\\=\active + +% Used sometimes to turn off (effectively) the active characters +% even after parsing them. +@def@turnoffactive{@let"=@normaldoublequote +@let\=@realbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus +@let$=@normaldollar}%$ font-lock fix + +@def@normalturnoffactive{@let"=@normaldoublequote +@let\=@normalbackslash +@let~=@normaltilde +@let^=@normalcaret +@let_=@normalunderscore +@let|=@normalverticalbar +@let<=@normalless +@let>=@normalgreater +@let+=@normalplus +@let$=@normaldollar}%$ font-lock fix + +% 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 back turn 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 look ok in all fonts, so just make them not special. +@catcode`@& = @other +@catcode`@# = @other +@catcode`@% = @other + +@c Set initial fonts. +@textfonts +@rm + + +@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: diff --git a/texinfos.am b/texinfos.am new file mode 100644 index 0000000..87676ff --- /dev/null +++ b/texinfos.am @@ -0,0 +1,206 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001 +## 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, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +## FIXME: should repeat all the stuff in this file. Instead should +## generate the contents in a smarter way. + +.texi.info: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +.texi.dvi: + TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \ +## Must set MAKEINFO like this so that version.texi will be found even +## if it is in srcdir. + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.texi: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +.texinfo.info: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +.texinfo: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +.texinfo.dvi: + TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \ +## Must set MAKEINFO like this so that version.texi will be found even +## if it is in srcdir. + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi.info: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +.txi.dvi: + TEXINPUTS=@TEXINFODIR@:$$TEXINPUTS \ +## Must set MAKEINFO like this so that version.texi will be found even +## if it is in srcdir. + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + +.txi: +## We want to force the .info file to be built in srcdir. This is +## probably the simplest way. However, at Cygnus .info files are +## always put into the build directory. So at runtime we select which +## rule to use. +## Note that we also remove the possible output files before running +## makeinfo. Otherwise, if the texinfo file shrinks (or if you start +## using --no-split), you'll be left with some dead info files lying +## around -- dead files which will end up in the distribution. +NOTCYGNUS @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] +NOTCYGNUS cd $(srcdir) \ +NOTCYGNUS && $(MAKEINFO) `echo $< | sed 's,.*/,,'` +CYGNUS @rm -f $@ $@-[0-9] $@-[0-9][0-9] +CYGNUS $(MAKEINFO) -I $(srcdir) $< + +## The way to make PostScript, for those who want it. +DVIPS = dvips +.dvi.ps: + $(DVIPS) $< -o $@ + +## 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. +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ +CYGNUS if test -f $$file; then d=.; else d=$(srcdir); fi; \ +NOTCYGNUS d=$(srcdir); \ +## We use these strange circumlocutions because we want the "ifile" to +## be relative, for the install. + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) +## Only run this code if install-info actually exists, and it is not +## the Debian install-info. FIXME: once Debian install-info goes +## away, we can remove this hack. + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ +## 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)/$$file";\ +## 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)/$$file || :;\ + done; \ + else : ; fi + +uninstall-info: + $(PRE_UNINSTALL) +## Run two loops here so that we can handle PRE_UNINSTALL and +## NORMAL_UNINSTALL correctly. + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + +dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ +## In Cygnus mode, allow info file to be in source or build dir. In +## other modes, allow only source dir. +NOTCYGNUS d=$(srcdir); \ +CYGNUS if test -f $$base; then d=.; else d=$(srcdir); fi; \ + for file in `cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done diff --git a/version.texi b/version.texi new file mode 100644 index 0000000..25286ef --- /dev/null +++ b/version.texi @@ -0,0 +1,3 @@ +@set UPDATED 6 January 1999 +@set EDITION 1.4-p6 +@set VERSION 1.4-p6 diff --git a/ylwrap b/ylwrap new file mode 100755 index 0000000..13fc38d --- /dev/null +++ b/ylwrap @@ -0,0 +1,123 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. +# Copyright (C) 1996, 1997, 1998 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Usage: +# ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]... +# * PROGRAM is program to run. +# * INPUT is the input file +# * OUTPUT is file PROG generates +# * DESIRED is file we actually want +# * ARGS are passed to PROG +# Any number of OUTPUT,DESIRED pairs may be used. + +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + /* | [A-Za-z]:\\*) ;; + */*) prog="`pwd`/$prog" ;; +esac + +# The input. +input="$1" +shift +case "$input" in + /* | [A-Za-z]:\\*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. Why? Because otherwise any + # debugging info in the generated file will point to the wrong + # place. This is really gross. + input="`pwd`/$input" + ;; +esac + +# We don't want to use the absolute path if the input in the current +# directory like when making a tar ball. +input_base=`echo $input | sed -e 's|.*/||'` +if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then + input=$input_base +fi + +pairlist= +while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift +done + +# 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$$ +trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +mkdir $dirname || exit 1 + +cd $dirname +case "$input" in + /* | [A-Za-z]:\\*) + # Absolute path; do nothing. + ;; + *) + # Make a symbolic link, hard link or hardcopy. + ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" . + ;; +esac +$prog ${1+"$@"} "$input" +status=$? + +if test $status -eq 0; then + set X $pairlist + shift + first=yes + while test "$#" -ne 0; do + if test -f "$1"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + /* | [A-Za-z]:\\*) target="$2";; + *) target="../$2";; + esac + mv "$1" "$target" || status=$? + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + status=1 + fi + fi + shift + shift + first=no + done +else + status=$? +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $status -- 2.7.4